04The confidential Ledger
  1. 01Introduction
  2. 02System overview
  3. 03Cryptographic foundations
  4. 04The confidential Ledger
  5. 05Trusted execution and attestation
  6. 06Threshold keys and the Escape
  7. 07The Crossing engine
  8. 08Unlinkability
  9. 09Solana program engineering
  10. 10The Coprocessor and the off-chain stack
  11. 11Selective disclosure and Receipts
  12. 12Economics and $PRV

Chapter 4

The confidential Ledger

The Ledger is Privium’s book of accounts: one balance per trader per asset, held as ciphertext, committed on chain as a single Merkle root, and advanced once per Crossing by a Commit. This chapter defines its leaves, its state transition function and its Commit, and proves the property everything else depends on: at every committed root, for every asset, the balances in the Ledger add up exactly to what the Pool’s vaults hold for traders. The proof uses the Pedersen layer of each leaf and the integer bounds of Chapter 3, so conservation is checked on chain by the program, not taken on trust from the Coprocessor. The chapter closes with data availability, replay and nonce discipline, and the growth of the Ledger in bytes.

4.1 From ciphertext handles to a Ledger

Encifher introduced the model the Ledger follows [2]. On-chain programs hold only 128-bit ciphertext handles; ciphertexts live in a public data availability layer; an enclave fetches them, decrypts, computes on plaintext, re-encrypts and commits attested, Merkle-anchored results; and Solana’s declared read and write sets serve as the dependency graph, so confidential computation is ordered correctly without a scheduler of its own [2]. In the Encifher implementation each fresh encrypted value receives a 16-byte handle from a cryptographically secure generator, result handles are derived deterministically from the operation and its inputs, and each batch’s outputs are packaged into a Merkle tree whose root the enclave signs and submits on chain with a reference to the data availability layer [3].

Privium runs one program over one state shape, so it specializes the model rather than generalizing it.

Encifher, general coprocessor [2][3] Privium Ledger
Unit of state any encrypted value, named by a handle a balance leaf or a trader record at a fixed tree position
Handle 16 random bytes, or derived from an operation χι,v\chi_{\iota,v}: 128 bits derived from position ι\iota and version vv
On-chain state handles in each program’s accounts one root ρ(k)\rho^{(k)}, a Crossing index kk, per-asset accumulators
Ciphertext location external data availability layer Solana transactions, hash-chained by the program (Section 4.7)
What the program checks enclave signature over the batch root enclave signature, root chaining, data availability digest, asset conservation

The handle of the leaf at position ι\iota in version vv is

χι,v=H(privium/handle/v1 ∥ idprog ∥ ι ∥ v)[0..16],(4.1)\chi_{\iota,v} = \mathsf{H}\big(\texttt{privium/handle/v1} \,\|\, \mathsf{id}_{\mathrm{prog}} \,\|\, \iota \,\|\, v\big)\big[0..16\big], \tag{4.1}

which keeps Encifher’s 128-bit width and its deterministic derivation for results, and makes every handle unique across the Ledger’s history. Indexers and the Coprocessor’s ciphertext store key their records by χ\chi (Chapter 10).

4.2 Leaves

Each leaf is encrypted for three readers at once, each through the layer suited to it: the Coprocessor reads an AEAD ciphertext under the Ledger data key, the owner reads an AEAD ciphertext under a key only the owner and the enclave hold, and the Council decrypts through a twisted ElGamal handle under its joint key, which is the path the Escape takes (Chapter 6). A Pedersen commitment shared by all three is what the program and every watcher compute with.

The keys are: the Ledger data key kLk_L, the AES-256-GCM key that enclaves hold and that the Council releases to each admitted enclave (Chapter 5); the owner leaf key ku,a=F(vku,a,"balance")k_{u,a} = \mathsf{F}(vk_{u,a}, \texttt{"balance"}), derived from the trader’s asset key vku,avk_{u,a} in the Viewing key hierarchy of Chapter 11 (equation 11.2), so that the trader and anyone they hand vku,avk_{u,a} or vkuvk_u can read the leaf; and the Council’s joint twisted ElGamal key PC=s−1HP_{\mathcal{C}} = s^{-1} H, whose secret ss exists only as shares (Chapter 6). Each trader also holds an authority key AuA_u (Ed25519), which signs Intents, an escape key Yu=yuGY_u = y_u G, which claims an Escape payout, and a 32-byte salt ςu\varsigma_u; the SDK derives all of them from one wallet signature (Chapter 10).

Definition 4.1 (Trader record). The record of trader uu is the leaf

recu=(kind=1, v, AE.Enc(kL,nι,v,ωu ∥ Au ∥ Yu ∥ vku ∥ ςu,ad)),(4.2)\mathsf{rec}_u = \big(\texttt{kind}=1,\ v,\ \mathsf{AE.Enc}(k_L, n_{\iota,v}, \omega_u \,\|\, A_u \,\|\, Y_u \,\|\, vk_u \,\|\, \varsigma_u, ad)\big), \tag{4.2}

where vv is the leaf’s version, ωu\omega_u is the trader’s nonce watermark (Section 4.8), vkuvk_u is the trader’s viewing root (Chapter 11), nι,vn_{\iota,v} is the AEAD nonce of Section 4.8 and adad is the leaf’s public part together with idprog\mathsf{id}_{\mathrm{prog}} and ι\iota. Institutional accounts add a policy record of kind 3 in the same form, carrying the policy of Chapter 11.

Definition 4.2 (Ledger leaf). The balance of trader uu in asset aa is the leaf

Lu,a=(kind=2, α(a), v, ψu,a, C, D, ctL, ctu)(4.3)L_{u,a} = \big(\texttt{kind}=2,\ \alpha(a),\ v,\ \psi_{u,a},\ C,\ D,\ \mathsf{ct}_L,\ \mathsf{ct}_u\big) \tag{4.3}

with

ψu,a=H(privium/owner/v1 ∥ Yu ∥ ςu ∥ a ∥ v),C=bu,aG+rH,D=rPC,ctL=AE.Enc(kL,nι,v,ιu ∥ bu,a ∥ r,ad),ctu=AE.Enc(ku,a,nι,v,bu,a ∥ r,ad),\begin{aligned} \psi_{u,a} &= \mathsf{H}(\texttt{privium/owner/v1} \,\|\, Y_u \,\|\, \varsigma_u \,\|\, a \,\|\, v), \\ C &= b_{u,a} G + r H, \qquad D = r P_{\mathcal{C}}, \\ \mathsf{ct}_L &= \mathsf{AE.Enc}\big(k_L, n_{\iota,v}, \iota_u \,\|\, b_{u,a} \,\|\, r, ad\big), \\ \mathsf{ct}_u &= \mathsf{AE.Enc}\big(k_{u,a}, n_{\iota,v}, b_{u,a} \,\|\, r, ad\big), \end{aligned}

where α(a)\alpha(a) is the asset’s 4-byte index in the Registry, ιu\iota_u is the position of uu‘s record, r←RZℓr \xleftarrow{R} \mathbb{Z}_\ell is fresh at every write, and ad=(idprog,ι,kind,α(a),v,ψu,a,C,D)ad = (\mathsf{id}_{\mathrm{prog}}, \iota, \texttt{kind}, \alpha(a), v, \psi_{u,a}, C, D).

(C,D)(C, D) is a twisted ElGamal ciphertext of bu,ab_{u,a} under PCP_{\mathcal{C}} (Definition 3.8), and CC alone is a Pedersen commitment to it. The Council decrypts it with C−sD=bu,aGC - sD = b_{u,a} G, which is the Escape’s only use of the Council (Chapter 6); there is no separate escape ciphertext. Both AEAD layers carry the opening rr along with the balance, which gives the owner something the Token-2022 decryptable balance does not need to give: the owner can check C=bG+rHC = bG + rH locally and so verify that the public commitment matches the balance they read. The owner tag ψu,a\psi_{u,a} is a hiding commitment to the owner’s escape key; because it includes the version, it changes at every write, so two versions of one leaf, and the leaves of one trader in different assets, carry unrelated tags. It is opened only in an Escape request, where the claimant reveals (Yu,ςu)(Y_u, \varsigma_u) and later proves knowledge of yuy_u (Chapter 6). The asset index is public, since each asset’s leaves are summed against that asset’s vault; owner, amount and history are not. Chapter 8 measures what an observer learns from the remaining public fields.

pub const LEAF_LEN: usize = 225;
pub const RECORD_LEN: usize = 161;

#[repr(C)]
pub struct LedgerLeaf {
    pub kind: u8,              // 2
    pub asset: u32,            // Registry index alpha(a)
    pub version: u64,          // index k of the Crossing that wrote it
    pub owner_tag: [u8; 32],   // psi_{u,a}, fresh at every write
    pub commitment: [u8; 32],  // C = b G + r H   (ristretto255)
    pub council_handle: [u8; 32], // D = r P_C
    pub ct_ledger: [u8; 60],   // AES-256-GCM(k_L): record pos 4 | b 8 | r 32 | tag 16
    pub ct_owner: [u8; 56],    // AES-256-GCM(k_{u,a}): b 8 | r 32 | tag 16
}

impl LedgerLeaf {
    /// Public part bound into both AEAD ciphertexts as associated data.
    pub fn ad(&self, program: &Pubkey, index: u32) -> [u8; 145] {
        let mut ad = [0u8; 145];
        ad[0..32].copy_from_slice(program.as_ref());
        ad[32..36].copy_from_slice(&index.to_le_bytes());
        ad[36] = self.kind;
        ad[37..41].copy_from_slice(&self.asset.to_le_bytes());
        ad[41..49].copy_from_slice(&self.version.to_le_bytes());
        ad[49..81].copy_from_slice(&self.owner_tag);
        ad[81..113].copy_from_slice(&self.commitment);
        ad[113..145].copy_from_slice(&self.council_handle);
        ad
    }

    /// AEAD nonce: position and version, 96 bits, never repeated under one key.
    pub fn nonce(index: u32, version: u64) -> [u8; 12] {
        let mut n = [0u8; 12];
        n[0..4].copy_from_slice(&index.to_be_bytes());
        n[4..12].copy_from_slice(&version.to_be_bytes());
        n
    }
}

The listing is the leaf as the Coprocessor, the SDK and the indexer share it. Field widths add up to 225 bytes for a balance leaf; a trader record is 1 + 8 + 152 = 161 bytes (a 136-byte plaintext plus the GCM tag). Because CC and DD sit in the associated data, neither AEAD ciphertext can be moved to another leaf, another position, another version or another deployment without failing authentication.

4.3 The tree and its root

The Ledger is a sparse binary Merkle tree of depth dd in the form of Definition 3.10, with

d=32 (parameter),d = 32 \ \text{(parameter)},

because 232=4,294,967,2962^{32} = 4{,}294{,}967{,}296 positions hold every record and balance leaf the product can reach, and a 1,024-byte inclusion proof fits in one v1 Solana transaction, whose limit is 4,096 bytes [4], which is the size the Escape claim needs (Chapter 6). Every write places the leaf at a position drawn by the Coprocessor uniformly at random among free positions and empties the position it held before, so a position carries no information about arrival order or about the leaf’s earlier versions (Chapter 8 builds on this relocation). The Ledger state after Crossing kk is the map S(k):[0,2d)→{leaves}∪{ε}S^{(k)} : [0, 2^d) \to \{\text{leaves}\} \cup \{\varepsilon\}, and its root ρ(k)\rho^{(k)} is the tree hash of S(k)S^{(k)}. The plaintext view of S(k)S^{(k)} is the balance vector (bu,a(k))u∈U,a∈A\big(b^{(k)}_{u,a}\big)_{u \in \mathcal{U}, a \in \mathcal{A}}.

4.4 The state transition function

A Crossing consumes four kinds of input. Deposits are public Pool instructions that move tokens into a vault and append an entry to one of the asset’s deposit queue shards (Chapter 9), carrying a note sealed to the enclave’s HPKE key ekCek_C that names the trader’s record; the Commit states the vector σk\sigma_k of per-shard cuts it absorbs. Intents are HPKE ciphertexts (Section 3.7) collected by the Coprocessor. Exit requests are Intents of a dedicated kind that name an asset, an amount and a destination address. Route fills are the vault flows of the Crossing’s Residual swaps, which execute from the Pool in route_residual transactions after open_crossing and before the Commit, and which the program records in the Crossing’s state account (Chapters 7 and 9). Only one Crossing is open at a time, since open_crossing for kk requires the stored index k−1k-1, so every recorded fill belongs to the Crossing that the next Commit closes.

For asset aa and Crossing kk, let Da(k)D^{(k)}_a be the deposits absorbed (queue entries between the cuts σk−1\sigma_{k-1} and σk\sigma_k), Φa(k)\Phi^{(k)}_a the signed net flow of asset aa into the vaults from the Crossing’s recorded fills, Xa(k)X^{(k)}_a the total of the Exits the Commit lists, and Fa(k)F^{(k)}_a the protocol fees the Crossing charges in aa. All four are public on chain and recorded by the program.

Definition 4.3 (Ledger transition). Given S(k−1)S^{(k-1)} and the inputs of Crossing kk, the Coprocessor decrypts every Intent, runs the Crossing engine of Chapter 7 on the valid ones, and obtains a delta vector (Δu,a(k))\big(\Delta^{(k)}_{u,a}\big). The transition is valid when:

  • (V1) Authorization. Every negative delta of uu is covered by an Intent or exit request of uu that carries a valid AuA_u signature, an unexpired τ\tau and a fresh nonce ν>ωu\nu > \omega_u.
  • (V2) Solvency. bu,a(k)=bu,a(k−1)+Δu,a(k)∈[0,264)b^{(k)}_{u,a} = b^{(k-1)}_{u,a} + \Delta^{(k)}_{u,a} \in [0, 2^{64}) for every u,au, a.
  • (V3) Balance. For every asset aa,
∑u∈UΔu,a(k)=Da(k)+Φa(k)−Xa(k)−Fa(k).(4.4)\sum_{u \in \mathcal{U}} \Delta^{(k)}_{u,a} = D^{(k)}_a + \Phi^{(k)}_a - X^{(k)}_a - F^{(k)}_a . \tag{4.4}

Fees leave the Ledger and the Pool together: the Commit attests Fa(k)F^{(k)}_a and pays it in the same instruction from vault shard 0 to the fee recipient named in the Pool configuration, the token’s launch wallet (Chapters 9 and 12). Each trader’s fee is rounded down to whole base units and Fa(k)F^{(k)}_a is the exact sum of those fees, and every proportional split of the Crossing uses the largest-remainder rule, so (4.4) holds exactly in integers with no remainder left over. The new state S(k)S^{(k)} rewrites the leaf of every (u,a)(u,a) with a nonzero delta, the record of every trader whose watermark moved, and a decoy set of further leaves that are re-randomized without a value change; Chapter 8 sets the decoy count. Re-randomizing a leaf replaces (C,D)(C, D) by (C+ζH,D+ζPC)(C + \zeta H, D + \zeta P_{\mathcal{C}}) for fresh ζ\zeta, recomputes the owner tag for the new version, re-encrypts both AEAD layers, and moves the leaf to a fresh position (Section 4.3), so a rewritten leaf reveals nothing about whether its value changed (Theorem 4.3) or where it was before.

An Intent that fails any check is dropped inside the enclave; nothing about it reaches the chain.

4.5 The Commit

The Commit for Crossing kk carries the new root, the per-shard deposit cuts σk\sigma_k, the root E(k)E^{(k)} of the Exits it lists, the data availability digest δk\delta_k (Section 4.7), the hashes of the mids and fills recorded on chain for Crossing kk, and for each asset aa in the set JkJ_k of assets it carries, the attested total Ta(k)=∑ubu,a(k)T^{(k)}_a = \sum_u b^{(k)}_{u,a}, the Crossing’s Exits Xa(k)X^{(k)}_a and fees Fa(k)F^{(k)}_a, the commitment delta and the aggregate opening

ΔΓa(k)=∑ι∈rwk(a)(Cι(k)−Cι(k−1)),Ra(k)=∑ι : α(ι)=arι(k) mod ℓ,(4.5)\Delta\Gamma^{(k)}_a = \sum_{\iota \in \mathrm{rw}_k(a)} \big(C^{(k)}_\iota - C^{(k-1)}_\iota\big), \qquad R^{(k)}_a = \sum_{\iota \,:\, \alpha(\iota) = a} r^{(k)}_\iota \bmod \ell, \tag{4.5}

where rwk(a)\mathrm{rw}_k(a) is the set of asset-aa leaves rewritten in Crossing kk (a new leaf counts with Cι(k−1)=OC^{(k-1)}_\iota = O, a vacated position contributes −Cι(k−1)-C^{(k-1)}_\iota). The Coprocessor signs with skCsk_C the Commit message

Mk=privium/commit/v1 ∥ idprog ∥ e ∥ k ∥ ρ(k−1) ∥ ρ(k) ∥ bodyk,(4.6)M_k = \texttt{privium/commit/v1} \,\|\, \mathsf{id}_{\mathrm{prog}} \,\|\, e \,\|\, k \,\|\, \rho^{(k-1)} \,\|\, \rho^{(k)} \,\|\, \mathsf{body}_k , \tag{4.6}

where ee is the signing key’s epoch (Chapter 5) and bodyk\mathsf{body}_k holds every other field above, in the byte layout of Equation 9.1. The program accepts the Commit only if all of the following hold.

  • (C1) Order. No Escape is active, kk equals the stored index plus one, and ρ(k−1)\rho^{(k-1)} equals the stored root.
  • (C2) Authority. An Ed25519 signature on MkM_k is present in the transaction, under a pkCpk_C that the Registry admits for epoch ee with a validity interval containing the current slot, and that opened Crossing kk (Chapter 5 for the key, Chapter 9 for the precompile pattern).
  • (C3) Availability and binding. δk\delta_k equals the data availability accumulator in the Crossing’s state account, which is then sealed; the mids and fills hashes equal what open_crossing and route_residual recorded; and the deposit digest matches the queue entries at the cuts.
  • (C4) Conservation. For every a∈Jka \in J_k, the attested total satisfies the vault equation (9.2) of Chapter 9, which states that, once the Commit has paid Fa(k)F^{(k)}_a out, the vault holds exactly Ta(k)T^{(k)}_a, the committed Exits not yet released and the deposits not yet credited. With stored accumulators Γa(k−1)\Gamma^{(k-1)}_a, the weights za=H(privium/conserve/v1 ∥ H(Mk) ∥ α(a) ∥ Ta(k))z_a = \mathsf{H}(\texttt{privium/conserve/v1} \,\|\, \mathsf{H}(M_k) \,\|\, \alpha(a) \,\|\, T^{(k)}_a) satisfy
∑a∈Jkza(Γa(k−1)+ΔΓa(k))−(∑a∈JkzaTa(k))G−(∑a∈JkzaRa(k))H=O.(4.7)\sum_{a \in J_k} z_a \big(\Gamma^{(k-1)}_a + \Delta\Gamma^{(k)}_a\big) - \Big(\sum_{a \in J_k} z_a T^{(k)}_a\Big) G - \Big(\sum_{a \in J_k} z_a R^{(k)}_a\Big) H = O . \tag{4.7}
  • (C5) Exits. The program adds each Xa(k)X^{(k)}_a to the asset’s committed, unreleased Exits and stores E(k)E^{(k)}; each Exit is then paid by a permissionless release_exit that proves its inclusion under E(k)E^{(k)} (Chapter 9).

On success the program stores kk, ρ(k)\rho^{(k)}, Γa(k)=Γa(k−1)+ΔΓa(k)\Gamma^{(k)}_a = \Gamma^{(k-1)}_a + \Delta\Gamma^{(k)}_a, Ta(k)T^{(k)}_a and the slot of the Commit, from which the Escape measures the liveness window WW (Chapter 6). Check (4.7) is a single multiscalar multiplication of ∣Jk∣+2|J_k| + 2 ristretto255 points, which programs compute with Solana’s curve25519 syscalls [5]. The listing is the per-asset body of check (C4) that the Commit handler of Chapter 9 calls for each carried asset.

/// Check C4 for one asset: pay the fee, Equation 9.2 in base units, then the terms of (4.7).
pub fn conserve(
    a: &AssetEntry, group: &[AccountInfo], pool: &PoolConfig, authority: &AccountInfo,
    chain: &mut Vec<[u8; 32]>, acc: &mut ConserveAcc,
) -> Result<()> {
    let mut st = load_asset_state(&group[0], &a.mint)?;
    let (mint, vaults, queues) = (&group[1], &group[2..4], &group[4..6]);
    let (recipient, token_program) = (&group[6], &group[7]);
    require_keys_eq!(*recipient.key, fee_recipient_ata(pool, &st), PriviumError::Accounts);
    if a.fees > 0 {                                        // the Crossing's fees leave shard 0
        pay_from_vault(token_program, &vaults[0], mint, recipient, authority, a.fees, &st)?;
    }
    let (mut held, mut uncredited) = (0u128, 0u128);
    for j in 0..SHARDS {
        let v = vault_account(&vaults[j], &a.mint, &pool.authority)?;
        let q = queue_account(&queues[j], &a.mint, j)?;
        require!(a.cut[j] >= st.consumed[j] && a.cut[j] <= q.head, PriviumError::Cut);
        let last = q.entry(a.cut[j] - 1)?;                 // last credited entry
        chain.push(last.chain_hash);
        held += v.amount as u128;
        uncredited += (q.cum_amount - last.cum_amount) as u128;
        st.consumed[j] = a.cut[j];
    }
    st.pending_exits = st.pending_exits.checked_add(a.exits).ok_or(PriviumError::Math)?;
    let owed = a.total as u128 + st.pending_exits as u128;
    require!(owed + uncredited == held, PriviumError::Conservation); // Equation 9.2

    let gamma = st.gamma.add(&a.delta_gamma)?;             // canonical ristretto decode
    acc.push(&a.mint, a.total, &gamma, &a.r_agg);          // z_a and the terms of (4.7)
    st.ledger_total = a.total;
    st.gamma = gamma;
    Ok(())
}

ConserveAcc derives each weight zaz_a from H(Mk)\mathsf{H}(M_k) and evaluates (4.7) as one multiscalar multiplication after the last asset. The state writes take effect only if every check of the transaction passes, since any failure aborts it. Chapter 9 gives the account layouts, the deposit queue shards, the fill register in the Crossing’s state account and the compute budget.

4.6 Conservation

The program measures each vault Va(k)V^{(k)}_a by its own accounting: every token movement into or out of a vault passes through a Pool instruction that records it. The pending amount Πa(k)\Pi^{(k)}_a is the part of that balance the Ledger does not owe traders at Commit kk: committed Exits not yet released and deposits queued after the cuts σk\sigma_k. The Crossing’s fees are not part of it: the Commit pays them out of the vault before the check. No route flow is pending at a committed root, because routes run only for the open Crossing and its Commit absorbs every recorded fill. Check (C4) through Equation 9.2 gives Ta(k)=Va(k)−Πa(k)T^{(k)}_a = V^{(k)}_a - \Pi^{(k)}_a at every accepted Commit.

Theorem 4.1 (Conservation of the Ledger). If every transition is valid in the sense of Definition 4.3, then after every Commit kk and for every asset aa,

∑u∈Ubu,a(k)=Va(k)−Πa(k).(4.8)\sum_{u \in \mathcal{U}} b^{(k)}_{u,a} = V^{(k)}_a - \Pi^{(k)}_a . \tag{4.8}

Proof. By induction on kk. At genesis all balances, vaults and pending amounts are zero. Assume (4.8) for k−1k-1, so ∑ubu,a(k−1)=Ta(k−1)\sum_u b^{(k-1)}_{u,a} = T^{(k-1)}_a. By (V2) and (V3),

∑ubu,a(k)=∑ubu,a(k−1)+∑uΔu,a(k)=Ta(k−1)+Da(k)+Φa(k)−Xa(k)−Fa(k)=Ta(k),\sum_u b^{(k)}_{u,a} = \sum_u b^{(k-1)}_{u,a} + \sum_u \Delta^{(k)}_{u,a} = T^{(k-1)}_a + D^{(k)}_a + \Phi^{(k)}_a - X^{(k)}_a - F^{(k)}_a = T^{(k)}_a,

and Ta(k)=Va(k)−Πa(k)T^{(k)}_a = V^{(k)}_a - \Pi^{(k)}_a by check (C4) and Equation 9.2, since the vault gains Da(k)+Φa(k)D^{(k)}_a + \Phi^{(k)}_a and the pending amount gains Xa(k)+Fa(k)X^{(k)}_a + F^{(k)}_a at Commit kk. □\square

Theorem 4.1 is a statement about the plaintext balances and holds whenever the enclave computes the transition it is attested to compute. The stronger statement is that the program’s check (C4), together with data any watcher holds, enforces the same equality on the committed values, so that what an Escape can pay out is bounded by the vault whatever the plaintext layers say.

Lemma 4.1 (Batched check). Model H\mathsf{H} as a random oracle and let Ea=Γa(k−1)+ΔΓa(k)−Ta(k)G−Ra(k)HE_a = \Gamma^{(k-1)}_a + \Delta\Gamma^{(k)}_a - T^{(k)}_a G - R^{(k)}_a H. If Ea∗≠OE_{a^*} \neq O for some a∗∈Jka^* \in J_k, an adversary making qq oracle queries gets a Commit accepted with probability at most q/ℓq/\ell.

Proof. Every EaE_a is fixed by MkM_k and the program’s state before the weights are computed, and each zaz_a is an oracle output on an input containing H(Mk)\mathsf{H}(M_k), α(a)\alpha(a) and Ta(k)T^{(k)}_a. Fix any candidate MkM_k and the weights for a≠a∗a \neq a^*. Because G\mathbb{G} has prime order and Ea∗≠OE_{a^*} \neq O, the equation za∗Ea∗=−∑a≠a∗zaEaz_{a^*} E_{a^*} = -\sum_{a \neq a^*} z_a E_a has at most one solution za∗∈Zℓz_{a^*} \in \mathbb{Z}_\ell, which a fresh oracle output hits with probability 1/ℓ1/\ell. A union bound over the qq queries the adversary can try gives q/ℓq/\ell. □\square

With q≤280q \le 2^{80} and ℓ>2252\ell > 2^{252} the bound is below 2−1722^{-172}.

Theorem 4.2 (Committed conservation). Suppose (i) every rewritten leaf carries a valid range proof for [0,264)[0, 2^{64}) and a valid batched ciphertext validity proof in the diff of its Crossing (Section 4.7), and (ii) each published ΔΓa(k)\Delta\Gamma^{(k)}_a equals the sum (4.5) over the leaves in the diff, a check any watcher runs from data the program certified as published. Then, under the DL assumption in ristretto255 and the soundness of Bulletproofs, for every accepted Commit kk and asset aa, every opening (bι,rι)(b_\iota, r_\iota) of the asset-aa commitments in S(k)S^{(k)} with bι∈[0,264)b_\iota \in [0,2^{64}) satisfies

∑ι : α(ι)=abι=Ta(k),(4.9)\sum_{\iota \,:\, \alpha(\iota) = a} b_\iota = T^{(k)}_a, \tag{4.9}

except with negligible probability. Moreover, the Council decryption of every such leaf, the integer βι∈Zℓ\beta_\iota \in \mathbb{Z}_\ell with βιG=Cι−sDι\beta_\iota G = C_\iota - s D_\iota, equals bιb_\iota.

Proof. By (ii) and induction from Γa(0)=O\Gamma^{(0)}_a = O, the stored accumulator is the sum of the current commitments: Γa(k)=∑α(ι)=aCι(k)\Gamma^{(k)}_a = \sum_{\alpha(\iota) = a} C^{(k)}_\iota. By Lemma 4.1, acceptance implies Ea=OE_a = O, so Γa(k)=Ta(k)G+Ra(k)H\Gamma^{(k)}_a = T^{(k)}_a G + R^{(k)}_a H. By (i) and the knowledge soundness of Bulletproofs in the random oracle model [6], each CιC_\iota has an extractable opening (bι,rι)(b_\iota, r_\iota) with bι∈[0,264)b_\iota \in [0, 2^{64}). Then (∑bι)G+(∑rι)H=Ta(k)G+Ra(k)H\big(\sum b_\iota\big) G + \big(\sum r_\iota\big) H = T^{(k)}_a G + R^{(k)}_a H gives two openings of one point. By Theorem 3.1 they agree, so ∑bι≡Ta(k)(modℓ)\sum b_\iota \equiv T^{(k)}_a \pmod \ell, or else the adversary yields log⁡GH\log_G H. Both sides are non-negative integers below ℓ\ell: the left is a sum of at most 2322^{32} terms below 2642^{64}, hence below 2962^{96}, and Ta(k)<264T^{(k)}_a < 2^{64}. Congruence modulo ℓ>2252\ell > 2^{252} is therefore equality. Any other in-range opening of the same commitments that an Escape claimant presents equals the extracted one by binding, so (4.9) holds for every opening, not only the extracted one. For the decryptions, the validity proof of Definition 4.4 is a sigma proof of knowledge of (b∗,r∗)(b^*, r^*) with C∗=b∗G+r∗HC^* = b^* G + r^* H and D∗=r∗PCD^* = r^* P_{\mathcal{C}} for (C∗,D∗)=∑ιϱι(Cι,Dι)(C^*, D^*) = \sum_\iota \varrho^{\iota} (C_\iota, D_\iota), where ϱ\varrho is a random-oracle output on the whole diff. Binding gives b∗=∑ϱιbιb^* = \sum \varrho^\iota b_\iota and r∗=∑ϱιrιr^* = \sum \varrho^\iota r_\iota, so ∑ιϱι(βι−bι)G=C∗−sD∗−b∗G=O\sum_\iota \varrho^\iota (\beta_\iota - b_\iota) G = C^* - sD^* - b^* G = O. If some βι≠bι\beta_\iota \ne b_\iota, the polynomial ∑ι(βι−bι)zι\sum_\iota (\beta_\iota - b_\iota) z^\iota is nonzero of degree below 2322^{32} and vanishes at ϱ\varrho with probability at most 232/ℓ2^{32}/\ell per oracle query. □\square

Corollary 4.1 (Escape solvency). Under the hypotheses of Theorem 4.2, the Council decryptions of the asset-aa leaves under a committed root ρ(k)\rho^{(k)} sum to exactly Ta(k)=Va(k)−Πa(k)T^{(k)}_a = V^{(k)}_a - \Pi^{(k)}_a. An Escape pays each leaf its Council decryption (Chapter 6), so the claims it can establish against ρ(k)\rho^{(k)} total Ta(k)T^{(k)}_a and no more, whatever the AEAD layers say.

The on-chain check publishes Ra(k)R^{(k)}_a, the sum of all openings of an asset. That sum reveals the asset’s total, which the vault already shows, and nothing more.

Theorem 4.3 (Aggregate openings reveal only totals). Let A\mathcal{A} choose two balance vectors (b1,…,bN)(b_1, \dots, b_N) and (b1′,…,bN′)(b'_1, \dots, b'_N) for the leaves of one asset with ∑bi=∑bi′\sum b_i = \sum b'_i, and receive the public parts (Ci,Di)i≤N(C_i, D_i)_{i \le N} of the leaves for one of them, chosen at random, together with R=∑riR = \sum r_i. Then A\mathcal{A}‘s advantage in telling which vector was used is at most 2 AdvGddh(B)2\,\mathsf{Adv}^{\mathrm{ddh}}_{\mathbb{G}}(\mathcal{B}) for an adversary B\mathcal{B} of comparable running time.

Proof. The reduction samples r1,…,rN−1r_1, \dots, r_{N-1} uniformly and sets rN=R−∑i<Nrir_N = R - \sum_{i<N} r_i for a uniform RR; this is the honest joint distribution of (r1,…,rN,R)(r_1, \dots, r_N, R). From one DDH instance (H,X,Y,Z)(H, X, Y, Z), random self-reducibility gives N−1N-1 instances (H,X,Yi,Zi)(H, X, Y_i, Z_i) with independent YiY_i, all real or all random together. As in Theorem 3.2, set PC=XP_{\mathcal{C}} = X and, for i<Ni < N, Di=ZiD_i = Z_i and Ci=biG+YiC_i = b_i G + Y_i, which is the honest form with ri=log⁡HYir_i = \log_H Y_i when the instances are real. Set DN=R X−∑i<NDiD_N = R\,X - \sum_{i<N} D_i and CN=(∑jbj)G+RH−∑i<NCiC_N = \big(\sum_j b_j\big) G + R H - \sum_{i<N} C_i, which are the honest values of the last leaf in the real case, since then ∑i≤NCi=(∑bj)G+RH\sum_{i \le N} C_i = (\sum b_j)G + RH and ∑i≤NDi=RPC\sum_{i \le N} D_i = R P_{\mathcal{C}}. In the random case each CiC_i for i<Ni<N is uniform and independent of bib_i, and (CN,DN)(C_N, D_N) is a function of ∑jbj\sum_j b_j, RR and the first N−1N-1 leaves. The view then depends on the balances only through their sum, which is equal for both vectors. The real and random views differ by at most Advddh\mathsf{Adv}^{\mathrm{ddh}}, which with the factor of Definition 3.2 gives the bound. The AEAD layers are replaced by encryptions of zeros beforehand, at the cost of the IND-CPA advantage of AES-256-GCM under unique nonces. □\square

4.7 Data availability of ciphertexts

A root is useful only if the leaves under it can be retrieved: owners need their leaf to read their balance, watchers need every rewritten leaf to run check (ii), and an Escape needs the leaf and its inclusion proof. Encifher publishes each batch tree to an external data availability service and references the submission on chain [3]. Privium keeps the ciphertexts on Solana itself.

Definition 4.4 (Crossing diff). The diff Diffk\mathsf{Diff}_k is the byte string consisting of a header (k,ρ(k−1),ρ(k),σk)(k, \rho^{(k-1)}, \rho^{(k)}, \sigma_k); the list of rewritten positions with their new leaves, sorted by position; and for each a∈Jka \in J_k the tuple (α(a),ΔΓa(k),Ra(k),πaval,πa)\big(\alpha(a), \Delta\Gamma^{(k)}_a, R^{(k)}_a, \pi^{\mathrm{val}}_a, \pi_a\big), where πa\pi_a is one aggregated Bulletproof (Section 3.6) over the commitments of all asset-aa leaves rewritten in Crossing kk and πaval\pi^{\mathrm{val}}_a is a 128-byte sigma proof, in the template of Protocol 3.1, that the random combination ∑ιϱι(Cι,Dι)\sum_\iota \varrho^\iota (C_\iota, D_\iota) of those leaves is a well-formed twisted ElGamal ciphertext; and the owner and auditor entry records of the Crossing (Chapter 11).

Before signing the Commit, the Coprocessor splits Diffk\mathsf{Diff}_k into chunks and submits each as a log_diff(k, j, chunk) instruction. The program keeps the accumulator in the Crossing’s state account and updates it in chunk order,

δk,0=H(privium/da/v1 ∥ idprog ∥ k),δk,j+1=H(δk,j ∥ j ∥ chunkj),(4.10)\delta_{k,0} = \mathsf{H}(\texttt{privium/da/v1} \,\|\, \mathsf{id}_{\mathrm{prog}} \,\|\, k), \qquad \delta_{k,j+1} = \mathsf{H}(\delta_{k,j} \,\|\, j \,\|\, \mathsf{chunk}_j), \tag{4.10}

rejecting any chunk whose index is not the next one. Check (C3) compares the final value with the δk\delta_k inside the signed message and seals the accumulator.

Theorem 4.4 (Availability). If Commit kk is accepted, then except with probability negligible under the collision resistance of H\mathsf{H}, the diff the Coprocessor signed is the in-order concatenation of the instruction data of successful Solana transactions invoking log_diff for Crossing kk.

Proof. The accumulator changes only through log_diff, whose instruction data is recorded in the transaction that carried it, and the chunk index rule forces the order. If the signed δk\delta_k equals the accumulator but the signed diff differs from the logged chunks, walk the chain (4.10) back from the final value: the first index at which the inputs differ while the outputs agree is a collision of H\mathsf{H}, by the same argument as Theorem 3.4. □\square

Corollary 4.2 (Reconstruction). S(k)S^{(k)} is obtained from S(0)S^{(0)} by applying Diff1,…,Diffk\mathsf{Diff}_1, \dots, \mathsf{Diff}_k in order, so every committed Ledger state, every root and every inclusion proof can be recomputed by anyone from Solana’s transaction history, without the Coprocessor and without its ciphertext store.

Recomputing ρ(k)\rho^{(k)} from S(k−1)S^{(k-1)} and Diffk\mathsf{Diff}_k is how a watcher confirms root integrity, and summing commitment deltas from the same diff is check (ii) of Theorem 4.2. Root integrity thus holds under the integrity of the enclave and is auditable by anyone after every Commit. Chapter 10 describes the store that serves leaves and paths quickly; Corollary 4.2 is what makes that store a cache rather than a source of truth.

4.8 Replay, ordering and nonce discipline

Commits

Check (C1) makes the accepted Commits a single chain: each names its predecessor’s root and the next index, the program stores exactly one root at a time, and a transaction carrying an old MkM_k fails (C1) because the stored index has moved past kk. A second signature on the same MkM_k, which SUF-CMA forbids anyway, would also fail (C1). Every Commit writes the Ledger root account, so Sealevel’s write lock executes Commits one at a time, while deposits, which write the deposit queue and the vaults but not the root account, proceed in parallel with each other. This is the read and write set scheduling that Encifher identifies as Solana’s native dependency graph [2], and the Ledger needs nothing beyond it.

Deposits

Each deposit receives a sequence number in its queue shard from the program. A Commit absorbs exactly the entries of each shard between the stored cut and its new cut, conserve rejects a cut below the stored one, and (C1) orders the Commits, so every deposit is credited in exactly one Crossing.

Intents

Each trader’s record holds a watermark ωu\omega_u, the largest Intent nonce applied so far. The enclave processes a trader’s valid Intents in a Crossing in increasing order of ν\nu, applies an Intent only if ν>ωu\nu > \omega_u and the Crossing’s slot does not exceed τ\tau, and sets ωu←ν\omega_u \leftarrow \nu after each applied Intent. The SDK draws ν\nu from a per-trader counter, so concurrent orders from one trader simply carry consecutive nonces.

Lemma 4.2 (No replay). Under the integrity of the enclave and the SUF-CMA security of Ed25519, every Intent is applied at most once, and no Intent is applied that its trader did not sign.

Proof. Authenticity: an applied Intent carries a valid AuA_u signature over its fields, so an Intent the trader never signed is an Ed25519 forgery. Uniqueness: when an Intent with nonce ν\nu is applied, ωu\omega_u becomes at least ν\nu and never decreases, since the record is rewritten only by the enclave with the maximum. Any later presentation of the same Intent, in the same Crossing after sorting or in any later Crossing, has ν≤ωu\nu \le \omega_u and is rejected. An Intent sealed for an earlier key epoch fails to open under the current HPKE info (3.8), so epoch changes do not reopen old ciphertexts. □\square

AEAD nonces

Lemma 4.3 (Nonce uniqueness). No AES-256-GCM key in the Ledger is ever used twice with the same nonce.

Proof. Every leaf ciphertext at position ι\iota in version vv uses nι,v=ι ∥ vn_{\iota,v} = \iota \,\|\, v, a 96-bit string. The version of a leaf is the index kk of the Crossing that wrote it, public and part of the authenticated data; a Crossing writes each position at most once, and Crossing indices strictly increase, so no (position, version) pair recurs, even when a relocation empties a position and a later Crossing fills it again. Distinct pairs give distinct nonces. Within one leaf the two ciphertexts use the same nonce under two different keys, kLk_L and ku,ak_{u,a}, and no owner leaf key is shared between traders, between assets or with the Ledger data key. □\square

Deterministic nonces remove the birthday bound that random 96-bit GCM nonces carry, and make Lemma 4.3 a property of the data structure that any watcher can check from the diffs.

4.9 Ledger growth

Let NbN_b be the number of balance leaves and NrN_r the number of trader records. The Ledger’s on-chain footprint does not depend on either: it is the root account plus a fixed-size state per asset holding TaT_a and Γa\Gamma_a, and the state account of the open Crossing, which carries the data availability accumulator and is closed after its Commit (Chapter 9). Everything that grows lives in Solana’s transaction history and in caches built from it.

Full state. The leaves occupy 225Nb+161Nr225 N_b + 161 N_r bytes. A sparse tree with N=Nb+NrN = N_b + N_r randomly placed leaves in depth dd shares its top log⁡2N\log_2 N levels and has paths of about d−log⁡2Nd - \log_2 N unshared nodes per leaf below that, so its interior nodes take about 32N(d−log⁡2N+2)32 N (d - \log_2 N + 2) bytes.

Per Crossing. With mbm_b balance leaves and mrm_r records rewritten, decoys included, and mam_a of the balance leaves in asset aa, the diff has

∣Diffk∣=80+229 mb+165 mr+∑a∈Jk(196+32(2⌈log⁡2(64 ma)⌉+9)) bytes,(4.11)|\mathsf{Diff}_k| = 80 + 229\, m_b + 165\, m_r + \sum_{a \in J_k} \Big(196 + 32\big(2\lceil \log_2(64\, m_a) \rceil + 9\big)\Big) \text{ bytes}, \tag{4.11}

from an 80-byte header, a 4-byte position per leaf, 196 bytes per asset for (α(a),ΔΓa,Ra,πaval)(\alpha(a), \Delta\Gamma_a, R_a, \pi^{\mathrm{val}}_a) and the range proof size (3.7), with the entry records of Chapter 11 adding their own bytes. Each log_diff transaction carries about 3,800 bytes of chunk data (est.: the 4,096-byte v1 limit [4] less one signature, three account keys, the blockhash and the instruction header). The Ledger takes one diff per Crossing. A Crossing runs only when it settles something, at most once per batch interval Δ\Delta of Chapter 7, and an idle Ledger takes one heartbeat diff every 750 slots, with no asset (Chapter 10); its daily count lies between those two rates at the slot time Chapter 9 cites.

The table evaluates these formulas for an illustrative load; the counts are inputs to the formulas, not measurements.

Quantity Example input Result (est.)
Diff per Crossing mb=704m_b = 704 over 1111 assets of 6464 each, mr=256m_r = 256 217,308 bytes
log_diff transactions per Crossing same 58
Range proof per asset ma=64m_a = 64 1,056 bytes
Escape inclusion proof d=32d = 32 1,024 bytes
Leaves, full state Nr=106N_r = 10^6 traders, Nb=4×106N_b = 4 \times 10^6 1.06 GB
Interior nodes, full state N=5×106N = 5 \times 10^6, d=32d = 32 about 1.9 GB
Positions available d=32d = 32 4,294,967,296

The per-Crossing figure follows from (4.11): 80+229⋅704+165⋅256+11⋅(196+1,056)=217,30880 + 229 \cdot 704 + 165 \cdot 256 + 11 \cdot (196 + 1{,}056) = 217{,}308 bytes, and 217,308/3,800217{,}308 / 3{,}800 rounds up to 58 transactions. Eleven assets of 64 leaves each is the largest Commit of Chapter 9 at the decoy floor of Chapter 8. The range proof term grows with the logarithm of the number of rewritten leaves, so batching more traders into a Crossing lowers the proof bytes per leaf: one 64-bit proof costs 672 bytes on its own and 16.5 bytes per leaf inside a batch of 64. The state figures show the Ledger fitting in the memory of a single enclave host at a million traders, with Corollary 4.2 guaranteeing that any party can rebuild it from the chain.

References

  1. “Solana Privacy Rings”, Helius, 2026. https://www.helius.dev/blog/solana-privacy-rings
  2. N. Lokhande, R. Gupta, R. Chahar, A. Jangra, A. Prajapati, M. Kumari, “Encifher: A Trusted-Execution Coprocessor for Confidential Computation on Solana”, IACR ePrint 2026/1504, July 2026. https://eprint.iacr.org/2026/1504
  3. Encifher, “Encifher core documentation: crates and coprocessor components”, accessed 2026-11-16. https://encifher-core-docs.vercel.app/docs/crates
  4. Solana Foundation, “Larger Transaction Sizes” (SIMD-0296, v1 transactions of up to 4,096 bytes, live on mainnet from epoch 1035), 2026. https://solana.com/upgrades/larger-transaction-sizes
  5. Anza, solana-curve25519 crate documentation (syscall operations for curve25519 and ristretto255), accessed 2026-11-16. https://docs.rs/solana-curve25519
  6. B. Bünz, J. Bootle, D. Boneh, A. Poelstra, P. Wuille, G. Maxwell, “Bulletproofs: Short Proofs for Confidential Transactions and More”, IEEE S&P 2018. https://eprint.iacr.org/2017/1066