Skip to content

raw transaction

Doron Somech requested to merge somdoron/zenprotocol:RawTransaction into master

Raw transaction enable the wallet to create a transaction with all the information need for signing but sign it in another machine or by other parties.

This enable both cold storage and multisig by multiple parties (when the multi-sig lock will be available).

This pull request add the ability to create, sign and publish a raw transaction.

Everything is exposed in the API and can also be done from the API, like so:

# creating a file TXHASH.raw
zen-cli rawtx-create 00 100 tzn1qxp6ekp72q8903efylsnej34pa940cd2xae03l49pe7hkg3mrc26qyh2rgr

# update the TXHASH.raw with signatures
zen-cli rawtx-sign 1234 232e7ab1693e82d1d3f4b71c56b432eea598486594ca01a5812481f3fa02b456.raw 

# publish raw transaction to network
zen-cli rawtx-publish 232e7ab1693e82d1d3f4b71c56b432eea598486594ca01a5812481f3fa02b456.raw 

Of course the sign operation should be done on another machine in case of cold storage.

Regarding cold storage, we already have a commands (and API calls) to export the zen public key and import zen public key and creating a read-only account:

zen-cli exportzenpublickey
# tpubDCeTZv9MDcNe6Ahv8UQaoAWhK9XKmpzzJjpiVbCZ4jhsJYdN67Qh18nDjuJFtWfGfLL2hRkGid6Ga5h2FoW9QoRjdcEUQRBW4tkpkCbMtKb

zen-cli importzenpublickey tpubDCeTZv9MDcNe6Ahv8UQaoAWhK9XKmpzzJjpiVbCZ4jhsJYdN67Qh18nDjuJFtWfGfLL2hRkGid6Ga5h2FoW9QoRjdcEUQRBW4tkpkCbMtKb

I also added the ability to create a wallet without mnemonic phrase (generated for you) from the CLI. This is important for the secure computer, which need a way to generate mnemonic from the cli.

# to generate wallet
zen-cli wallet-create PASSWORD

# to get the mnemonic phrase
zen-cli mnemonicphrase PASSWORD
Edited by Doron Somech

Merge request reports