Skip to content

Commit

Permalink
Update eip-1577.md (ethereum#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid authored Nov 28, 2018
1 parent 37ef8ed commit 2fc6263
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions EIPS/eip-1577.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ The field `contenthash` is introduced, which permits a wide range of protocols t

The fields `content` and `multihash` are deprecated.

The encoding of the value depends on the content type specified by the protoCode; for instance, types in the range 0x00-0xf0 are encoded using [multihash](https://github.com/multiformats/multihash), meaning their format is specified as follows:
The value returned by `contenthash` MUST be represented as a machine-readable [multicodec](https://github.com/multiformats/multicodec). The format is specified as follows:

```
<protoCode uvarint><value []byte>
```

protoCodes and their meanings are specified in the [ensdomains/multicodec](https://github.com/ensdomains/multicodec) repository.

The encoding of the value depends on the content type specified by the protoCode; for instance, types in the range 0x00-0xf0 are encoded using [multihash](https://github.com/multiformats/multihash), meaning their value is formatted as follows:

```
<varint hash function code><varint digest size in bytes><hash function output>
```

When resolving a multiaddr, applications MUST use the protocol code to determine what type of address is encoded, and resolve the address appropriately for that protocol, if supported.
When resolving a `contenthash`, applications MUST use the protocol code to determine what type of address is encoded, and resolve the address appropriately for that protocol, if supported.

### Example

Expand Down

0 comments on commit 2fc6263

Please sign in to comment.