Offline transaction signing
Iron Fish allows you to create an account on a computer disconnected from the Internet, but still send and receive transactions with that account. Sending transactions by using an account stored on a disconnected computer is known as "offline signing."
When signing transactions offline, you'll need to run two Iron Fish nodes:
- Online: an online node that is connected to the Internet and the Iron Fish network
- Offline: an offline node that holds your spending keys
You'll also need a secure method of moving files between the online node and offline node, like an encrypted USB drive.
The following steps explain the process for creating an account for offline signing and for sending transactions with that account.
Create a spending account
On the offline node, run the following command to create an account, replacing accountName
with the name of your choice:
Or, if you've already created a spending account, copy it to the offline node and run:
Export a view-only key
On the offline node, run the following command to export a view-only key. The view-only key allows read-only viewing of transactions related to the account, but does not allow sending transactions.
This will display output like the following:
Copy that line to the online node.
Import a view-only key
On the online node, using the output from the wallet:export
command, run the following command:
The online node will be able to view all transactions involving the account, but will not be able to spend notes.
Receive transactions
On either the offline node or the online node, you can retrieve your account's public key by running:
Sharing this public key with other users allows them to send you transactions. When you've received transactions, you can view them (along with your balances) by running the following commands on your online node:
Create a raw transaction
Once you have assets in your account, you can send assets to another account by using the online node to create a raw transaction.
A raw transaction contains the parameters of a transaction, like which notes will be spent, which notes will be created, and who will own the notes. A view-only account can generate a raw transaction, but the transaction cannot be submitted to the Iron Fish network until it is posted by a corresponding spending account.
Run the following command on the online node:
This will display output like the following:
The data between "Raw Transaction" and "Run..." is your raw transaction. Copy this value to the offline node.
Post a raw transaction
Once the raw transaction is on the offline node, run the following command on the offline node:
This will display output like the following:
The data after the line starting with "Posted transaction" is your posted transaction. Copy this to the online node.
Send a posted transaction
Finally, once the posted transaction is on the online node, run the following command on the online node:
This will add the transaction to your wallet and broadcast it out to the Iron Fish network. You can run the following command to display transactions associated with your account:
The transaction you've added will display in the 'pending' status until it's included in a block.