MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
2k stars 529 forks source link

Generate offline-transaction from keypairs generated via generate-keypair #8928

Open bkase opened 3 years ago

bkase commented 3 years ago

Currently, we can only generate offline transactions with keypairs generated via Ledger or keypairs generated via the Client-SDK.

We wish to add a new command to the Mina client: mina client sign-transaction with flags similar to the send-payment command (but requiring eg. nonce, if the node is offline), include a --offline flag to represent intent to sign the transaction entirely offline (if this is missing, but all the other options are provided, the command should still succeed).

The format of the signed-transaction should be consistent with the Ledger's format -- see https://minaexplorer.com/broadcast-ledger for a sample (the models for this datatype should be in the Rosetta lib already)

bkase commented 3 years ago

I hacked something together based off of a code snippet @nholland94 sent me in the meantime:

with docker: https://gist.github.com/bkase/683382f1f98876be89bd05facb75bd96 without docker: https://gist.github.com/bkase/c437ba23b3218c5a481376f6474fcafe