Reordered the APDUs by INS values in the doc
Also changed from CRLF encoding to simple LF
This commit is contained in:
343
doc/ethapp.asc
343
doc/ethapp.asc
@@ -150,6 +150,41 @@ The input data is the RLP encoded transaction (as per https://github.com/ethereu
|
|||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
### GET APP CONFIGURATION
|
||||||
|
|
||||||
|
#### Description
|
||||||
|
|
||||||
|
This command returns specific application configuration
|
||||||
|
|
||||||
|
#### Coding
|
||||||
|
|
||||||
|
'Command'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
||||||
|
| E0 | 06 | 00 | 00 | 00 | 04
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Input data'
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
'Output data'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| Flags
|
||||||
|
0x01 : arbitrary data signature enabled by user
|
||||||
|
|
||||||
|
0x02 : ERC 20 Token information needs to be provided externally
|
||||||
|
| 01
|
||||||
|
| Application major version | 01
|
||||||
|
| Application minor version | 01
|
||||||
|
| Application patch version | 01
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
### SIGN ETH PERSONAL MESSAGE
|
### SIGN ETH PERSONAL MESSAGE
|
||||||
|
|
||||||
@@ -248,17 +283,16 @@ signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f
|
|||||||
|
|
||||||
None
|
None
|
||||||
|
|
||||||
### PROVIDE NFT INFORMATION
|
|
||||||
|
### SIGN ETH EIP 712
|
||||||
|
|
||||||
#### Description
|
#### Description
|
||||||
|
|
||||||
This commands provides a trusted description of an NFT to associate a contract address with a collectionName.
|
This command signs an Ethereum message following the EIP 712 specification (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md)
|
||||||
|
|
||||||
It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper nft information to the user if necessary, as marked in GET APP CONFIGURATION flags.
|
For implementation version 0, the domain hash and message hash are provided to the device, which displays them and returns the signature
|
||||||
|
|
||||||
The signature is computed on:
|
This command has been supported since firmware version 1.5.0
|
||||||
|
|
||||||
type || version || len(collectionName) || collectionName || address || chainId || keyId || algorithmId
|
|
||||||
|
|
||||||
#### Coding
|
#### Coding
|
||||||
|
|
||||||
@@ -267,7 +301,8 @@ type || version || len(collectionName) || collectionName || address || chainId |
|
|||||||
[width="80%"]
|
[width="80%"]
|
||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
||||||
| E0 | 14 | 00 | 00 | variable | 00
|
| E0 | 0C | 00
|
||||||
|
| implementation version : 00 | variable | variable
|
||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
|
|
||||||
'Input data'
|
'Input data'
|
||||||
@@ -275,16 +310,93 @@ type || version || len(collectionName) || collectionName || address || chainId |
|
|||||||
[width="80%"]
|
[width="80%"]
|
||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
| *Description* | *Length*
|
| *Description* | *Length*
|
||||||
| Type | 1
|
| Number of BIP 32 derivations to perform (max 10) | 1
|
||||||
| Version | 1
|
| First derivation index (big endian) | 4
|
||||||
| Collection Name Length | 1
|
| ... | 4
|
||||||
| Collection Name | variable
|
| Last derivation index (big endian) | 4
|
||||||
| Address | 20
|
| Domain hash | 32
|
||||||
| Chain ID | 8
|
| Message hash | 32
|
||||||
| KeyID | 1
|
|==============================================================================================================================
|
||||||
| Algorithm ID | 1
|
|
||||||
| Signature Length | 1
|
'Output data'
|
||||||
| Signature | variable
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| v | 1
|
||||||
|
| r | 32
|
||||||
|
| s | 32
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
### GET ETH2 PUBLIC KEY
|
||||||
|
|
||||||
|
#### Description
|
||||||
|
|
||||||
|
This command returns an Ethereum 2 BLS12-381 public key derived following EIP 2333 specification (https://eips.ethereum.org/EIPS/eip-2333)
|
||||||
|
|
||||||
|
This command has been supported since firmware version 1.6.0
|
||||||
|
|
||||||
|
#### Coding
|
||||||
|
|
||||||
|
'Command'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
||||||
|
| E0 | 0E | 00 : return public key
|
||||||
|
|
||||||
|
01 : display public key and confirm before returning
|
||||||
|
| 00 | variable | variable
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Input data'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| Number of BIP 32 derivations to perform (max 10) | 1
|
||||||
|
| First derivation index (big endian) | 4
|
||||||
|
| ... | 4
|
||||||
|
| Last derivation index (big endian) | 4
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Output data'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| Public key | 48
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
### SET ETH2 WITHDRAWAL INDEX
|
||||||
|
|
||||||
|
#### Description
|
||||||
|
|
||||||
|
This command sets the index of the Withdrawal key used as withdrawal credentials in an ETH2 deposit contract call signature. The path of the Withdrawal key is defined as m/12381/3600/index/0 according to EIP 2334 (https://eips.ethereum.org/EIPS/eip-2334)
|
||||||
|
|
||||||
|
The default index used is 0 if this method isn't called before the deposit contract transaction is sent to the device to be signed
|
||||||
|
|
||||||
|
This command has been supported since firmware version 1.5.0
|
||||||
|
|
||||||
|
#### Coding
|
||||||
|
|
||||||
|
'Command'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
||||||
|
| E0 | 10 | 00
|
||||||
|
| 00 | variable | variable
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Input data'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| Withdrawal key index (big endian) | 4
|
||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
|
|
||||||
'Output data'
|
'Output data'
|
||||||
@@ -334,6 +446,51 @@ signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f
|
|||||||
|
|
||||||
None
|
None
|
||||||
|
|
||||||
|
|
||||||
|
### PROVIDE NFT INFORMATION
|
||||||
|
|
||||||
|
#### Description
|
||||||
|
|
||||||
|
This commands provides a trusted description of an NFT to associate a contract address with a collectionName.
|
||||||
|
|
||||||
|
It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper nft information to the user if necessary, as marked in GET APP CONFIGURATION flags.
|
||||||
|
|
||||||
|
The signature is computed on:
|
||||||
|
|
||||||
|
type || version || len(collectionName) || collectionName || address || chainId || keyId || algorithmId
|
||||||
|
|
||||||
|
#### Coding
|
||||||
|
|
||||||
|
'Command'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
||||||
|
| E0 | 14 | 00 | 00 | variable | 00
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Input data'
|
||||||
|
|
||||||
|
[width="80%"]
|
||||||
|
|==============================================================================================================================
|
||||||
|
| *Description* | *Length*
|
||||||
|
| Type | 1
|
||||||
|
| Version | 1
|
||||||
|
| Collection Name Length | 1
|
||||||
|
| Collection Name | variable
|
||||||
|
| Address | 20
|
||||||
|
| Chain ID | 8
|
||||||
|
| KeyID | 1
|
||||||
|
| Algorithm ID | 1
|
||||||
|
| Signature Length | 1
|
||||||
|
| Signature | variable
|
||||||
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
'Output data'
|
||||||
|
|
||||||
|
None
|
||||||
|
|
||||||
|
|
||||||
### SET PLUGIN
|
### SET PLUGIN
|
||||||
|
|
||||||
#### Description
|
#### Description
|
||||||
@@ -430,158 +587,6 @@ All data can be optionally checked on the device before being returned.
|
|||||||
|==============================================================================================================================
|
|==============================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
### GET APP CONFIGURATION
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
|
|
||||||
This command returns specific application configuration
|
|
||||||
|
|
||||||
#### Coding
|
|
||||||
|
|
||||||
'Command'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
|
||||||
| E0 | 06 | 00 | 00 | 00 | 04
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Input data'
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
'Output data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| Flags
|
|
||||||
0x01 : arbitrary data signature enabled by user
|
|
||||||
|
|
||||||
0x02 : ERC 20 Token information needs to be provided externally
|
|
||||||
| 01
|
|
||||||
| Application major version | 01
|
|
||||||
| Application minor version | 01
|
|
||||||
| Application patch version | 01
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
### SIGN ETH EIP 712
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
|
|
||||||
This command signs an Ethereum message following the EIP 712 specification (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md)
|
|
||||||
|
|
||||||
For implementation version 0, the domain hash and message hash are provided to the device, which displays them and returns the signature
|
|
||||||
|
|
||||||
This command has been supported since firmware version 1.5.0
|
|
||||||
|
|
||||||
#### Coding
|
|
||||||
|
|
||||||
'Command'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
|
||||||
| E0 | 0C | 00
|
|
||||||
| implementation version : 00 | variable | variable
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Input data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| Number of BIP 32 derivations to perform (max 10) | 1
|
|
||||||
| First derivation index (big endian) | 4
|
|
||||||
| ... | 4
|
|
||||||
| Last derivation index (big endian) | 4
|
|
||||||
| Domain hash | 32
|
|
||||||
| Message hash | 32
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Output data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| v | 1
|
|
||||||
| r | 32
|
|
||||||
| s | 32
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
### GET ETH2 PUBLIC KEY
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
|
|
||||||
This command returns an Ethereum 2 BLS12-381 public key derived following EIP 2333 specification (https://eips.ethereum.org/EIPS/eip-2333)
|
|
||||||
|
|
||||||
This command has been supported since firmware version 1.6.0
|
|
||||||
|
|
||||||
#### Coding
|
|
||||||
|
|
||||||
'Command'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
|
||||||
| E0 | 0E | 00 : return public key
|
|
||||||
|
|
||||||
01 : display public key and confirm before returning
|
|
||||||
| 00 | variable | variable
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Input data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| Number of BIP 32 derivations to perform (max 10) | 1
|
|
||||||
| First derivation index (big endian) | 4
|
|
||||||
| ... | 4
|
|
||||||
| Last derivation index (big endian) | 4
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Output data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| Public key | 48
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
### SET ETH2 WITHDRAWAL INDEX
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
|
|
||||||
This command sets the index of the Withdrawal key used as withdrawal credentials in an ETH2 deposit contract call signature. The path of the Withdrawal key is defined as m/12381/3600/index/0 according to EIP 2334 (https://eips.ethereum.org/EIPS/eip-2334)
|
|
||||||
|
|
||||||
The default index used is 0 if this method isn't called before the deposit contract transaction is sent to the device to be signed
|
|
||||||
|
|
||||||
This command has been supported since firmware version 1.5.0
|
|
||||||
|
|
||||||
#### Coding
|
|
||||||
|
|
||||||
'Command'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
|
|
||||||
| E0 | 10 | 00
|
|
||||||
| 00 | variable | variable
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Input data'
|
|
||||||
|
|
||||||
[width="80%"]
|
|
||||||
|==============================================================================================================================
|
|
||||||
| *Description* | *Length*
|
|
||||||
| Withdrawal key index (big endian) | 4
|
|
||||||
|==============================================================================================================================
|
|
||||||
|
|
||||||
'Output data'
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
## Transport protocol
|
## Transport protocol
|
||||||
|
|
||||||
### General transport description
|
### General transport description
|
||||||
|
|||||||
Reference in New Issue
Block a user