Skip to main content
Every account the Ryvo Protocol uses is a program-derived address (PDA). The SDK exports pure helpers for each of them, plus the seeds and program-wide constants they depend on. Nothing here hits an RPC; everything is local, deterministic, and cheap to call.

Constants

Program ID

Chain IDs

RYVO_CHAIN_IDS is a const map used everywhere a chainId is required, including deriveMessageDomain.

Seeds

All PDA helpers use these seeds internally. They are exported for advanced callers who want to derive addresses in a different language or verify an on-chain account against its expected derivation.

System program IDs

Inbound channel policy

Numeric enum mirroring the on-chain variant used by updateInboundChannelPolicy.

PDA helpers

All PDA helpers return a PublicKey and are available both as free functions and as methods on RyvoClient (which simply curries the programId).

findGlobalConfigPda(programId)

There is exactly one GlobalConfig per deployment.

findTokenRegistryPda(programId)

There is exactly one TokenRegistry per deployment.

findParticipantPda(programId, owner)

One ParticipantAccount per owner key.

findVaultTokenAccountPda(programId, tokenId)

One SPL token account PDA per registered tokenId. All deposits and withdrawals for that token flow through this vault.

findChannelPda(programId, payerId, payeeId, tokenId)

Channel IDs are derived from participant IDs, not wallet keys. Fetch a participant via RyvoClient.fetchParticipant or participantId() to obtain one.
Channels are directional. (payerId=1, payeeId=2) is not the same PDA as (payerId=2, payeeId=1). To support bidirectional traffic, open two channels.

findProgramDataPda(programId)

PDA on BPFLoaderUpgradeable that stores the program’s data account. Used by initializeProtocol.

deriveMessageDomain

The message domain is a 16-byte tag folded into every signed protocol message. It binds signatures to a specific (programId, chainId) pair, making cross-chain or cross-deployment replay impossible.
The derivation is:
This matches the domain the on-chain program recomputes when verifying Ed25519 signatures via the instructions sysvar.

Common chain IDs at a glance

See Reference → Messages for the on-chain spec.