Expand description
Lighter L2 transaction signing.
Lighter signs transactions with Schnorr signatures over the ecgfp5 curve
(Pornin, 2022), defined over the quintic extension field of the Goldilocks
prime p = 2^64 - 2^32 + 1, with Poseidon2 as the binding hash.
This module is an original in-tree Rust implementation written from public
specifications and permissively licensed references. For the field and
curve, Thomas Pornin’s MIT-licensed Rust code at
pornin/ecgfp5 serves as a reading
reference alongside the curve’s design paper. For Poseidon2 and the Schnorr
binding Lighter applies, the Go library
elliottech/poseidon_crypto
is the behavioural reference: parameter sets (round constants, MDS matrices)
are pulled from there as facts, and test vectors derived from it are
reproduced as fixtures so equivalence with the upstream behaviour is
verifiable end-to-end.
Pornin’s reference stays in the publish=false fuzz crate so the crates.io
package graph does not depend on a git source. The fuzz_pornin_diff_*
targets assert public algebra operations (Fp5 add/sub/mul/neg/invert,
Scalar add/sub/mul/neg, Point decode/double/add, scalar mul on
arbitrary bases) byte-for-byte against the reference. The two
implementations share no code lineage:
Pornin’s accompanies the design paper (IACR ePrint 2022/274) and has
been public and reused by downstream zero-knowledge projects since
2022; ours is written from the paper using his code as a reading
reference. A bug that slips the differential gate would have to be
present in both implementations in the same way, which is concretely
unlikely rather than merely theoretically possible.
The official lighter-go and lighter-python SDKs wrap a closed-source
compiled signer; round-trip testing against testnet provides the final
correctness gate for what the Lighter sequencer accepts.
See crates/adapters/lighter/licenses/THIRD_PARTY_LICENSES.md for the
attribution covering reference parameters and test vectors.
Modules§
- auth_
token - Lighter REST/WebSocket auth-token builder.
- curve
- ECgFp5 elliptic curve and its scalar field, as used by the Lighter signer.
- field
- Field arithmetic underpinning Lighter’s L2 signing scheme.
- hash
- Poseidon2 hash over the Goldilocks field used by the Lighter signer.
- nonce
- Per-
(account_index, api_key_index)sequential nonce manager. - schnorr
- Schnorr signatures over the ECgFp5 curve, with Poseidon2 as the binding hash.
- tx
- Lighter L2 transaction encoding.