Skip to content

Commit

Permalink
Add binance chain to EIP2304 (ethereum#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid authored and MadeofTin committed Nov 13, 2019
1 parent 10b375d commit 7de4a3d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions EIPS/eip-2304.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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/).

0 comments on commit 7de4a3d

Please sign in to comment.