06Threshold keys and the Escape
  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 6

Threshold keys and the Escape

The Council is the second root of Privium’s trust and the only one custody rests on. It holds a single secret s∈Zℓ∗s \in \mathbb{Z}_\ell^{*}, split tt-of-nn among its members so that no coalition below the threshold learns anything about it. The Council has two duties. It releases the Ledger data key to enclaves the Registry has admitted (Chapter 5), and it runs the Escape: if no Commit lands within the liveness window WW, it re-encrypts each owner’s last committed balance to that owner alone, and the Pool program pays the owner out on a proof that never touches an enclave. This chapter builds the Council’s key from first principles: Shamir sharing, Feldman and Pedersen verifiable sharing, distributed key generation, threshold decryption with proofs of correct decryption, re-encryption to a verified key, and proactive resharing as membership changes. It then specifies the Escape step by step and proves its safety and liveness. Group and proof preliminaries are in Chapter 3; the Ledger leaf whose Council handle the Escape decrypts is in Chapter 4.

6.1 What the Council holds

Encifher places decryption keys with a threshold committee so that no single enclave holds a master key [11]; Privium’s Council is that committee with a second duty, the Escape. The Council’s public key is the twisted ElGamal key PC=s−1HP_{\mathcal{C}} = s^{-1} H of Definition 3.8, so that sPC=Hs P_{\mathcal{C}} = H. Member j∈{1,…,n}j \in \{1, \dots, n\} holds a share sjs_j and has a public verification key Sj=sjPCS_j = s_j P_{\mathcal{C}}; both PCP_{\mathcal{C}} and every SjS_j are stored in the Council account on chain. Two objects are encrypted under PCP_{\mathcal{C}}:

  • the wrapped Ledger data key wrap(kL)\mathsf{wrap}(k_L) (Chapter 5, equation 5.5);
  • the Council handle D=rPCD = rP_{\mathcal{C}} of every Ledger leaf (C,D)(C, D) (Definition 4.2), which decrypts as
C−sD=bu,a(k)G.(6.1)C - sD = b^{(k)}_{u,a} G . \tag{6.1}

The leaf’s owner tag commits to the owner’s escape key Yu=yuGY_u = y_u G (Chapter 4). The SDK derives yuy_u deterministically from the trader’s wallet (Chapter 10), so a trader who keeps their wallet keeps their escape key.

The Council never computes (6.1) in public. It only re-encrypts, either to an admitted enclave’s key YEY_E or to an owner’s key YuY_u. The guarantees are:

Property Rests on
No coalition of fewer than tt members learns ss, kLk_L or any balance perfect secrecy of Shamir sharing, hiding of Pedersen VSS, DDH in G\mathbb{G}
No Escape payout goes to anyone but the owner, or exceeds the committed balance Merkle binding, soundness of the share and claim proofs, Commit authenticity (Theorem 5.2), the proofs of Theorem 4.2; this holds against a fully corrupt Council
Every owner completes the Escape tt honest members live on chain

Parameters. n=9n = 9, t=5t = 5 (parameter): confidentiality tolerates four colluding members and the Escape completes with four offline; n=2t−1n = 2t - 1 is the honest-majority setting in which the key generation of Section 6.4 is proven secure [4], and 2t>n2t > n means any two quorums intersect.

6.2 Shamir sharing

To share x∈Zℓx \in \mathbb{Z}_\ell with threshold tt, the dealer samples a1,…,at−1←Zℓa_1, \dots, a_{t-1} \leftarrow \mathbb{Z}_\ell, sets f(z)=x+∑m=1t−1amzmf(z) = x + \sum_{m=1}^{t-1} a_m z^m, and gives member jj the share xj=f(j)x_j = f(j) [1]. For any set QQ of tt members, the Lagrange coefficients

γjQ=∏m∈Q, m≠jmm−j(modℓ)(6.2)\gamma^{Q}_j = \prod_{m \in Q,\, m \neq j} \frac{m}{m - j} \pmod{\ell} \tag{6.2}

satisfy x=f(0)=∑j∈QγjQxjx = f(0) = \sum_{j \in Q} \gamma^Q_j x_j, and because the map is linear the same coefficients work in the exponent of any base BB: xB=∑j∈QγjQ xjBxB = \sum_{j \in Q} \gamma^Q_j\, x_j B. The member indices are distinct and nonzero modulo the prime ℓ\ell, so every denominator is invertible.

Lemma 6.1 (Perfect secrecy). For any set SS of t−1t - 1 members and any two secrets x,x′x, x', the distributions of (xj)j∈S(x_j)_{j \in S} under xx and under x′x' are identical.

Proof. Fix the t−1t - 1 share values (vj)j∈S(v_j)_{j \in S}. Polynomial interpolation through the tt points {(0,x)}∪{(j,vj)}j∈S\{(0, x)\} \cup \{(j, v_j)\}_{j \in S} gives exactly one polynomial of degree at most t−1t - 1, hence exactly one coefficient vector (a1,…,at−1)(a_1, \dots, a_{t-1}). The map from coefficients to the shares in SS is therefore a bijection for each fixed secret, and with uniform coefficients the shares are uniform on Zℓt−1\mathbb{Z}_\ell^{t-1} whatever the secret. □\square

6.3 Verifiable secret sharing

Plain Shamir trusts the dealer. Members must be able to check their shares against public data, and in a distributed key generation every member is a dealer.

Feldman VSS

The dealer publishes Cm=amGC_m = a_m G for m=0,…,t−1m = 0, \dots, t - 1 with a0=xa_0 = x [2]. Member jj accepts xjx_j if and only if

xjG=∑m=0t−1jmCm.(6.3)x_j G = \sum_{m=0}^{t-1} j^m C_m. \tag{6.3}

Anyone can compute every verification key xjG=∑mjmCmx_j G = \sum_m j^m C_m from the commitments alone. The cost is that C0=xGC_0 = xG is public, which is exactly what a public key should be, but it also means the dealer’s commitments reveal amGa_m G for every coefficient.

Pedersen VSS

The dealer samples a second polynomial f′(z)=∑mam′zmf'(z) = \sum_m a'_m z^m, publishes Em=amG+am′HE_m = a_m G + a'_m H, and sends (xj,xj′)=(f(j),f′(j))(x_j, x'_j) = (f(j), f'(j)) [3]. Member jj accepts if and only if

xjG+xj′H=∑m=0t−1jmEm.(6.4)x_j G + x'_j H = \sum_{m=0}^{t-1} j^m E_m. \tag{6.4}

The generator HH is derived by hashing to ristretto255 [10], so nobody knows log⁡GH\log_G H.

Lemma 6.2. Pedersen VSS commitments are perfectly hiding: (Em)m(E_m)_m is independent of ff. Two different accepted share vectors for the same commitments, consistent with different secrets, yield log⁡GH\log_G H.

Proof. Each Em=amG+am′HE_m = a_m G + a'_m H with uniform am′a'_m is a uniform group element independent of ama_m. For binding, suppose two openings of (6.4) for the same (Em)(E_m) interpolate to different f(0)f(0); interpolating both openings at z=0z = 0 in the exponent gives f(0)G+f′(0)H=f^(0)G+f^′(0)Hf(0) G + f'(0) H = \hat f(0) G + \hat f'(0) H with f(0)≠f^(0)f(0) \neq \hat f(0), so log⁡GH=(f(0)−f^(0))/(f^′(0)−f′(0))\log_G H = (f(0) - \hat f(0)) / (\hat f'(0) - f'(0)). The denominator is nonzero because otherwise f(0)=f^(0)f(0) = \hat f(0). □\square

6.4 Distributed key generation

The Council’s key is generated without any party ever holding xx. Running nn parallel Feldman sharings and summing them (Joint-Feldman) is not enough: a rushing adversary who sees honest commitments before choosing its own can bias the resulting public key, which breaks the uniformity that security reductions for threshold ElGamal assume [4]. Privium uses the protocol of Gennaro, Jarecki, Krawczyk and Rabin, which first fixes the qualified set with hiding commitments and only then reveals the public key [4].

  1. Deal. Each member ii runs Pedersen VSS with a random secret ziz_i: it posts (Ei,m)m(E_{i,m})_m to the Council account and sends (fi(j),fi′(j))(f_i(j), f'_i(j)) to each member jj, encrypted with HPKE to jj‘s registered key (Chapter 3) and posted on chain so delivery is publicly verifiable.
  2. Complain. Member jj checks (6.4) for every dealer and posts a complaint against each failure. A dealer answers a complaint by revealing that share pair in the clear; anyone checks it against (6.4). Dealers with an unanswered or failed complaint are removed. The remaining dealers form QUAL\mathsf{QUAL}.
  3. Reveal. Each i∈QUALi \in \mathsf{QUAL} posts Feldman commitments Ci,m=ai,mGC_{i,m} = a_{i,m} G. Member jj checks fi(j)G=∑mjmCi,mf_i(j) G = \sum_m j^m C_{i,m}; on failure it posts the share pair it received, which is valid under (6.4) and so proves the dealer’s misbehavior, and the other members reconstruct ziz_i from their Pedersen shares to recompute Ci,0C_{i,0} in public.
  4. Output. s=∑i∈QUALzis = \sum_{i \in \mathsf{QUAL}} z_i, sj=∑i∈QUALfi(j)s_j = \sum_{i \in \mathsf{QUAL}} f_i(j), and the Feldman keys sG=∑i∈QUALCi,0sG = \sum_{i \in \mathsf{QUAL}} C_{i,0} and sjG=∑i∈QUAL∑mjmCi,ms_j G = \sum_{i \in \mathsf{QUAL}} \sum_m j^m C_{i,m}.
  5. Twist. The members run steps 1 to 4 again for a secret ϰ\varkappa with Feldman commitments on base HH, giving shares ϰj\varkappa_j and ϰjH\varkappa_j H, and once more for a sharing o(z)o(z) of zero of degree 2t−22t - 2 with commitments ojHo_j H. Each member posts wj=sjϰj+ojw_j = s_j \varkappa_j + o_j with a Chaum-Pedersen proof that log⁡G(sjG)=log⁡ϰjH(wjH−ojH)\log_G (s_j G) = \log_{\varkappa_j H} (w_j H - o_j H). The wjw_j lie on a polynomial of degree 2t−2≤n−12t - 2 \le n - 1, so the nn posted values interpolate to u=sϰu = s\varkappa, and the program sets PC=u−1(ϰH)=s−1HP_{\mathcal{C}} = u^{-1} (\varkappa H) = s^{-1} H. Each member then posts Sj=sjPCS_j = s_j P_{\mathcal{C}} with a proof that log⁡G(sjG)=log⁡PCSj\log_G(s_j G) = \log_{P_{\mathcal{C}}} S_j.

Theorem 6.1 (Secure DKG [4]). If at most t−1t - 1 members are corrupt and n≥2t−1n \geq 2t - 1, steps 1 to 4 output shares of a secret ss such that every honest member’s share satisfies the Feldman relation for sGsG, ss can be reconstructed from any tt shares, sGsG is uniformly distributed in G\mathbb{G}, and the adversary learns nothing about ss beyond sGsG.

The twist adds only uniform values to that view. The masked product polynomial s(z)ϰ(z)+o(z)s(z)\varkappa(z) + o(z) is uniform among polynomials of degree 2t−22t - 2 with constant term uu, and u=sϰu = s\varkappa is uniform and independent of ss because ϰ\varkappa is; so the transcript is simulatable from sGsG and PCP_{\mathcal{C}}, and PC=s−1HP_{\mathcal{C}} = s^{-1}H is uniform in G\mathbb{G}. The twist runs once, at genesis, with all nn members posting; every later change of membership preserves ss and therefore PCP_{\mathcal{C}} (Section 6.6).

The Council account acts as the broadcast channel: every commitment, encrypted share and complaint is a Solana transaction, so the transcript is public and ordered, and step boundaries are slot deadlines rather than synchronized clocks.

6.5 Threshold decryption with proofs

Chaum-Pedersen proofs

The basic tool is a proof that two group elements share a discrete logarithm. For bases (P1,P2)(P_1, P_2) and targets (T1,T2)(T_1, T_2), the relation is {w:T1=wP1∧T2=wP2}\{w : T_1 = wP_1 \wedge T_2 = wP_2\}. The prover samples ω←Zℓ\omega \leftarrow \mathbb{Z}_\ell, sends (R1,R2)=(ωP1,ωP2)(R_1, R_2) = (\omega P_1, \omega P_2), receives ε\varepsilon and answers z=ω+εwz = \omega + \varepsilon w; the verifier checks zPi=Ri+εTizP_i = R_i + \varepsilon T_i for i=1,2i = 1, 2 [6]. The protocol is complete, special-sound (two accepting answers z,z′z, z' for one commitment and distinct challenges give w=(z−z′)/(ε−ε′)w = (z - z')/(\varepsilon - \varepsilon')), and honest-verifier zero-knowledge. Privium makes it non-interactive with Fiat-Shamir [7], hashing the whole statement into the challenge,

ε=H(tag ∥ P1 ∥ P2 ∥ T1 ∥ T2 ∥ R1 ∥ R2 ∥ ctx),(6.5)\varepsilon = \mathsf{H}\big(\mathsf{tag} \,\|\, P_1 \,\|\, P_2 \,\|\, T_1 \,\|\, T_2 \,\|\, R_1 \,\|\, R_2 \,\|\, \mathsf{ctx}\big), \tag{6.5}

where tag\mathsf{tag} separates proof types and ctx\mathsf{ctx} binds the proof to its use (program ID, Council epoch, request). Omitting statement elements from the hash lets an adversary choose them after the challenge and forge proofs; the strong form in (6.5) is the one that yields a sound non-interactive proof in the random-oracle model [8].

Threshold decryption. A member’s decryption share for a handle DD is sjDs_j D with a Chaum-Pedersen proof on bases (PC,D)(P_{\mathcal{C}}, D) and targets (Sj,sjD)(S_j, s_j D). Any tt valid shares combine to sD=∑j∈QγjQ sjDs D = \sum_{j \in Q} \gamma^Q_j\, s_j D and the plaintext point is C−sDC - sD, as in (6.1). This is the scheme analysed by Shoup and Gennaro, whose proofs of correct decryption are what make the combination robust: an invalid share is rejected individually, so tt honest members always suffice regardless of what corrupt members post [9].

Re-encryption to a verified key

Privium never needs the plaintext point in public. It needs the handle DD moved from PCP_{\mathcal{C}} to a recipient key YY (an enclave’s YEY_E or an owner’s YuY_u). Member jj samples κj←Zℓ\kappa_j \leftarrow \mathbb{Z}_\ell and posts

Aj=κjG,Bj=sjD+κjY,(6.6)A_j = \kappa_j G, \qquad B_j = s_j D + \kappa_j Y, \tag{6.6}

with a proof Πj\Pi_j of knowledge of (sj,κj)(s_j, \kappa_j) such that Sj=sjPCS_j = s_j P_{\mathcal{C}}, Aj=κjGA_j = \kappa_j G and Bj=sjD+κjYB_j = s_j D + \kappa_j Y. Πj\Pi_j is the two-witness sigma protocol with commitments (R1,R2,R3)=(ω1PC,ω2G,ω1D+ω2Y)(R_1, R_2, R_3) = (\omega_1 P_{\mathcal{C}}, \omega_2 G, \omega_1 D + \omega_2 Y), responses z1=ω1+εsjz_1 = \omega_1 + \varepsilon s_j, z2=ω2+εκjz_2 = \omega_2 + \varepsilon \kappa_j, challenge as in (6.5) over the full statement (PC,G,D,Y,Sj,Aj,Bj,R1,R2,R3,ctx)(P_{\mathcal{C}}, G, D, Y, S_j, A_j, B_j, R_1, R_2, R_3, \mathsf{ctx}), and checks

z1PC=R1+εSj,z2G=R2+εAj,z1D+z2Y=R3+εBj.(6.7)z_1 P_{\mathcal{C}} = R_1 + \varepsilon S_j, \qquad z_2 G = R_2 + \varepsilon A_j, \qquad z_1 D + z_2 Y = R_3 + \varepsilon B_j. \tag{6.7}

Combining any tt valid shares,

A=∑j∈QγjQAj=κG,B=∑j∈QγjQBj=sD+κY,κ=∑j∈QγjQκj.(6.8)A = \sum_{j \in Q} \gamma^Q_j A_j = \kappa G, \qquad B = \sum_{j \in Q} \gamma^Q_j B_j = s D + \kappa Y, \qquad \kappa = \sum_{j \in Q} \gamma^Q_j \kappa_j. \tag{6.8}

Lemma 6.3 (Re-encryption correctness). For a leaf (C,D)=(bG+rH, rPC)(C, D) = (bG + rH,\ rP_{\mathcal{C}}) and Y=yGY = yG, the pair (A,C−B)(A, C - B) is an ElGamal ciphertext of bGbG under YY: (C−B)+yA=bG(C - B) + yA = bG.

Proof. C−B=bG+rH−srPC−κY=bG+rH−rH−κyG=bG−κyGC - B = bG + rH - s r P_{\mathcal{C}} - \kappa Y = bG + rH - rH - \kappa y G = bG - \kappa y G, and yA=yκGyA = y\kappa G. □\square

Lemma 6.4 (Share soundness). If (6.7) holds for two challenges ε≠ε′\varepsilon \neq \varepsilon' on the same commitments, then sj=(z1−z1′)/(ε−ε′)s_j = (z_1 - z'_1)/(\varepsilon - \varepsilon') satisfies Sj=sjPCS_j = s_j P_{\mathcal{C}} and κj=(z2−z2′)/(ε−ε′)\kappa_j = (z_2 - z'_2)/(\varepsilon - \varepsilon') satisfies Aj=κjGA_j = \kappa_j G and Bj=sjD+κjYB_j = s_j D + \kappa_j Y. Hence, in the random-oracle model, a member who posts an accepted BjB_j different from sjD+κjYs_j D + \kappa_j Y for its registered SjS_j succeeds with negligible probability.

Proof. Subtracting the two instances of each equation in (6.7) gives (z1−z1′)PC=(ε−ε′)Sj(z_1 - z'_1) P_{\mathcal{C}} = (\varepsilon - \varepsilon') S_j, (z2−z2′)G=(ε−ε′)Aj(z_2 - z'_2) G = (\varepsilon - \varepsilon') A_j and (z1−z1′)D+(z2−z2′)Y=(ε−ε′)Bj(z_1 - z'_1) D + (z_2 - z'_2) Y = (\varepsilon - \varepsilon') B_j. Divide by ε−ε′\varepsilon - \varepsilon'. The forking lemma turns a prover that convinces with non-negligible probability into one that produces such a pair. □\square

Lemma 6.5 (Re-encryption privacy). Under DDH in G\mathbb{G}, the shares (Aj,Bj)j(A_j, B_j)_{j} of any set of members, together with any t−1t - 1 secret shares, reveal nothing about bGbG to a party that does not know yy.

Proof sketch. Each Bj−sjD=κjYB_j - s_j D = \kappa_j Y with Aj=κjGA_j = \kappa_j G; the pair (Aj,κjY)(A_j, \kappa_j Y) is a Diffie-Hellman tuple over (G,Y)(G, Y), indistinguishable from (Aj,Uj)(A_j, U_j) with UjU_j uniform. Replacing every mask by an independent uniform element (one hybrid per share) makes each BjB_j uniform and independent of sjDs_j D. What remains is (C,D)(C, D) and t−1t - 1 shares of ss, which by Lemma 6.1 and Theorem 3.2 reveal nothing about bGbG. □\square

The listing below is the check that the Pool program and every recipient run on each share, followed by the combination (6.8).

use curve25519_dalek::{constants::RISTRETTO_BASEPOINT_POINT as G, ristretto::RistrettoPoint as P, Scalar};

pub struct ReEncShare { pub member: u8, pub a: P, pub b: P, pub r: [P; 3], pub z1: Scalar, pub z2: Scalar }

/// Checks (6.7) for one share: `pc` is P_C, `sj` the member's S_j, `d` the handle, `y` the recipient key.
pub fn verify_share(s: &ReEncShare, pc: &P, sj: &P, d: &P, y: &P, ctx: &[u8]) -> bool {
    let eps = challenge(b"privium/reenc/v1", &[pc, &G, d, y, sj, &s.a, &s.b, &s.r[0], &s.r[1], &s.r[2]], ctx);
    s.z1 * pc == s.r[0] + eps * sj
        && s.z2 * G == s.r[1] + eps * s.a
        && s.z1 * d + s.z2 * y == s.r[2] + eps * s.b
}

/// Lagrange coefficient (6.2) of `j` in the quorum `q`.
fn gamma(j: u8, q: &[u8]) -> Scalar {
    let (mut num, mut den) = (Scalar::ONE, Scalar::ONE);
    for &m in q.iter().filter(|&&m| m != j) {
        num *= Scalar::from(m as u64);
        den *= Scalar::from(m as u64) - Scalar::from(j as u64);
    }
    num * den.invert()
}

/// Combines t verified shares into (A, B) as in (6.8).
pub fn combine(shares: &[ReEncShare]) -> (P, P) {
    let q: Vec<u8> = shares.iter().map(|s| s.member).collect();
    shares.iter().fold((P::identity(), P::identity()), |(a, b), s| {
        let g = gamma(s.member, &q);
        (a + g * s.a, b + g * s.b)
    })
}

On chain the same equations run through Solana’s curve25519 syscalls for ristretto255 group operations and multiscalar multiplication [12]; each share verification is a fixed number of group operations, and Chapter 9 accounts for its compute budget.

6.6 Council membership and proactive resharing

Members change, and shares held for long periods accumulate exposure. Privium reshares the same secret ss to a new committee (n′,t′)(n', t') at every membership change and at least once every ECE_C slots, recommended EC=10 EkeyE_C = 10\,E_{\mathrm{key}} (parameter): an adversary who corrupts members over time must collect tt shares within one period, because shares from different periods do not combine [5].

Protocol. Let QQ be a set of tt current members. Each i∈Qi \in Q acts as a Feldman dealer of its own share on base PCP_{\mathcal{C}}: it samples gi(z)=si+∑m=1t′−1ai,mzmg_i(z) = s_i + \sum_{m=1}^{t'-1} a_{i,m} z^m, posts Ci,m=ai,mPCC_{i,m} = a_{i,m} P_{\mathcal{C}} with Ci,0=siPCC_{i,0} = s_i P_{\mathcal{C}}, and sends gi(j)g_i(j) to each new member jj, encrypted as in Section 6.4. The program and every new member check Ci,0=SiC_{i,0} = S_i, the dealer’s registered verification key, which forces each dealer to reshare its real share. New member jj verifies its sub-shares by (6.3) with PCP_{\mathcal{C}} in place of GG and sets

sj′=∑i∈QγiQ gi(j),Sj′=∑i∈QγiQ∑m=0t′−1jmCi,m.(6.9)s'_j = \sum_{i \in Q} \gamma^Q_i\, g_i(j), \qquad S'_j = \sum_{i \in Q} \gamma^Q_i \sum_{m=0}^{t'-1} j^m C_{i,m}. \tag{6.9}

Old members erase their shares once the new committee’s verification keys are recorded.

Lemma 6.6 (Resharing preserves the key). The new shares are a t′t'-of-n′n' Shamir sharing of the same ss, so PCP_{\mathcal{C}} is unchanged and the new verification keys interpolate to sPC=Hs P_{\mathcal{C}} = H.

Proof. Let g(z)=∑i∈QγiQgi(z)g(z) = \sum_{i \in Q} \gamma^Q_i g_i(z). It has degree at most t′−1t' - 1, sj′=g(j)s'_j = g(j), and g(0)=∑i∈QγiQsi=sg(0) = \sum_{i \in Q} \gamma^Q_i s_i = s by (6.2). In the exponent, ∑i∈QγiQCi,0=∑i∈QγiQSi=sPC=H\sum_{i \in Q} \gamma^Q_i C_{i,0} = \sum_{i \in Q} \gamma^Q_i S_i = s P_{\mathcal{C}} = H. □\square

Because PCP_{\mathcal{C}} is unchanged, nothing encrypted under it needs to be touched: every leaf’s Council handle and wrap(kL)\mathsf{wrap}(k_L) remain valid across any number of membership changes. A dealer whose sub-shares fail (6.3) is excluded and the protocol reruns with a different QQ; since tt honest old members exist, a valid QQ always exists. The resharing transcript lives in the Council account, and the program switches to the new verification keys only after t′t' new members have posted acknowledgements of valid sub-shares.

6.7 The Escape

The Escape is the path by which every owner leaves with their last committed balance when the Coprocessor stops committing, using only the chain, the Council and the owner’s own key.

State at trigger

Let slasts_{\mathrm{last}} be the slot of the last accepted Commit, with root ρ(k⋆)\rho^{(k^\star)}. The Coprocessor commits each Crossing that settles something and, with nothing to settle, sends a heartbeat Commit 750 slots after the last (Chapter 10), so a live enclave keeps the gap to 750 slots plus the heartbeat’s own landing, and the gap measures enclave liveness rather than trading activity. The Pool holds two public queues: deposits received but not yet credited by a Commit, and Exits listed in a committed exits root but not yet released. It may also hold the recorded fills of the open Crossing k⋆+1k^\star + 1: Residual legs execute in their own transactions before the Commit that absorbs them (Chapter 9), each leg ℓ\ell with input asset in(ℓ)\mathrm{in}(\ell), output asset out(ℓ)\mathrm{out}(\ell) and measured amounts (spentℓ,gotℓ)(\mathrm{spent}_\ell, \mathrm{got}_\ell), and the program caps the legs of one Crossing so that Sa=∑ℓ:in(ℓ)=aspentℓ≤TaS_a = \sum_{\ell : \mathrm{in}(\ell) = a} \mathrm{spent}_\ell \le T_a, the committed total of the input asset.

The Escape settles those legs over the committed holders of each input asset, in proportion to committed balance. With TaT_a the frozen total of asset aa, a claim of bb units of aa pays

⌊b Ta−SaTa⌋ units of a,⌊b gotℓTa⌋ units of out(ℓ)  for each leg ℓ with in(ℓ)=a.(6.10)\Big\lfloor b\,\frac{T_a - S_a}{T_a} \Big\rfloor \text{ units of } a, \qquad \Big\lfloor b\,\frac{\mathrm{got}_\ell}{T_a} \Big\rfloor \text{ units of } \mathrm{out}(\ell) \ \text{ for each leg } \ell \text{ with } \mathrm{in}(\ell) = a . \tag{6.10}

When no Crossing is open, or none of its legs spent aa, (6.10) pays bb units of aa. Each leg’s rate gotℓ/spentℓ\mathrm{got}_\ell / \mathrm{spent}_\ell is its executed price, which the enclave’s signed bound keeps within βπ(k)\beta^{(k)}_\pi of the oracle mid (Chapter 7), so every claimant receives their committed balance in value at that price.

Parameter. W=9,000W = 9{,}000 slots (parameter): it spans twelve heartbeat intervals and exceeds by a wide margin the few transactions a Coprocessor failover needs (attestation in Section 5.5, key release in Section 6.5, first Commit) and the lease of Chapter 10, so neither an idle Pool nor a routine failover triggers it, while still bounding how long a halted Ledger holds funds. Chapter 9 gives the slot time that converts it to minutes.

Steps

  1. Trigger. When the current slot exceeds slast+Ws_{\mathrm{last}} + W, any account may call trigger_escape. The program sets the Pool to Escape mode, freezes ρ(k⋆)\rho^{(k^\star)} and the totals TaT_a, copies the open Crossing’s recorded fills into EscapeState, and rejects every later Commit, open, route and deposit. Intents not yet in a committed root carry no tokens and simply lapse.
  2. Queues. Anyone may crank the queues: each pending deposit is refunded to the source token account its queue entry records, and each pending Exit is paid to its recorded destination.
  3. Request. Owner uu posts, for asset aa, the leaf index, the leaf’s pair (C,D)(C, D), the opening (Yu,ςu)(Y_u, \varsigma_u) of its owner tag ψu,a\psi_{u,a} (Definition 4.2) and a Merkle path to ρ(k⋆)\rho^{(k^\star)}; the AEAD layers are passed as their hash, so the request reveals nothing beyond what is already public except the escape key. The program recomputes ψu,a\psi_{u,a} from the opening, the leaf’s asset and its version, verifies the path, and opens an EscapeRequest account.
  4. Respond. Council members post shares (6.6) toward YuY_u for the handle DD, with proofs Πj\Pi_j and ctx=(idprog,request address)\mathsf{ctx} = (\mathsf{id}_{\mathrm{prog}}, \text{request address}). The program verifies each with (6.7) against the registered SjS_j and, after tt valid shares, stores (A,B)(A, B) by (6.8). Members may batch shares for many requests in one transaction.
  5. Claim. The owner computes bG=(C−B)+yuAbG = (C - B) + y_u A by Lemma 6.3. The owner takes the candidate bb from their own leaf, decrypted with ku,ak_{u,a} (Chapter 4), or from the SDK’s record, and checks it against bGbG. They post bb, a destination dd (a fresh address, or a Ring deposit as in Chapter 8), and a Chaum-Pedersen proof that log⁡GYu=log⁡AZ\log_G Y_u = \log_A Z with Z=bG−(C−B)Z = bG - (C - B), whose context includes dd, aa and the request address.
  6. Pay. The program recomputes ZZ, verifies the proof, creates the EscapeRecord for the leaf and asset, and transfers the amounts of (6.10) from the vaults to dd‘s token accounts.
pub fn escape_claim(ctx: Context<EscapeClaim>, amount: u64, proof: DleqProof) -> Result<()> {
    require!(ctx.accounts.ledger.load()?.escape_from_slot != 0, PrivErr::NotEscape);
    let req = &mut ctx.accounts.request;
    require!(req.combined && !req.claimed, PrivErr::RequestState);
    // `EscapeRecord` is created with `init` for (leaf, mint): a second claim fails there.

    // Z = bG - (C - B); the proof shows log_G(Y_u) = log_A(Z).
    let (c, a, big_b) = (req.commitment.decompress(), req.a.decompress(), req.b.decompress());
    let z = Scalar::from(amount) * G - (c - big_b);
    let dest = ctx.accounts.destination.key();
    let claim_ctx = claim_context(&crate::ID, &req.key(), &req.mint, &dest);
    require!(
        proof.verify(&G, &req.owner_key.decompress(), &a, &z, &claim_ctx),
        PrivErr::ClaimProof
    );
    req.claimed = true;

    // Settlement rule (6.10): the leaf's asset, plus output assets of open legs that spent it.
    let total = ctx.accounts.asset.load()?.ledger_total;
    for (mint, units) in ctx.accounts.escape.load()?.settle(&req.mint, amount, total)? {
        transfer_from_vault(&ctx, &mint, &dest, units)?;
    }
    emit!(Escaped { request: req.key(), mint: req.mint, amount });
    Ok(())
}

G is the ristretto255 base point; decompress rejects non-canonical encodings, so every point the program uses is a valid group element. The request account holds (C,D)(C, D), YuY_u and the leaf index exactly as verified against ρ(k⋆)\rho^{(k^\star)} in step 3, and the claim context binds the proof to this request, mint and destination, so the proof cannot be lifted onto a different payout or redirected by whoever submits the transaction.

6.8 Safety and liveness of the Escape

For each asset aa, write Ta=∑ubu,a(k⋆)T_a = \sum_{u} b^{(k^\star)}_{u,a} for the frozen committed total, PadepP^{\mathrm{dep}}_a for the pending deposit queue, and PaexitP^{\mathrm{exit}}_a for the pending Exit queue at trigger. Fees are not among them: each Commit paid its Crossing’s fees out of the vaults to the fee recipient. By the conservation check at committed roots (Equation 9.2 and Theorem 4.1) and the recorded fills of the open Crossing, the vault at trigger holds

Va=Ta+Paexit+Padep−Sa+∑ℓ:out(ℓ)=agotℓ.(6.11)V_a = T_a + P^{\mathrm{exit}}_a + P^{\mathrm{dep}}_a - S_a + \sum_{\ell : \mathrm{out}(\ell) = a} \mathrm{got}_\ell . \tag{6.11}

Theorem 6.2 (Escape safety). Assume Commit authenticity (Theorem 5.2), collision resistance of H\mathsf{H}, the discrete-logarithm assumption in G\mathbb{G}, and the random-oracle model for (6.5). Then, against any set of corrupt Council members (including all nn) and any number of corrupt relayers, except with negligible probability in λ\lambda:

  1. (Exactness) every Escape claim for entry (u,a)(u, a) is for the leaf’s Council decryption βu,a\beta_{u,a}, defined by βu,aG=C−sD\beta_{u,a} G = C - sD, which equals bu,a(k⋆)b^{(k^\star)}_{u,a}, and is paid by (6.10);
  2. (Exclusivity) every Escape payout for (u,a)(u, a) is to a destination chosen by the holder of yuy_u;
  3. (Uniqueness) each entry (u,a)(u, a) is paid at most once;
  4. (Solvency) under the hypotheses of Theorem 4.2, the total paid in asset aa during the Escape is at most VaV_a, so every claim, refund and queued Exit is payable.

Proof. (1) The request’s (C,D)(C, D) and owner-tag opening are bound to ρ(k⋆)\rho^{(k^\star)} by the Merkle path, so substituting other values requires a collision in H\mathsf{H}. Each share in (A,B)(A, B) passed (6.7) against a registered SjS_j, so by Lemma 6.4 each satisfies Bj=sjD+κjYuB_j = s_j D + \kappa_j Y_u with Aj=κjGA_j = \kappa_j G for the true share sjs_j; hence (6.8) gives B=sD+κYuB = sD + \kappa Y_u and A=κGA = \kappa G for some κ\kappa, even if every member is corrupt, since corrupt members can choose κj\kappa_j but not sjs_j. Then Z=bG−(C−B)=(b−βu,a)G+κYuZ = bG - (C - B) = (b - \beta_{u,a}) G + \kappa Y_u. An accepted claim proof yields, by special soundness, yy with Yu=yGY_u = yG and Z=yA=κYuZ = yA = \kappa Y_u, so (b−βu,a)G=O(b - \beta_{u,a}) G = O and b=βu,ab = \beta_{u,a} because GG has prime order ℓ\ell and balances are below ℓ\ell. By Theorem 5.2, ρ(k⋆)\rho^{(k^\star)} was signed by an admitted enclave, which writes D=rPCD = rP_{\mathcal{C}} for the opening rr of C=bu,a(k⋆)G+rHC = b^{(k^\star)}_{u,a} G + rH, so βu,a=bu,a(k⋆)\beta_{u,a} = b^{(k^\star)}_{u,a}; Theorem 4.2 gives the same equality from the published proofs alone.

(2) The extractor from (1) outputs yu=log⁡GYuy_u = \log_G Y_u. A claimant who does not hold yuy_u and produces an accepted proof therefore solves a discrete logarithm. A relayer who copies an honest owner’s proof cannot change dd, because dd is in the hashed context and a changed context gives an independent challenge.

(3) The EscapeRecord for (leaf, aa) is created in the same transaction as the payout and its existence aborts any later claim, and a leaf index determines a unique position in ρ(k⋆)\rho^{(k^\star)}.

(4) By (1), (3) and Corollary 4.1, claims in asset aa are for decryptions that sum to at most TaT_a, so by (6.10) they pay at most Ta−SaT_a - S_a units of aa, and claims in the input assets of legs with out(ℓ)=a\mathrm{out}(\ell) = a pay at most ∑ℓ:out(ℓ)=agotℓ\sum_{\ell : \mathrm{out}(\ell) = a} \mathrm{got}_\ell units of aa, since the floors only round down. Refunds pay exactly PadepP^{\mathrm{dep}}_a and queued Exits exactly PaexitP^{\mathrm{exit}}_a, each entry once. The sum is at most VaV_a by (6.11), and in Escape mode no Commit, Residual or new Exit moves the vault. □\square

The theorem holds with every Council member corrupt: a corrupt Council can withhold shares, but it cannot direct a payout, inflate one, or pay twice. Custody therefore rests on the chain, the Merkle root, the published proofs and the owner’s key; the Council contributes availability.

Theorem 6.3 (Escape liveness). If at least tt Council members are honest and each lands its share transactions on chain, then every owner uu who posts a valid request for (u,a)(u, a) receives bu,a(k⋆)b^{(k^\star)}_{u,a}, settled by (6.10), at a destination of their choice.

Proof. Honest members respond to every valid request by (6.6), and by completeness of the sigma protocol their shares pass (6.7). Shares that fail verification are discarded individually, so tt honest shares suffice regardless of other posts, and (6.8) produces (A,B)(A, B) with B=sD+κYuB = sD + \kappa Y_u. By Lemma 6.3 the owner computes bu,a(k⋆)Gb^{(k^\star)}_{u,a} G, matches it against their leaf or balance record, and produces an honest claim proof that passes verification. The vaults hold enough by Theorem 6.2 (4), and no EscapeRecord exists for the entry, because only a claim by the holder of yuy_u can create it. □\square

Confidentiality during the Escape. By Lemma 6.5, the shares posted for owner uu reveal nothing about bu,a(k⋆)b^{(k^\star)}_{u,a} to anyone without yuy_u, and requests reveal only leaf fields that were already committed in ciphertext, together with the escape key. Owners who never claim keep their balances confidential at the level of the honest threshold of the Council. A claimed amount becomes visible on chain as a vault transfer, exactly as a normal Exit does, and the destination may be a Ring deposit to unlink it (Chapter 8).

The Escape gives the Council a narrow role: it holds a key no fewer than tt members can use, it re-encrypts only toward keys the chain has verified, and every share it posts comes with a proof the program checks. The Coprocessor of Chapter 5 provides confidentiality and authentic Commits; the Council and the Escape guarantee that a trader’s last committed balance remains theirs whether or not the Coprocessor ever commits again.

References

  1. A. Shamir, “How to share a secret”, Communications of the ACM 22(11), November 1979. https://doi.org/10.1145/359168.359176
  2. P. Feldman, “A practical scheme for non-interactive verifiable secret sharing”, 28th IEEE Symposium on Foundations of Computer Science (FOCS), 1987. https://doi.org/10.1109/SFCS.1987.4
  3. T. P. Pedersen, “Non-interactive and information-theoretic secure verifiable secret sharing”, CRYPTO 1991, LNCS 576. https://doi.org/10.1007/3-540-46766-1_9
  4. R. Gennaro, S. Jarecki, H. Krawczyk, T. Rabin, “Secure distributed key generation for discrete-log based cryptosystems”, Journal of Cryptology 20(1), 2007. https://doi.org/10.1007/s00145-006-0347-3
  5. A. Herzberg, S. Jarecki, H. Krawczyk, M. Yung, “Proactive secret sharing or: how to cope with perpetual leakage”, CRYPTO 1995, LNCS 963. https://doi.org/10.1007/3-540-44750-4_27
  6. D. Chaum, T. P. Pedersen, “Wallet databases with observers”, CRYPTO 1992, LNCS 740. https://doi.org/10.1007/3-540-48071-4_7
  7. A. Fiat, A. Shamir, “How to prove yourself: practical solutions to identification and signature problems”, CRYPTO 1986, LNCS 263. https://doi.org/10.1007/3-540-47721-7_12
  8. D. Bernhard, O. Pereira, B. Warinschi, “How not to prove yourself: pitfalls of the Fiat-Shamir heuristic and applications to Helios”, ASIACRYPT 2012, LNCS 7658. https://doi.org/10.1007/978-3-642-34961-4_38
  9. V. Shoup, R. Gennaro, “Securing threshold cryptosystems against chosen ciphertext attack”, Journal of Cryptology 15(2), 2002. https://doi.org/10.1007/s00145-001-0020-9
  10. H. de Valence, J. Grigg, M. Hamburg, I. Lovecruft, G. Tankersley, F. Valsorda, “The ristretto255 and decaf448 Groups”, RFC 9496, IETF, December 2023. https://www.rfc-editor.org/rfc/rfc9496
  11. 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
  12. solana-curve25519 crate documentation (ristretto255 and edwards25519 syscall wrappers), Anza, 2025. https://docs.rs/solana-curve25519/latest/solana_curve25519/