Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions EIPS/eip-7749.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@

This method adds a prefix to the message to prevent malicious dApps from signing arbitrary data (e.g., a transaction) and using the signature to impersonate the victim.

Implementations MUST follow these encoding rules when constructing the message to hash:

- `\x19\x00` are the single-byte values `0x19` and `0x00` (not ASCII), prefixed exactly in this order.
- `<intended validator address>` is the 20 raw bytes of the address. If provided as a hex string (e.g., `0x...`), strip the `0x` prefix and decode to bytes. Case of the hex characters is irrelevant; EIP-55 checksum is not applied to the bytes.

Check failure on line 48 in EIPS/eip-7749.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

references to proposals with a `category` of `ERC` must use a prefix of `ERC`

error[markdown-refs]: references to proposals with a `category` of `ERC` must use a prefix of `ERC` --> EIPS/eip-7749.md | 48 | - `<intended validator address>` is the 20 raw bytes of the address. If provided as a hex string (e.g., `0x...`), strip the `0x` pre... | = help: see https://ethereum.github.io/eipw/markdown-refs/
- `<data to sign>` MUST be a hex string with `0x` prefix representing arbitrary bytes. Strip `0x` and decode to bytes before concatenation. Odd-length hex strings are invalid.
- The preimage is the concatenation of: `0x19`, `0x00`, 20-byte validator address, then the raw bytes of `dataToSign`.
- Compute `keccak256` over the entire preimage as defined above, then sign the resulting digest with the private key of `signerAddress`.

#### Parameters

```js
Expand All @@ -59,7 +67,11 @@

#### Returns

`Signature` - The Ethereum Signature generated.
`Signature` - A hex-encoded 65-byte Ethereum signature (`0x`-prefixed) consisting of `r || s || v` in big-endian:

- `r`: bytes `0..31`
- `s`: bytes `32..63`
- `v`: byte `64`, MUST be either `27` or `28` (or, optionally, `0` or `1` where supported). The `v` value MUST NOT include an EIP-155 chain id for this off-chain message signing scheme.

## Rationale

Expand Down Expand Up @@ -104,7 +116,7 @@
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c"
"result": "0x<65-byte-signature-r|s|v>"
}
```

Expand Down
Loading