Skip to main content

Crate winterwallet_common

Crate winterwallet_common 

Source
Expand description

Shared constants, discriminators, domain tags, and account state layout for the WinterWallet program. Used by both the on-chain program and off-chain clients to eliminate constant drift.

Modules§

discriminator
Instruction discriminator bytes matching the on-chain match arms.

Constants§

ID
The const program ID.
MAX_CPI_INSTRUCTION_ACCOUNTS
Upper bound on account metas per inner CPI’d instruction inside Advance.
MAX_PASSTHROUGH_ACCOUNTS
Upper bound on trailing accounts an Advance instruction can commit to. Sizes the stack-allocated signature-preimage buffer used during recovery.
SIGNATURE_LEN
Signature byte length: (N + 2) * 32.
TOTAL_SCALARS
Total scalars including the two checksum scalars.
WALLET_ACCOUNT_LEN
On-chain WinterWallet account data length: id(32) + root(32) + bump(1).
WALLET_BUMP_OFFSET
Byte offset of the bump field in the WinterWallet account.
WALLET_ID_OFFSET
Byte offset of the id field in the WinterWallet account.
WALLET_ROOT_OFFSET
Byte offset of the root field in the WinterWallet account.
WINTERNITZ_SCALARS
Number of Winternitz message scalars (N). Total scalars = N + 2.
WINTERWALLET_ADVANCE
Domain tag for the Advance preimage.
WINTERWALLET_INITIALIZE
Domain tag for the Initialize preimage.
WINTERWALLET_SEED
PDA seed prefix.

Functions§

check_id
Returns true if given address is the ID.
id
Returns the ID.