LPsLux Proposals
Q-Chain
LP-4220

lp-4220-sr25519-schnorrkel-verification


lp: 4220 title: SR25519 Schnorrkel Verification description: EVM precompile verifying SR25519 (Schnorrkel over Ristretto255) signatures, the default signature scheme of Substrate-based chains author: Lux Core Team (@luxfi) discussions-to: https://github.com/luxfi/lps/discussions status: Final implementation-rust: none implementation-cpp: partial implementation-go: shipped type: Standards Track category: Core tags: [evm, precompile, sr25519, schnorrkel, ristretto255, classical-signature]

  • lp-4130
  • lp-9015

Abstract

This LP specifies SR25519 — Schnorrkel over Ristretto255 — signature verification as an EVM precompile. SR25519 is the default signature scheme for every Substrate-based chain, Polkadot and Kusama included, so this precompile is what lets a Lux contract check a signature produced by a Polkadot wallet. The two uses that matter are account migration (prove control of a Substrate address to claim on Lux) and cross-chain message verification.

Specification

Address

0x0A00000000000000000000000000000000000001 — Substrate Curves range.

Interface

Variable-length input, minimum 97 bytes.

Input (97+ bytes):
  bytes  0-31:  public key (32 bytes, Ristretto255 compressed)
  bytes 32-95:  signature (64 bytes, R || s Schnorrkel format)
  bytes 96+:    message (variable length, >= 1 byte)

Output:
  Valid:   32 bytes with value 1
  Invalid: 32 bytes with value 0

The signing context is fixed to "substrate" — the default used by all Substrate runtimes and by polkadot-js.

Gas Schedule

ComponentGas
Base9,000
Per message byte3

SR25519 costs roughly 3× Ed25519 (LP-4210). The difference is not the Schnorr equation, which is the same shape; it is Ristretto255 point decompression plus building a Merlin transcript for every verification.

Security Considerations

  1. SR25519 provides roughly 128-bit security. Ristretto255 is the reason to prefer it over a naive Curve25519 Schnorr: Ristretto quotients out the cofactor, so the group the protocol reasons about is genuinely prime-order and the whole class of cofactor/small-subgroup malleability bugs simply does not arise.
  2. Domain separation comes from the Merlin transcript framework, which prevents cross-protocol signature reuse.
  3. The C implementation (sr25519-donna) is used via CGO for performance; a pure Go fallback is available when CGO is disabled.
  4. Not post-quantum.
  5. The fixed "substrate" context is a real limit. This precompile cannot verify a signature made under a custom Schnorrkel context, and there is no way to supply one. If a chain you are bridging from uses a custom context, this precompile will reject every one of its signatures, correctly.

References

Copyright (C) 2024-2026, Lux Industries Inc. All rights reserved.

Licensed under the MIT License.