Skip to content

feat: widen v2 schema fields to accept constants and map references#2503

Closed
lcastillo-ledger wants to merge 4 commits into
ethereum:masterfrom
lcastillo-ledger:feat/v2-schema-maps-and-constants
Closed

feat: widen v2 schema fields to accept constants and map references#2503
lcastillo-ledger wants to merge 4 commits into
ethereum:masterfrom
lcastillo-ledger:feat/v2-schema-maps-and-constants

Conversation

@lcastillo-ledger

@lcastillo-ledger lcastillo-ledger commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add reusable JSON schema definitions (stringValueOrMap, integerValueOrMap, stringOrArrayValueOrMap, scalarValueOrMap) to factor constant/map reference support
  • Widen parameter fields (token, callee, selector, amount, spender, chainId, collection, nativeCurrencyAddress, threshold, message, senderAddress) to accept map references
  • Widen metadata fields (owner, contractName) and context fields (domain.name, domain.version) to accept constant and map references
  • Widen display fields (label, value, interpolatedIntent, intent) to accept map references
  • Tighten mapReference definition: enforce required: ["map", "keyPath"] and additionalProperties: false
  • Allow optional $id on display reference entries (merged from fix: allow on display references #2506)
  • Update spec wording for eip712.domain, intent, label, value, and reference overrides to document the new reference forms

Companion linter PR: LedgerHQ/python-erc7730#291

Authors

Test plan

  • Schema validates existing registry descriptors (no breaking changes)
  • Linter updated and tested against canonical example-maps.json from ERC repo
  • Spec wording changes are minimal and backward-compatible
  • Validate a descriptor using a reference override with both $ref and $id

Made with Cursor

Update the ERC-7730 v2 JSON schema and spec to allow constant references
($.metadata.constants.*) and map references alongside literal values in many
fields.

Schema changes:
- Add reusable definitions: stringValueOrMap, integerValueOrMap,
  stringOrArrayValueOrMap, scalarValueOrMap
- Update parameter fields (token, callee, selector, amount, spender, chainId,
  collection, nativeCurrencyAddress, threshold, message, senderAddress) to use
  shared definitions
- Update metadata fields (owner, contractName) and context fields (domain.name,
  domain.version) to accept map references
- Update display fields (label, value, interpolatedIntent, intent) to accept
  map references
- Tighten mapReference definition: require map + keyPath, disallow additional
  properties

Spec changes:
- Update eip712.domain description to note constant/map reference support
- Update intent description to document three forms (string, object, map ref)
- Update field format specification for value and label to note they accept
  constant/map references

Made-with: Cursor
@github-actions github-actions Bot added the specifications Changes to ERC-7730 specifications label Mar 27, 2026
Reference display nodes can override shared definitions with path, params, visibility, and labels, but they currently reject optional $id metadata. Allow $id in the v2 schema and document it so referenced field overrides can be identified without failing validation.

Made-with: Cursor
@lcastillo-ledger
lcastillo-ledger marked this pull request as ready for review April 8, 2026 08:34
lcastillo-ledger added a commit to lcastillo-ledger/ERCs that referenced this pull request Apr 10, 2026
…rences

Add reusable JSON schema definitions (stringValueOrMap, integerValueOrMap,
stringOrArrayValueOrMap, scalarValueOrMap) and widen parameter fields, metadata
fields, context fields, and display fields to accept map references.

Schema changes:
- Add 4 reusable $definitions for value-or-map-reference types
- Widen ~20 fields across tokenAmount, calldata, nftName, addressName,
  interoperableAddressName params to use centralized $ref helpers
- Widen metadata.owner, metadata.contractName, eip712.domain.name,
  eip712.domain.version to accept constant/map references
- Widen display intent, interpolatedIntent, field label, field value
- Tighten mapReference: enforce required [map, keyPath] and no extra props
- Add optional $id on display reference entries

Spec changes:
- Document constant/map reference support for domain, intent, value, label
- Document optional $id on field reference overrides

Companion registry PR: ethereum/clear-signing-erc7730-registry#2503

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lcastillo-ledger

Copy link
Copy Markdown
Collaborator Author

Closing this PR — the same changes are being applied upstream in ethereum/ERCs#1663, which modifies the canonical spec and schema files directly.

Once that ERC PR is merged, the changes will be automatically synced to this repository's specs/ directory by the new sync-specs workflow introduced in #2522.

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

Labels

specifications Changes to ERC-7730 specifications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants