xCompute: Computation on Threshold Shares
Evaluate Boolean and arithmetic circuits directly on XorIDA threshold shares without reconstruction. XOR gates are FREE via GF(2) linearity. AND gates use Beaver triples. Arithmetic operations extend to sums, products, and comparisons over finite fields. Plaintext never exists at any single node.
The Problem
Every privacy-preserving system that needs to compute on sensitive data faces the same dilemma: reconstruct the plaintext (destroying privacy) or use heavyweight MPC protocols (destroying performance).
Traditional multi-party computation (MPC) protocols like garbled circuits and oblivious transfer achieve privacy but impose massive communication overhead — often 100–1000x the input size. They treat every operation as equally expensive, requiring multiple communication rounds for each gate.
XorIDA already splits data into information-theoretically secure shares. But until now, to compute on that data, you had to reconstruct it first — collapsing security back to a single point. The data was private at rest but exposed at compute time.
This gap locks out four massive markets: fraud matching (insurance), ad attribution (ad-tech), credit scoring (finance), and federated learning (AI/ML). Combined TAM: $2,082B.
The Old Way
The PRIVATE.ME Solution
xCompute evaluates Boolean circuits directly on XorIDA threshold shares. XOR operations are completely free — zero communication, zero overhead — because XorIDA shares are additive over GF(2). AND operations use Beaver triples with one communication round each.
The key insight: XOR of shares equals shares of XOR. This is not an approximation — it is a mathematical identity guaranteed by GF(2) linearity. Any computation expressible as a Boolean circuit (XOR, AND, NOT gates) can run on split data without ever reconstructing the plaintext.
For many practical computations (equality checks, parity, checksums, error detection), the circuit is 100% XOR gates. These computations are literally free — each party evaluates locally with no communication. AND gates, needed for operations like comparison and multiplication, use pre-generated Beaver triples that mask the inputs before any values are revealed.
The New Way
How It Works
xCompute converts XorIDA threshold shares into per-bit additive shares, evaluates Boolean circuits gate-by-gate, and re-shares the result back into fresh XorIDA threshold shares.
Three Computation Classes
Not all computations are created equal. xCompute categorizes operations into three classes based on their communication cost.
| Class | Gates | Communication | Cost | Examples |
|---|---|---|---|---|
| Class 1: FREE | XOR, NOT only | Zero | 0 rounds | Equality check, parity, XOR aggregate, error detection |
| Class 2: Linear | AND + XOR/NOT | 1 round per AND gate | O(AND gates) | Comparison, pattern matching, range check |
| Class 3: Hybrid | Mixed circuits | Circuit-dependent | O(depth) | Fraud matching, credit scoring, ML inference |
Use Cases
Run pattern-matching circuits on Xcheck claim shares. Detect duplicate claims across insurers without any party seeing the full claim data.
Xcheck + xComputeLicense MPC computations per participant identity. Circuit execution requires cryptographic proof that all parties hold valid licenses. Prevents unauthorized computation sharing and resale. Revenue assurance for MPC-as-a-service vendors.
Licensed ComputationEvaluate creditworthiness across split bureau data. No single entity sees the complete credit profile. Comparison circuits enable threshold decisions.
Xscore + xComputeAggregate model gradients on split shares. XOR aggregation is Class 1 (FREE). No participant sees aggregate gradients until threshold reconstruction.
Xlearn + xComputeIntegration
import { CircuitBuilder, buildEqualityCircuit } from '@private.me/xcompute'; // Pre-built: 8-bit equality check (Class 1 — FREE, zero AND gates) const eqCircuit = buildEqualityCircuit(8); // Custom: build any Boolean circuit const builder = new CircuitBuilder(); const a = builder.addInput('a'); const b = builder.addInput('b'); const xored = builder.addXor(a, b); // FREE — no communication const masked = builder.addAnd(xored, a); // 1 Beaver triple builder.addOutput(masked); const circuit = builder.build();
import { simulateComputation, generatePool } from '@private.me/xcompute'; // Generate Beaver triples for AND gates const triples = generatePool(circuit.andGateCount, 1); // Input bits: party contributions const inputs = new Map<number, number>(); inputs.set(0, 1); // wire 0 = 1 inputs.set(1, 0); // wire 1 = 0 // Evaluate circuit on shares — plaintext never assembled const result = simulateComputation(circuit, inputs, 3, triples); // result.ok === true, result.value = output bits
Security Properties
| Property | Mechanism | Guarantee |
|---|---|---|
| Input Privacy | XorIDA threshold shares | Information-theoretic |
| Computation Privacy | Additive share evaluation | No single-party view |
| AND Gate Security | Beaver triple masking | Inputs never revealed |
| Output Decorrelation | Fresh XorIDA re-sharing | I/O unlinkable |
| Integrity | HMAC-SHA256 per share | Tamper-evident |
| Quantum Resistance | GF(2) operations, no keys | Unconditional security |
Arithmetic MPC
Beyond Boolean: arithmetic operations on shares over finite fields. Addition is free. Multiplication uses Beaver triples over arithmetic fields. Comparison protocols enable threshold decisions on private data.
Sections 01–07 cover Boolean circuits — XOR/AND/NOT gates over GF(2). Many real-world applications require arithmetic operations: summing encrypted salaries, averaging insurance claims, computing portfolio risk. xCompute v0.2.0 extends the computation model to arithmetic fields.
Arithmetic Share Model
Instead of per-bit additive shares over GF(2), arithmetic MPC operates on additive shares over a prime field F_p. Each party holds a share x_i such that x = x_1 + x_2 + ... + x_n (mod p). The plaintext value x never exists at any single party.
Three Arithmetic Operations
| Operation | Protocol | Communication | Cost |
|---|---|---|---|
| Addition | Local add of shares | Zero | FREE |
| Scalar Multiply | Local multiply by constant | Zero | FREE |
| Multiplication | Beaver triple over F_p | 1 round | O(1) per gate |
Addition is free — each party adds their shares locally: (x_1 + y_1), (x_2 + y_2), ..., (x_n + y_n). The sum of the result shares equals x + y mod p. Zero communication, zero overhead. This is the arithmetic analog of XOR being free over GF(2).
Multiplication uses Beaver triples over the arithmetic field. Pre-generated triples (a, b, c) where c = a × b mod p mask the inputs before any values are exchanged. One communication round per multiplication gate. The masked values reveal nothing about the actual inputs.
Comparison protocols convert arithmetic shares to bit-decomposed form, apply Boolean comparison circuits, and return a Boolean result share. This enables threshold decisions (e.g., “is the sum greater than X?”) without revealing the actual values.
T2A Conversion for Arithmetic Fields
XorIDA threshold shares (GF(2) based) are converted to arithmetic additive shares over F_p via a Threshold-to-Arithmetic (T2A) protocol. Each party reconstructs a chunk of the threshold share locally and converts to a field element. The conversion preserves the threshold security guarantee — fewer than K parties learn nothing.
import { ArithmeticCircuitBuilder } from '@private.me/xcompute'; // Build arithmetic circuit: weighted sum const builder = new ArithmeticCircuitBuilder({ prime: 2n ** 61n - 1n }); const salary1 = builder.addInput('salary_1'); const salary2 = builder.addInput('salary_2'); const weight = builder.addConstant(500n); // Addition: FREE — zero communication const sum = builder.addGate(salary1, salary2); // Multiplication: 1 Beaver triple, 1 round const weighted = builder.mulGate(sum, weight); // Comparison: is weighted sum > threshold? const above = builder.compareGate(weighted, builder.addConstant(100000n)); builder.addOutput(above); const circuit = builder.build(); // circuit.addGateCount === 1, circuit.mulGateCount === 1
Enhanced Identity with Xid
xCompute can optionally integrate with Xid to enable unlinkable MPC participant identity — verifiable within each computation session, but uncorrelatable across different computations, parties, or time.
Three Identity Modes
How Ephemeral MPC Participation Works
// Initialize xCompute with Xid integration import { XComputeEngine } from '@private.me/xcompute-cli'; import { XidClient } from '@private.me/xid'; const xid = new XidClient({ mode: 'ephemeral' }); const engine = new XComputeEngine({ identityProvider: xid }); // Each computation derives unlinkable participant DID automatically const result = await engine.secureCompute({ circuit: addSalaries, myShare: encryptedSalary }); → [xCompute] Deriving ephemeral DID from master seed... → [xCompute] DID: did:key:z6MkD... (unique to this session + circuit + epoch) → [xCompute] Participant authenticated (~50µs) → [xCompute] Key purged (<1ms exposure) // Session is logged with unlinkable participant DID // Verification works within session, but cross-session correlation fails
See the Xid white paper for details on ephemeral identity primitives and K-of-N convergence.
Market Positioning
| Industry | Use Case | Compliance Driver |
|---|---|---|
| Finance | Regulatory reporting with unlinkable bank participation | GLBA, SOX, Basel III, MiFID II |
| Healthcare | Multi-hospital analytics with HIPAA-compliant unlinkability | HIPAA, 42 CFR Part 2, HITECH |
| Government | Multi-agency classified computations with unlinkable agency identity | FISMA, CJIS, FedRAMP, Zero Trust |
| EU Compliance | GDPR-compliant multi-party analytics, unlinkable participation logs | eIDAS 2.0 ARF, DORA, GDPR Art. 5 |
Key Benefits
- Cross-session unlinkability — Can't track participants across different computations
- Per-circuit derivation — Same party has different DIDs for different circuit types
- Epoch rotation — DIDs automatically rotate daily/weekly/monthly
- Split-protected derivation — Master seed is XorIDA-split, never reconstructed
- eIDAS 2.0 ARF compliance — Meets EU unlinkability requirements for MPC
- GDPR data minimization — MPC logs contain minimal linkable identifiers
Developer Experience
Enterprise-grade error handling, progress tracking, and debugging tools. xCompute provides detailed feedback at every stage of multi-party computation with 24 categorized error codes and per-gate progress updates.
Progress Callbacks
Long-running MPC operations support real-time progress tracking via callback hooks. Monitor circuit evaluation gate-by-gate, track Beaver triple consumption, and observe share distribution across parties.
import { evaluateCircuit, CircuitBuilder } from '@private.me/xcompute'; // Build a 64-bit comparison circuit (63 AND gates) const circuit = builder.buildComparisonCircuit(64); // Evaluate with progress callback const result = await evaluateCircuit(circuit, inputs, { partyCount: 3, beaverTriples: triples, onProgress: (progress) => { console.log(`Gate ${progress.gateIndex}/${progress.totalGates}`); console.log(`Type: ${progress.gateType}`); // "xor" | "and" | "not" console.log(`Triples used: ${progress.triplesConsumed}`); console.log(`Completion: ${progress.percentComplete}%`); } }); // Output example: // Gate 1/63 (Type: and, Triples: 1, Completion: 1.6%) // Gate 32/63 (Type: and, Triples: 32, Completion: 50.8%) // Gate 63/63 (Type: and, Triples: 63, Completion: 100%)
import { simulateComputation } from '@private.me/xcompute'; const result = await simulateComputation(circuit, inputs, 3, triples, { onProgress: (progress) => { // Per-party computation state progress.parties.forEach((party, idx) => { console.log(`Party ${idx}: wire ${party.currentWire}, ${party.communicationRounds} rounds`); }); }, onRoundComplete: (roundInfo) => { console.log(`Round ${roundInfo.roundNumber}: ${roundInfo.gatesEvaluated} gates`); console.log(`Bandwidth: ${roundInfo.bytesExchanged} bytes`); } });
Comprehensive Error Codes
xCompute defines 24 error codes across 5 categories for precise debugging and automated error recovery in production MPC systems. Each error includes actionable remediation guidance.
| Code | Description | Remediation |
|---|---|---|
| Configuration Errors (E1xxx) | ||
E1001 |
INVALID_PARTY_COUNT | Must be 2-7 parties. Current implementation supports 2-3. |
E1002 |
INVALID_THRESHOLD | Threshold K must satisfy 2 ≤ K ≤ N. Recommended: K = ceil(N/2) + 1. |
E1003 |
FIELD_PRIME_TOO_SMALL | Arithmetic field prime must be > 2^31. Use 2^61-1 for standard operations. |
E1004 |
UNSUPPORTED_GATE_TYPE | Unknown gate type in circuit. Supported: XOR, AND, NOT, ADD, MUL. |
| Circuit Errors (E2xxx) | ||
E2001 |
CIRCUIT_TOO_LARGE | Circuit exceeds 10,000 gates. Reduce gate count or split into subcircuits. |
E2002 |
CIRCUIT_CYCLE_DETECTED | Circuit contains dependency cycle. DAG validation failed. Check wire ordering. |
E2003 |
MISSING_INPUT_WIRE | Gate references undefined input wire. Verify all inputs are declared. |
E2004 |
OUTPUT_WIRE_CONFLICT | Multiple gates write to same output wire. Each wire must have unique source. |
E2005 |
CIRCUIT_DEPTH_EXCEEDED | Circuit depth > 100 layers. High latency expected. Consider parallelization. |
| Share Errors (E3xxx) | ||
E3001 |
SHARE_MISMATCH | Parties have incompatible share indices. Ensure all parties use same circuit + inputs. |
E3002 |
HMAC_VERIFICATION_FAILED | Share integrity check failed. Share may be corrupted or tampered. Reject and retry. |
E3003 |
SHARE_SIZE_OVERFLOW | Input share exceeds 1MB. Consider chunking or increasing share size limit. |
E3004 |
INSUFFICIENT_SHARES | Received M < K shares. Need at least K shares to reconstruct. Wait for more parties. |
E3005 |
DUPLICATE_SHARE_INDEX | Multiple shares with same index. Each party must have unique index 1..N. |
| Computation Errors (E4xxx) | ||
E4001 |
BEAVER_POOL_EXHAUSTED | Not enough Beaver triples for AND gates. Pre-generate more triples or reduce circuit size. |
E4002 |
BEAVER_TRIPLE_INVALID | Triple failed (c = a ∧ b) check. Regenerate Beaver pool with fresh randomness. |
E4003 |
PARTY_TIMEOUT | Party did not respond within 30s. Check network connectivity or increase timeout. |
E4004 |
COMMUNICATION_FAILURE | Failed to exchange masked values. Network partition or party offline. Retry round. |
E4005 |
ARITHMETIC_OVERFLOW | Value exceeds field prime during arithmetic MPC. Use larger field or reduce inputs. |
E4006 |
DIVISION_BY_ZERO | Attempted division/modulo by zero in arithmetic circuit. Check input validation. |
| Reconstruction Errors (E5xxx) | ||
E5001 |
RECONSTRUCTION_MISMATCH | Reconstructed value inconsistent across parties. Possible cheating or corruption. |
E5002 |
OUTPUT_SIZE_UNEXPECTED | Reconstructed output size ≠ expected. Circuit may have undefined outputs. |
E5003 |
T2A_CONVERSION_FAILED | Threshold-to-additive conversion failed. Check share indices and party alignment. |
E5004 |
A2T_RESHARE_FAILED | Additive-to-threshold re-sharing failed. Insufficient randomness or party dropout. |
evaluateCircuit() and simulateComputation() in try-catch and match error codes for automated recovery. E3xxx/E4xxx errors are often transient (network issues, timeouts) — retry with exponential backoff. E2xxx errors are circuit bugs — fail fast and log for developer fix.
MPC Circuit Evaluation Example
Complete end-to-end workflow for multi-party computation with error handling, progress tracking, and result verification.
import { CircuitBuilder, evaluateCircuit, generateBeaverPool, thresholdToAdditive, additiveToThreshold } from '@private.me/xcompute'; // Three credit bureaus (Equifax, Experian, TransUnion) compute aggregate // credit score WITHOUT any bureau seeing the other bureaus' data. // 1. Build circuit: weighted average of 3 scores const builder = new CircuitBuilder({ arithmeticField: 2n ** 61n - 1n }); const score1 = builder.addInput('bureau_1_score', 16); // 16-bit integer const score2 = builder.addInput('bureau_2_score', 16); const score3 = builder.addInput('bureau_3_score', 16); // Weights: 40%, 35%, 25% const w1 = builder.addConstant(40n); const w2 = builder.addConstant(35n); const w3 = builder.addConstant(25n); // Multiplication gates (each requires 1 Beaver triple) const weighted1 = builder.mulGate(score1, w1); const weighted2 = builder.mulGate(score2, w2); const weighted3 = builder.mulGate(score3, w3); // Addition gates (FREE — local only) const sum12 = builder.addGate(weighted1, weighted2); const totalWeighted = builder.addGate(sum12, weighted3); // Divide by 100 to normalize const normalizer = builder.addConstant(100n); const avgScore = builder.divGate(totalWeighted, normalizer); // Comparison: is avg score > 700 (prime lending threshold)? const threshold = builder.addConstant(700n); const isPrime = builder.compareGate(avgScore, threshold); // Boolean output builder.addOutput(avgScore); builder.addOutput(isPrime); const circuit = builder.build(); console.log(`Circuit: ${circuit.mulGateCount} MUL gates, ${circuit.addGateCount} ADD gates`); // 2. Generate Beaver triples (offline phase, pre-computation) const triples = generateBeaverPool(circuit.mulGateCount, 3); console.log(`Generated ${triples.length} Beaver triples`); // 3. Each bureau splits their score into XorIDA threshold shares const bureau1Score = 720; // Equifax's private score const bureau2Score = 695; // Experian's private score const bureau3Score = 710; // TransUnion's private score // Convert to additive shares (T2A) const shares1 = thresholdToAdditive(bureau1Score, 16); const shares2 = thresholdToAdditive(bureau2Score, 16); const shares3 = thresholdToAdditive(bureau3Score, 16); // 4. Evaluate circuit with progress tracking const result = await evaluateCircuit(circuit, { 'bureau_1_score': shares1, 'bureau_2_score': shares2, 'bureau_3_score': shares3 }, { partyCount: 3, beaverTriples: triples, onProgress: (p) => { console.log(`[${p.percentComplete.toFixed(1)}%] Gate ${p.gateIndex}: ${p.gateType}`); }, onRoundComplete: (r) => { console.log(`Round ${r.roundNumber} complete: ${r.bytesExchanged} bytes exchanged`); } }).catch((err) => { if (err.code === 'E4001') { console.error('BEAVER_POOL_EXHAUSTED: regenerate triples'); } else if (err.code === 'E3001') { console.error('SHARE_MISMATCH: parties have different circuit versions'); } else { console.error(`Computation failed: ${err.message}`); } throw err; }); // 5. Reconstruct result (only when all parties agree) const [avgScoreShares, isPrimeShares] = result.outputs; // A2T: re-share into fresh XorIDA threshold shares (decorrelates I/O) const finalAvgScore = await additiveToThreshold(avgScoreShares, 3, 2); const finalDecision = await additiveToThreshold(isPrimeShares, 3, 2); console.log(`Aggregate credit score: ${finalAvgScore} (prime lending: ${finalDecision})`); // Expected output: // Aggregate credit score: 710 (prime lending: true) // Calculation: (720*40 + 695*35 + 710*25) / 100 = 710.25 → 710 // NO BUREAU SAW ANY OTHER BUREAU'S RAW SCORE
Healthcare: Multi-hospital clinical trial analytics, encrypted patient cohort matching.
Insurance: Cross-insurer claim duplicate detection, actuarial risk modeling on pooled data.
Government: Multi-agency classified analytics, joint intelligence computation without clearance sharing.
All computations produce verifiable audit trails via xProve HMAC-chained integrity proofs.
Benchmarks
Performance characteristics measured on Node.js 22, Apple M2. xCompute enables secure multi-party computation with single-digit millisecond latency for basic operations.
| Operation | Time | Notes |
|---|---|---|
| Share generation (3-party) | <1ms | XorIDA split into 3 computation shares |
| 3-party addition | ~5ms | Local XOR operation, no communication |
| 3-party multiplication | ~10ms | Beaver triple protocol, 1 round of communication |
| 3-party comparison | ~15ms | Bit-decomposition + comparison circuit |
| Beaver triple generation | ~3ms | Pre-computed, amortized across operations |
| Result reconstruction | <1ms | HMAC verify + XOR combine |
| HMAC verification per share | <0.1ms | Integrity check before every operation |
| Full computation pipeline | ~20ms | Share → compute (add + multiply) → verify → reconstruct |
MPC Framework Comparison
| Property | Shamir MPC | Garbled Circuits | SPDZ | xCompute |
|---|---|---|---|---|
| Share generation | ~50ms | N/A (circuit-based) | ~20ms | <1ms |
| Addition | ~1ms | Free | ~1ms | ~5ms |
| Multiplication | ~50ms | ~100ms | ~15ms | ~10ms |
| Security model | IT-secure | Computational | IT-secure (with MAC) | IT-secure (XorIDA) |
| Setup required | Trusted dealer | Circuit compilation | Preprocessing | None |
Ship Proofs, Not Source
xCompute generates cryptographic proofs of correct execution without exposing proprietary algorithms. Verify integrity using zero-knowledge proofs — no source code required.
- Tier 1 HMAC (~0.7KB)
- Tier 2 Commit-Reveal (~0.5KB)
- Tier 3 IT-MAC (~0.3KB)
- Tier 4 KKW ZK (~0.4KB)
Use Cases
Honest Limitations
Five known limitations documented transparently. xCompute optimizes for simplicity and information-theoretic security over generality.
| Limitation | Impact | Mitigation |
|---|---|---|
| Fixed 3-party model | xCompute currently supports exactly 3 computation parties. Computations requiring more parties need protocol changes. | 3-party is sufficient for most MPC use cases (client + server + auditor). N-party extension is planned for future releases. |
| Honest-but-curious assumption | Parties are assumed to follow the protocol but may try to learn from their view. Active adversaries who deviate from the protocol are not detected. | HMAC verification catches data corruption. For active security, pair with xProve Tier 3 (IT-MAC SPDZ-style) which detects cheating parties. |
| Multiplication overhead | Each multiplication requires one round of communication between parties (~10ms). Deep circuits with many multiplications accumulate latency linearly. | Beaver triples are pre-computed and batched. Circuit depth optimization reduces sequential multiplications. Addition is free (local XOR). |
| No floating-point arithmetic | xCompute operates on integer shares over GF(2). Floating-point operations require fixed-point encoding, which loses precision. | Fixed-point encoding with configurable precision (16–64 fractional bits) handles most financial and scientific computations. Results are exact within the chosen precision. |
| Communication overhead | Each multiplication round requires all 3 parties to exchange messages. Network latency between parties directly impacts computation time. | Co-locate parties in the same region (<5ms RTT). Batch independent multiplications into single rounds. Pre-computation amortizes setup cost. |
Verifiable Data Protection
Every operation in this ACI produces a verifiable audit trail via xProve. HMAC-chained integrity proofs let auditors confirm that data was split, stored, and reconstructed correctly — without accessing the data itself.
Read the xProve white paper →
Ready to deploy xCompute?
Talk to Ren, our AI sales engineer, or book a live demo with our team.