Skip to content

Commit

Permalink
docs(readme): add instructions of out-of-band transaction signing
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Jan 29, 2024
1 parent cd8afdc commit 9ffad3c
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,45 @@ killall safenode || true && RUST_LOG=safenode,safe cargo run --bin testnet -- --
`cargo run --release --bin safe -- wallet address`

- Send tokens to an address, this will output a Transfer hex string that you must send to the recipient out-of-band
`cargo run --release --bin safe -- wallet send [amount] [address]`
`cargo run --release --bin safe -- wallet send <amount> <address>`

- Receive tokens from a Transfer hex string
`cargo run --release --bin safe -- wallet receive [transfer]`
`cargo run --release --bin safe -- wallet receive <transfer>`

### Out of band transaction signing

Steps on the online device/computer:
1. Create a watch-only wallet using the hex-encoded public key:
`cargo run --release --bin safe -- wowallet create <hex-encoded public key>`

2. Deposit a cash-note, owned by the public key used above when creating, into the watch-only wallet:
`cargo run --release --bin safe -- wowallet deposit <hex-encoded public key> --cash-note <hex-encoded cash-note>`

3. Build an unsigned transaction:
`cargo run --release --bin safe -- wowallet transaction <hex-encoded public key> <amount> <recipient's hex-encoded public key>`

4. Copy the built unsigned Tx generated by the above command, and send it out-of-band to the desired device where the hot-wallet can be loaded.

Steps on the offline device/computer:

5. If you still don't have a hot-wallet created, which owns the cash-notes used to build the unsigned transaction, create it with the corresponding secret key:
`cargo run --release --bin safe -- wallet create <hex-encoded secret key>`

6. Use the hot-wallet to sign the built transaction:
`cargo run --release --bin safe -- wallet sign <unsigned transaction>`

7. Copy the signed Tx generated by the above command, and send it out-of-band back to the online device.

Steps on the online device/computer:

8. Broadcast the signed transaction to the network using the watch-only wallet:
`cargo run --release --bin safe -- wowallet broadcast <signed transaction>`

9. Deposit the change cash-note to the watch-only wallet:
`cargo run --release --bin safe -- wowallet deposit <hex-encoded public key> <change cash-note>`

10. Send/share the output cash-note generated by the above command at step #8 to/with the recipient.


## Auditing

Expand Down

0 comments on commit 9ffad3c

Please sign in to comment.