Skip to content

Commit

Permalink
doc(appearances): Fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
perama-v committed Aug 3, 2023
1 parent cb62356 commit 2fa1f65
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
57 changes: 39 additions & 18 deletions specs/appearances.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,58 +63,79 @@ An address has the following formal definition:
- MUST begin or end with `MIN_NONZERO_BYTES` non-zero bytes.
This allows for vanity address inclusion of up to `MAX_VANITY_ZERO_CHARS`.
- MUST NOT be a known precompile
- When detected within > 20 bytes, 32 bytes MUST appear with left padding (12 leading zero-bytes).
- When detected within byte sequence of greater than 20 bytes, the bytes MUST appear with left padding (12 leading zero-bytes for the case of a 32 byte sequence).
The address that meets the criteria is extracted from the source bytes.
- When inspecting >32 bytes, the bytes MUST first trimmed to a multiple of 32 bytes and divided
- When inspecting more than 32 bytes, the bytes MUST first trimmed to a multiple of 32 bytes and divided
into 32 byte sections (length modulo 32) to be examined separately.

The following examples show the detection and extraction of an address/addresses
from a sequence of bytes.
### Example "address"
Deposit contract address in a 32 byte hex string with left padding:
```command
"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa"
```
"0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa"
> ["0x00000000219ab540356cBB839Cbe05303d7705Fa"]
Result:
```console
["0x00000000219ab540356cbb839cbe05303d7705fa"]
```

Deposit contract address bytes, but shifted left. A valid address is detected,
but is not the deposit contract address:
```command
"0x00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000"
```
"0x00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000"
> ["0x219ab540356cBB839Cbe05303d7705Fa00000000"]
Result:
```console
["0x219ab540356cbb839cbe05303d7705fa00000000"]
```

Data from the two examples above, concatenated:
```command
"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000"
```
0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000
> ["0x219ab540356cBB839Cbe05303d7705Fa00000000", "0x00000000219ab540356cBB839Cbe05303d7705Fa]
Result:
```console
["0x219ab540356cbb839cbe05303d7705fa00000000", "0x00000000219ab540356cbb839cbe05303d7705fa]
```

Data from the example above, with additional bytes that are truncated as modulo 32 bytes:
```
0x00000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa00000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000
> ["0x219ab540356cBB839Cbe05303d7705Fa00000000", "0x00000000219ab540356cBB839Cbe05303d7705Fa]
"0x00000000000000000000000000000000219ab540356cbb839cbe05303d7705fa00000000000000000000219ab540356cbb839cbe05303d7705fa000000000000"
```
Result:
```console
["0x219ab540356cbb839cbe05303d7705fa00000000", "0x00000000219ab540356cbb839cbe05303d7705fa]
```

### Example "not address"

Deposit contract address in a 32 byte hex string with right padding. No address is detected because the leftmost 24 characters (12 bytes) must all be zeros:
```command
"0x00000000219ab540356cbb839cbe05303d7705fa000000000000000000000000"
```
"0x00000000219ab540356cBB839Cbe05303d7705Fa000000000000000000000000"
> []
Result:
```console
[]
```

No address is detected because the leftmost 24 characters (12 bytes) are ignored and the
remaining string has too many trailing 0's (`0x9Cbe05303d7705Fa000000000000000000000000`):
remaining string has too many trailing 0's (`0x9cbe05303d7705fa000000000000000000000000`):
```command
"0x0000000000000000000000009cbe05303d7705fa000000000000000000000000"
```
"0x0000000000000000000000009Cbe05303d7705Fa000000000000000000000000"
> []
Result:
```console
[]
```
Nonzero characters long enough for an address, but rejected for spanning a 32 byte boundary
(read as `0x...000219ab540356cBB83` and `0x9Cbe05303d7705Fa000...`):
(read as `0x...000219ab540356cbb83` and `0x9cbe05303d7705fa000...`):
```command
"0x000000000000000000000000000000000000000000000000219ab540356cbb839cbe05303d7705fa000000000000000000000000000000000000000000000000"
```
"0x000000000000000000000000000000000000000000000000219ab540356cBB839Cbe05303d7705Fa000000000000000000000000000000000000000000000000"
> []
Result:
```console
[]
```
## Appearance definition

Expand Down
1 change: 1 addition & 0 deletions wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ randao
src
https
forkchoiceupdatedresponsev
retSize

0 comments on commit 2fa1f65

Please sign in to comment.