---
# System prepended metadata

title: Untitled

---

```sequence
Participant Host
Participant Ledger
Note right of Ledger: The device will maintain\na "state" that requires\nthat the following\nprocotocl is followed\nand any stepping out of the\nprotocol will result\nin an error being returned.\nTo clear/cancel the state\nan APDU for RESET_TRANSACTION\nmust be sent
Note left of Host: Gather basic TX data\nincluding the inputs\nand the destination\ninformation for the\ntransaction
Host->Ledger: START_TRANSACTION\n[Total 43 or 75 bytes]\n{unlock_time:8 bytes}\n{input_count:1 byte}\n{output_count:1 byte}\n{tx_public_key:32 bytes}\n{payment_id?:1 byte}\n{payment_id:32 bytes}
Note right of Ledger: Set state expectations so\nthat we will know if the\napplication has attempted\nto step out of our protocol
Ledger->Host: OK
Note left of Host: sends over the\ninputs to use one\nat a time
Host->Ledger: LOAD_INPUT\n[Total 202 bytes]\n{tx_public_key:32 bytes}\n{output_index:1 byte}\n{amount:8 bytes}\n{mixin_key:32 bytes}{global_index:4 bytes}\n{mixin_key:32 bytes}{global_index:4 bytes}\n{mixin_key:32 bytes}{global_index:4 bytes}\n{mixin_key:32 bytes}{global_index:4 bytes}\n{real_output_index:1 byte}
Ledger->Host: OK
Host->Ledger: LOAD_INPUTS_COMPLETE
Ledger->Host: OK
Note left of Host: Sends over the\ndestinations one\nat a time
Host->Ledger: LOAD_DESTINATION\n[Total 72 bytes]\n{public_view:32 bytes}\n{public_spend:32 bytes}\n{amount:8 bytes}
Note right of Ledger: Prompt user to verify\nthe destination\ninformation
Ledger->Host: OK
Host->Ledger: LOAD_DESTINATIONS_COMPLETE
Ledger->Host: OK
Host->Ledger: FINALZE_TRANSACTION
Note right of Ledger: Prompt user to confirm\ntransaction creation
Note right of Ledger: Construct the\ntransaction by\ngenerating the\ntx_public_key,\nkey images, ring\n signatures, TX_EXTRA\nand etc.
Note right of Ledger: Destroy all data\nother than the raw\ntransaction and the\nhash of the transaction
Ledger->Host: TX_SIZE\n[Total 36 bytes]\n{tx_length:4 bytes}\n{tx_hash:32 bytes}
Note left of Host: Host then loops\nthrough requesting\nparts of the full\ntransaction\nuntil it has\nall of it
Host->Ledger: EXPORT_TX\n[Total 8 bytes]\n{start_offset:4 bytes}\n{end_offset:4 bytes}\nMaximum of 512-bytes at a time
Ledger->Host: {tx_bytes:0-512 bytes}
Host->Ledger: CLOSE_TRANSACTION
Note right of Ledger: Clear raw transaction\nfrom memory
Ledger->Host: OK
```