Skip to main content
This page is the SDK-native version of Your First Payment. Everything is expressed in terms of @ryvonetwork/sdk helpers. If you want the low-level protocol walkthrough, start there.
All examples target the live devnet deployment (program 3UyUFeNsUYPpM6hMRf7H8wg3MKEXQ82rqnsXhZrUwgSD, chain ID 1). Replace the programId and RYVO_CHAIN_IDS.* value for other environments.

Prerequisites

1. Register two participants

Register both sides of the payment relationship. Each owner pays a one-time registration fee defined in GlobalConfig.

2. Deposit into the vault

The payer moves tokens from their own SPL account into the protocol vault.

3. Open a channel

Channels are one-way and per-token. One channel per (payer, payee, token) tuple.
Optionally lock funds for the payee:

4. Direct settlement of one commitment

Alice signs a new cumulative total off-chain; Bob submits it.
Hold on to Alice’s signed message. Bob does not have to submit every one, he can keep stacking fresher messages and only submit the latest, since cumulative commitments supersede earlier ones.

5. Bundle settlement

Bob settles multiple commitments at once, typically many signed messages from Alice, or a mix of payers who have open channels with Bob.
The on-chain program walks each Ed25519 signature in order, finds the corresponding channel, and applies the new cumulative. The number passed as count must match the number of entries in the pre-instruction.

6. Clearing round (multi-party channel advancement)

Clearing rounds compress many channel settlements between N participants into a single transaction that every participant signs.
payeeRef is a 0-based index into the participant list in the order the round is signed. See Settlement → Clearing rounds for the full protocol behaviour.

7. Withdraw

Requests and executes the timelocked withdrawal flow. Fees are routed to feeRecipientTokenAccount.
To abort a pending request before the timelock fires:

8. Authorized signer delegation

If Alice wants a service key to sign commitments on her behalf (without giving it custody of funds), pass the delegate when creating the channel:
This delegation changes who signs commitments. It does not change custody or settlement guarantees.

9. Inbound channel policy

Payees can gate who is allowed to open channels to them:
Under ConsentRequired, createChannel now requires Bob’s signature as well.

Where to go next

Messages

Full details on the message layout and each Ed25519 helper.

Instructions reference

Every on-chain instruction, its accounts, and its semantics.

Settlement modes

When to pick direct, bundle, or clearing-round settlement.

Errors

The full protocol error code table.