decred/dcrwallet

Improved cold staking support

Closed this issue · 3 comments

jrick commented

There are individuals interested in performing offline staking. The basic workflow for this is:

  1. Have two wallets, an hot offline wallet and watching-only wallet
  2. Create unsigned split tx and ticket purchases through the watching-only wallet
  3. Sign transactions offline with the hot wallet
  4. Publish signed transactions from the watching-only wallet

There are other considerations for offline staking too, such as voting and revoking missed/expired tickets. Offline support for voting will never be possible as votes must be published immediately after being picked. Offline revoking is possible to perform, but it is simpler to revoke tickets on the voting wallet instead. This leaves ticket purchasing as the only operation that needs special offline support.

It is possible, but not easy, to buy tickets in an offline hot wallet setup using the createrawtransaction and/or createrawsstx RPCs. However, attempting to use these calls requires the user to manually perform tasks such as UTXO selection, fee estimation, and change handing -- all of which the watching wallet can perform. Therefore, there should be a new JSON-RPC method added that performs the same operations as the existing purchaseticket call, but creates unsigned transactions and returns them in the result rather than publishing to the network.

Can I tackle this one?

+1 on the issue.

This is also needed to enable hardware wallets to sign the ticket, so ideally this should be added to grpc as well, so we can create unsigned tickets to be sent to hardware wallets inside decrediton.

This is (very very roughly) what needs to happen in the new createunsignedticket call (this is from my poc staking in trezor): matheusd@150ecc4

Basically, the purchaseTicket() functions needs to be refactored so that ticket authoring and signing are separate.

onyx4 commented

I opened another issue for an alternative to a complete hot/cold wallet. When using voting-only wallets with solo mining, or when staking with a pool, the hot wallet could be setup in a "ticket purchase" only restriction even when unlocked so funds cannot be moved out but only used to purchase tickets. Here are more details:
#1546