Skip to main content

Module twisted_ed25519

Module twisted_ed25519 

Source
Available on crate feature twisted_ed25519 only.
Expand description

Twisted Ed25519 encryption keys (Ristretto255 scalar).

Used by Movement confidential assets and adjacent protocols. The private key is a Ristretto255 scalar s; the corresponding public (“encryption”) key is pk = s⁻¹·H where H is the domain-separated secondary generator H_RISTRETTO_COMPRESSED (= TS HASH_BASE_POINT, also the on-chain constant).

This is not an Ed25519 signing key. It produces no signatures; it’s a key for the Twisted ElGamal encryption scheme used by confidential-assets et al.

§Security

The private key zeroizes on drop (curve25519-dalek Scalar implements Zeroize) and has a redacted Debug impl so accidental logging never leaks key bytes.

Structs§

TwistedEd25519PrivateKey
A Twisted Ed25519 private key (Ristretto255 scalar).
TwistedEd25519PublicKey
A Twisted Ed25519 public (encryption) key — a Ristretto255 point.

Constants§

DECRYPTION_KEY_DERIVATION_MESSAGE
Domain string signed by an account’s Ed25519 key to derive a deterministic confidential decryption key.
H_RISTRETTO_COMPRESSED
Compressed encoding of the secondary generator H for Twisted ElGamal / Twisted Ed25519. Matches TS HASH_BASE_POINT and the on-chain constant.
TWISTED_ED25519_PRIVATE_KEY_LENGTH
Length, in bytes, of a Twisted Ed25519 private key (a Ristretto255 scalar).
TWISTED_ED25519_PUBLIC_KEY_LENGTH
Length, in bytes, of a Twisted Ed25519 public key (a compressed Ristretto255 point).

Functions§

h_ristretto
Decompressed form of H_RISTRETTO_COMPRESSED.