how do I generate this random cookie?
I take it that address variable is the address of the user right? the return value is the signature or the message?
This way of doing things though seems like using the address as the authenticating factor, and not a bitcoin/partherof. I was thinking of a system
where sending that specific bitcoin would grand access to the address for the system.
In that case, just generate the address yourself and present it to the user. Then use -walletnotify to monitor payments to that address. Unlock when the payment has enough confirmations.
If you want the transaction to purchase perpetual access rather than instant, just ask for a signing address before presenting the payment address, and tie them together in a database, then use the signmessage/verifymessage scheme above.