Add binance chain to EIP2304 (#2318)

This commit is contained in:
Nick Johnson 2019-10-21 16:58:50 +13:00 committed by GitHub
parent 9f47fdefd6
commit 60bad6b0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -67,6 +67,7 @@ A table of encodings for common blockchains is provided, followed by a more deta
| Bitcoin | base58check | `0x00 <20 byte hash>` | `0x76a914 <20 byte hash> 0x88ac` |
| Bitcoin | base58check | `0x05 <20 byte hash>` | `0xa914 <20 byte hash> 0x87` |
| Bitcoin | bech32 | `<witness version> <witness program>` | `<OP_n> <PUSH_m> <witness program>` |
| Binance | bech32 | `<public key hash>` | `<public key hash>` |
#### Ethereum
@ -100,6 +101,12 @@ The scriptPubkey encoding for a bech32 address, as defined in BIP141, is `OP_n`,
For example, the SegWit address `BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4` decodes to a version of `0` and a witness script of `751e76e8199196d454941c45d1b3a323f1433bd6`, and then encodes to a scriptPubkey of `0014751e76e8199196d454941c45d1b3a323f1433bd6`.
#### Binance Chain (BNB)
Binance addresses are encoded in bech32, with the human-readable prefix 'bnb'. The encoded data is simply the address, which can be converted to binary and stored directly.
For example, the BNB address `bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2` decodes to the binary representation `40c2979694bbc961023d1d27be6fc4d21a9febe6`, which is stored directly in ENS.
### Example
An example implementation of a resolver that supports this EIP is provided here:
@ -179,6 +186,7 @@ The table below specifies test vectors for valid address encodings for each cryp
| Bitcoin | `1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa` | `76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac` |
| Bitcoin | `3Ai1JZ8pdJb2ksieUV8FsxSNVJCpoPi8W6` | `a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1887` |
| Bitcoin | `BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4` | `0014751e76e8199196d454941c45d1b3a323f1433bd6` |
| Binance | `bnb1grpf0955h0ykzq3ar5nmum7y6gdfl6lxfn46h2` | `40c2979694bbc961023d1d27be6fc4d21a9febe6` |
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).