Externalize ERC 20 support

This commit is contained in:
BTChip github
2019-02-05 14:50:36 +01:00
parent 855d47b5af
commit b01c37e2ee
4 changed files with 149 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
Ethereum application : Common Technical Specifications
=======================================================
Ledger Firmware Team <hello@ledger.fr>
Application version 1.2 - 19th of August 2017
Application version 1.1.10 - 4th of February 2019
## 1.0
- Initial release
@@ -13,6 +13,9 @@ Application version 1.2 - 19th of August 2017
## 1.2
- Add SIGN ETH PERSONAL MESSAGE
## 1.1.10
- Add PROVIDE ERC 20 TOKEN INFORMATION
## About
This application describes the APDU messages interface to communicate with the Ethereum application.
@@ -188,6 +191,47 @@ The input data is the message to sign, streamed to the device in 255 bytes maxim
|==============================================================================================================================
### PROVIDE ERC 20 TOKEN INFORMATION
#### Description
This commands provides a trusted description of an ERC 20 token to associate a contract address with a ticker and number of decimals.
It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper token information to the user if necessary, as marked in GET APP CONFIGURATION flags.
The signature is computed on
ticker || address || number of decimals (uint4be) || chainId (uint4be)
signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f0976b22d3388a9a5e446ac62d25cf725b62a2555b2dd464a4da0ab2f4d506820543af1d242470b1b1a969a27578f353
#### Coding
'Command'
[width="80%"]
|==============================================================================================================================
| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
| E0 | 0A | 00 | 00 | variable | 00
|==============================================================================================================================
'Input data'
[width="80%"]
|==============================================================================================================================
| *Description* | *Length*
| Length of ERC 20 ticker | 1
| ERC 20 ticker | variable
| ERC 20 contract address | 20
| Number of decimals (big endian encoded) | 4
| Chain ID (big endian encoded) | 4
| Token information signature | variable
|==============================================================================================================================
'Output data'
None
### GET APP CONFIGURATION
#### Description
@@ -215,6 +259,8 @@ None
| *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