FFORGE//RS
← Roadmap

blockchain / LEVEL 3

The signature valid on two chains

EST.45 MIN
01

THEORY / RETRIEVAL

What to restore

  • Separate protocol domains before hashing or signing
  • Frame variable-length fields without ambiguous concatenation
  • Bind signatures to chain id and nonce for replay protection

Signatures authenticate bytes, not intent

A verifier proves that a key signed one byte sequence. The application must make that sequence represent exactly one intent through canonical serialization, explicit versioning and length framing. Ambiguous concatenation can let different field tuples produce the same preimage.

Domain separation limits replay

A signing preimage should bind protocol, message type, chain or network, account nonce and payload. Domain separation does not replace nonce tracking, key custody or authorization checks; it prevents a valid signature from being silently reinterpreted in another context.

CHECKPOINT

Why should chain_id be inside the signed preimage rather than checked only by the submitting RPC endpoint?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / IMPLEMENTATION

Implement the contract

Encode the canonical signing preimage: ASCII `FORGE-SIGN-V1`, one-byte domain length, domain bytes, big-endian chain_id and nonce, four-byte big-endian payload length, then payload. Domain is 1..=32 lowercase ASCII/digit/dash; payload is at most 4096 bytes.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.