Skip to content

Add ERC: Custom Encoding Layout for ERC-7730 - #1925

Open
forshtat wants to merge 24 commits into
ethereum:masterfrom
forshtat:ideas-erc7730-non-abi-dispatch
Open

Add ERC: Custom Encoding Layout for ERC-7730#1925
forshtat wants to merge 24 commits into
ethereum:masterfrom
forshtat:ideas-erc7730-non-abi-dispatch

Conversation

@forshtat

@forshtat forshtat commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

forshtat and others added 16 commits July 26, 2026 20:02
Adds `layout` and `dispatch` keys so ERC-7730 descriptors can describe
fields whose bytes are not plain Solidity ABI - packed structs, repeated
records, and tag-selected payloads - as seen in Safe MultiSend, Uniswap's
Universal Router, ERC-7579 execute, Circle CCTP messages, EAS attestations,
and ERC-7683 orders. Includes a `call` construct for nested/wrapped
calldata (both byte-embedded and direct signature+positional-args forms)
and a top-level dispatch form for calls that only exist to be redirected.

Worked examples for all six real cases are full, standalone ERC-7730
descriptor files under assets/erc-non-abi-dispatch/, verified against
real mined transactions rather than inlined as snippets. A seventh,
made-up TieredExecutor example demonstrates the direct/positional call
form, explicitly flagged in Rationale as not grounded in an observed
live transaction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the deterministic-deployment-proxy worked example (initCode/$fallback,
verified EIP-1167 template plus a placeholder Permit2 template) and the
parked stateRef-dispatch feature note, both referenced by the previous
commit's spec text but left out of it.
…action)

Safe's execTransaction signatures field repurposes a fixed-record field
as a byte offset into a shared tail region for EIP-1271 contract
signatures - the one case in this ERC's survey needing genuine
pointer-style indirection within a custom-packed buffer, which object/
sequence/lengthFrom deliberately can't express. Adds the pointer layout
node (bytes width, required containerPath, destination), extends the
byte-width invariant and Security Considerations to cover it (including
the real recursion case: a Safe signing for another Safe), and adds a
worked example verified against a real nested-Safe transaction for the
EOA/APPROVED_HASH paths, with the CONTRACT_SIGNATURE/pointer branch
marked source-verified-only pending a live example.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…on schema

initCode, $fallback, and pointer are reverted: real, live code paths
are not the same as evidenced usage, and none of the three cleared
that bar despite genuine search effort (see prior discussion). Their
example files (deterministic-deployment-proxy, safe-exectransaction)
are removed, and the spec text, Rationale, Security Considerations,
and Test Cases are updated accordingly. Balancer's joinPool/exitPool
Test Case entry is added, since those files already existed but had
no prose write-up.

All example descriptors are migrated to the ERC's current vocabulary
(type/object/switch/expression/format:"calldata", $default inside
cases) and validate cleanly against a new, full companion JSON Schema
(erc7730-non-abi-dispatch.schema.json) built as a complete schema
rather than a thin extension - composing new properties onto schemas
closed with additionalProperties:false, or extending a schema reached
only via $ref, does not validate the way a thin allOf+$ref extension
would suggest (verified empirically against real tooling, not just by
reading the spec). Fixed several real bugs surfaced only by validating
against actual tooling: format:"array" was never a real ERC-7730
format (the Universal Router example now uses per-element switch via
$index correlation instead); uint/bitfield byte widths were wrongly
restricted to powers of two in the prose, contradicting the spec's own
bitfield example; the switch case-value "format" branch didn't allow
params. All $comment annotations are stripped from the example files.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@eip-review-bot

eip-review-bot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

File ERCS/erc-0000.md

Requires 1 more review from Editors: @g11tech, @jochem-brouwer, @samwilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title Add ERC: Companion for ERC-7730 defining non ABI based 'bytes' data dispatch Add ERC: Custom Encoding Layout for ERC-7730 Aug 3, 2026
@github-actions github-actions Bot added the w-ci label Aug 3, 2026
Comment thread ERCS/erc-0000.md
@@ -0,0 +1,436 @@
---
eip: 0000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eip: 0000
eip: 8362

Assigning next sequential EIP/ERC/RIP number.
Numbers are assigned by editors & associates.

Please also update the filename.

Comment thread ERCS/erc-0000.md
title: Custom Encoding Layout for ERC-7730
description: Format to describes any non-standard byte encodings for ERC-7730
author: Alex Forshtat (@forshtat)
discussions-to: https://github.com/ethereum/ERCs/pull/1925

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic on Eth Magicians.

forshtat and others added 3 commits August 4, 2026 13:07
Two mechanical changes, no semantic ones.

1. Rename the `layout` key to `customEncoding` everywhere it refers to the
   mechanism: the Specification heading and prose, all JSON examples in the
   ERC, the companion JSON Schema (including the `$layout` definition group
   and every `#/$layout/...` reference), and the example descriptors under
   assets/erc-0000/.

   Two occurrences are deliberately left alone: the `title:` frontmatter, and
   "an ABI-encoded `array` data layout" under `sequence`, which uses "layout"
   as an ordinary English word rather than as the key name.

2. Reformat every JSON block in the ERC, replacing the mix of single-line and
   multi-line styles with one consistent rule: any object or array that
   contains another object or array is expanded one level per line, while a
   flat one holding only scalars stays on a single line if it fits in 100
   columns. So nesting is always visible, but short leaf entries such as
   { "path": "to", "label": "To" } are not spread over four lines.

Verified: all 47 `$ref`s in the schema still resolve, all 12 example
descriptors validate against the renamed schema (the pre-rename `layout` key
is rejected by it, so the check is not vacuous), and every JSON block in the
ERC round-trips through a parser unchanged apart from whitespace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kuzdogan

kuzdogan commented Aug 4, 2026

Copy link
Copy Markdown
Member

Just opened a PR for this https://github.com/forshtat/ERCs/pull/4/changes

This, only about the naming of the "layout" field and spec styling.

Rename `layout` to `customEncoding`; indent JSON examples
@forshtat

forshtat commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@kuzdogan merged, thank you!
Also, I generated this draft PR to check viability of implementing this encoding in your library.
Please let me know what tools do you use to test features in ERC-7730, and I can finalize this PR over the coming days or weeks:
sourcifyeth/clear-signing#63

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

The commit e0a58f1 (as a parent of 4b555c2) contains errors.
Please inspect the Run Summary for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants