Skip to content

Conversation

@lnbc1QWFyb24
Copy link
Collaborator

  • src/types.rs:74 reshapes AgentPayload with a schema version, PriceUnit, canonical JSON digest helpers, and a signing round-trip test while dropping the old fee/unit enums and unused agent score structs.
  • src/agent.rs:100 publishes all estimates with schema version 1 and converts gwei floats into integer wei strings before signing.
  • src/chain/types.rs:47 parses the payload’s decimal wei string into U240 so oracle payloads carry the canonical value.
  • Cargo.toml:1 bumps the crate to 0.1.0, enables alloy’s serde feature, adds sha2, and refreshes Cargo.lock.
  • README.md:186 and EVALUATION.md:3 clean up markdown spacing, headings, and emphasis for consistency.

Changed the payload signing method from EIP712 typed data to canonical JSON with keccak256 hashing. This simplifies the signing process and removes the dependency on chain-specific domain separators.

Key changes:
- Replace U256 price field with string representation and add unit field for clarity
- Remove EIP712 domain separator and struct hash implementation
- Add canonical JSON serialization with lexicographically sorted keys
- Sign keccak256 hash of canonical JSON directly instead of EIP712 digest
- Update tests to validate canonical JSON signatures
- Add sha2 dependency for hashing operations
@lnbc1QWFyb24 lnbc1QWFyb24 merged commit 704c8f9 into main Oct 9, 2025
6 checks passed
@lnbc1QWFyb24 lnbc1QWFyb24 deleted the feat/eip712-payload-signing branch October 9, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants