Skip to main content
Zondax Github LinkZondax Github Link
Theme SwitchTheme Switch

Arweave App

General structure

The general structure of commands and responses is as follows:

Commands

FieldTypeContentNote
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID
P1byte (1)Parameter 1
P2byte (1)Parameter 2
Lbyte (1)Bytes in payload
PAYLOADbyte (L)Payload

Response

FieldTypeContentNote
ANSWERbyte (?)Answerdepends on the command
SW1-SW2byte (2)Return codesee list of return codes

Command definition

GET_VERSION

Command

FieldTypeContentExpected
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID0x00
P1byte (1)Parameter 1ignored
P2byte (1)Parameter 2ignored
Lbyte (1)Bytes in payload0

Response

FieldTypeContentNote
TESTbyte (1)Test Mode0xFF means test mode is enabled
MAJORbyte (1)Version Major
MINORbyte (1)Version Minor
PATCHbyte (1)Version Patch
LOCKEDbyte (1)Device is locked
SW1-SW2byte (2)Return codesee list of return codes

GET_ADDRESS

Command

FieldTypeContentExpected
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID0x01
P1byte (1)Request User confirmationNo = 0
P2byte (1)Parameter 2Ignored
Lbyte (1)Bytes in payloadexpected = 0

Response

FieldTypeContentNote
ADDRbyte (43)AddressEncoded as B64URL
SW1-SW2byte (2)Return codesee list of return codes

SIGN

This command shows the transaction content on screen and signs (if accepted) the transaction. The "owner" of the transaction should be the public-key of the ledger device (restricted). The RSA signature is stored in secure flash and should be retrieved using GET_SIG commands. It returns the 48-byte deephash of the transaction blob for (optional) verification.

Command

FieldTypeContentExpected
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID0x02
P1byte (1)Payload desc0 = init
1 = add
2 = last
P2byte (1)----not used
Lbyte (1)Bytes in payload(depends)

The first packet/chunk is empty (there is no derivation path)

All other packets/chunks contain data chunks that are described below

First Packet

empty

Other Chunks/Packets
FieldTypeContentExpected
Databytes...Message

Data is defined as:

FieldTypeContentExpected
Messagebytes..tx to sign
FieldTypeContentExpected
format_len2 bytes
format? bytesASCII string
owner_len2 bytes
owner? bytesBytes - Show as b64Url512 bytes??
target_len2 bytes
target? bytesBytes - Show as b64Url
quantity_len2 bytes
quantity? bytesASCII string
reward_len2 bytes
reward? bytesASCII string
last_tx_len2 bytes
last_tx? bytes
.
tag_count2 bytes
.will repeat multiple times
-- tag_name_len2 bytes
-- tag_name? bytes
-- tag_value_len2 bytes
-- tag_value? bytes
.
data_size_len2 bytes
data_size? bytesSize encoded as an ASCII number
data? bytes

Response

FieldTypeContentNote
Hashbyte (48)DeephashDeephash of tx blob
SW1-SW2byte (2)Return codesee list of return codes

GET_SIG

This command can be taken to get the RSA signature of the ledger out. It requires to have a successful SIGN command (see above) to have happened before. Only index = 0 or index = 1 are allowed, that return the first and second part of the RSA-4096 signature. After index = 1 is retrieved the signature in flash is zeroized.

Command

FieldTypeContentExpected
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID0x10
P1byte (1)Request User confirmationIgnored
P2byte (1)Parameter 2Index = 0 or 1
Lbyte (1)Bytes in payloadexpected = 0

Response

FieldTypeContentNote
SIG_PARTbyte (256)Public key partSignature bytes [256 i ... 256 (i+1)]
SW1-SW2byte (2)Return codesee list of return codes

GET_PK

This command can be taken to get the "owner" (the RSA public key) of the ledger out. Only index = 0 or index = 1 are allowed, that return the first and second part of the RSA-4096 public key.

Command

FieldTypeContentExpected
CLAbyte (1)Application Identifier0x44
INSbyte (1)Instruction ID0x20
P1byte (1)Request User confirmationIgnored
P2byte (1)Parameter 2Index = 0 or 1
Lbyte (1)Bytes in payloadexpected = 0

Response

FieldTypeContentNote
PK_PARTbyte (256)Public key partPubkey bytes [256 i ... 256 (i+1)]
SW1-SW2byte (2)Return codesee list of return codes