Loading...
private.me Docs
Get xCross
PRIVATE.ME PLATFORM

xCross: DeFi Cross-Chain Bridge Security

Blockchain-agnostic atomic swaps with XorIDA-split secrets. Bridge signing keys split across independent validators. Information-theoretically secure. Works with any HTLC-capable chain.

Financial / DeFi 50 Tests · 3 Files Blockchain-Agnostic XorIDA Powered
Section 01

The Bridge Problem

Cross-chain bridges are the number one DeFi attack vector. Bridge signing keys held by single validators or small multisig groups have enabled over $2.5 billion in exploits since 2021.

Cross-chain bridges transfer assets between blockchains by locking tokens on one chain and minting equivalent tokens on another. The bridge's signing keys authorize these transfers. When these keys are compromised, attackers can mint unlimited tokens or drain locked funds.

The Ronin Bridge ($625M), Wormhole ($320M), and Nomad ($190M) exploits all targeted bridge key management. Traditional multisig provides some protection but is computationally secure, not information-theoretically secure. A multisig key exists as a complete key that is checked against multiple signatures. xCross provides a fundamentally stronger guarantee: below-threshold shares reveal zero information about the key regardless of the attacker's computational power.

The Old Way

Bridge Key Signing authority CENTRAL VALIDATOR Single Point Full key exposure $2.5B+ exploited Unlimited minting Fund drainage
Section 02

The xCross Solution

xCross splits bridge signing keys and swap secrets across independent validators using XorIDA K-of-N threshold sharing. No validator can act alone. HMAC verification ensures integrity before every reconstruction.

Bridge keys are split via splitSecret() into K-of-N shares distributed across independent validators operating in different jurisdictions, on different infrastructure, with different security teams. Atomic swaps via initiateSwap() and completeSwap() collect K threshold shares, verify HMAC integrity, ephemerally reconstruct the secret, authorize the transaction, and immediately destroy the reconstructed secret material.

Unlike traditional multisig, XorIDA provides information-theoretic security: below-threshold shares reveal zero information about the swap secret. This is mathematically provable and holds even against quantum computers or unbounded computational resources. The implementation is blockchain-agnostic and works with any chain supporting hash-time-locked contracts (HTLCs).

The New Way

Swap Secret 32-byte key XORIDA SPLIT K-of-N validators HMAC-signed Validator 1 Share + HMAC Validator 2 Share + HMAC Validator N Share + HMAC HMAC VERIFY Reconstruct Sign + Destroy
Information-Theoretic Security
No complete key at rest: The signing key never exists in complete form after the initial split. Ephemeral reconstruction: The key exists only in memory during signing and is immediately destroyed. Quantum-proof: XorIDA security is information-theoretic, not computational — unbreakable by any future computer.
Section 03

Architecture

Atomic swap lifecycle: initiation (create HTLC + split secret), completion (threshold reconstruct + claim + destroy), and refund (timelock expiry recovery).

INITIATION Create HTLC + Split Secret split to N validators HTLC locks funds on source chain COMPLETION Threshold Claim K shares collected + HMAC verified Ephemeral reconstruct, claim, destroy REFUND Timelock Recovery If swap fails Funds returned after expiry BLOCKCHAIN-AGNOSTIC Works with any HTLC-capable chain · Ethereum, Bitcoin, Cosmos, Polkadot, Solana, Cardano

Core Types

SwapConfig: Configuration for atomic swap (sourceChain, destChain, amount, recipient, timelockSeconds, optional fee).

SwapSecret: XorIDA-split swap secret (preimage, shares[], hmacs[], hash). Below-threshold shares reveal zero information.

SwapShare: Single XorIDA share (index, total, threshold, data, hmac). Distributed to independent validators.

SwapState: Current swap state (swapId, config, secretHash, expiry, initiator, status, optional proof, optional completedAt).

SwapProof: xProve verification proof (tier T1/T2/T3/T4a/T4b, proof data, publicInputs, timestamp).

Section 04

Benchmarks

XorIDA splitting and reconstruction are sub-millisecond operations for typical 32-byte secrets. HTLC creation and claim times depend on blockchain confirmation speed.

<1ms
Typical split/reconstruct
32 bytes
Secret preimage
K-of-N
Threshold shares
0
Keys at rest

Performance Characteristics

OperationTypical TimeNotes
Secret Split (2-of-3)<1msXorIDA split + HMAC generation
Secret Reconstruct (2-of-3)<1msHMAC verify + XorIDA reconstruct
HTLC CreationVariesDepends on blockchain confirmation time
HTLC ClaimVariesDepends on blockchain confirmation time

xCross cryptographic operations are negligible overhead compared to blockchain confirmation times. The security gain is substantial: information-theoretic protection against validator compromise.

Section 05

Security Analysis

xCross provides information-theoretic security for swap secrets. Below-threshold shares reveal zero information regardless of computational power. HMAC integrity verification protects against tampering.

PropertyMechanismGuarantee
Secret ConfidentialityXorIDA K-of-N thresholdInformation-theoretic
Validator CompromiseThreshold distributionZero secret leakage (<K shares)
Secret IntegrityHMAC-SHA256 per shareTamper-evident
No Secret at RestEphemeral reconstructionExists only during claim
Quantum ResistanceGF(2) operations, no keysUnconditional security
AtomicityHTLC cryptographic enforcementBoth claim or both refund

Blockchain-Agnostic Design

xCross works with any blockchain that supports hash-time-locked contracts (HTLCs). The XorIDA secret splitting is chain-agnostic and operates at the cryptographic layer, not the consensus layer. Supported chains include:

  • Ethereum and EVM-compatible chains (Polygon, Arbitrum, Optimism, BSC, Avalanche)
  • Bitcoin via Lightning Network HTLCs or on-chain scripts
  • Cosmos ecosystem chains via IBC HTLC modules
  • Polkadot parachains with XCMP HTLC support
  • Cardano via Plutus HTLC scripts
  • Solana via Sealevel HTLC programs

Adding support for new chains requires only a chain-specific HTLC adapter. The core XorIDA splitting, HMAC verification, and secret reconstruction logic is universal.

Threat Model
Adversary controls <K validators: Learns zero information about the swap secret (information-theoretic). Adversary tampers with shares: HMAC verification fails before reconstruction. Adversary attempts double-spend: HTLC atomicity prevents claiming on both chains. Swap fails: Timelock allows refund after expiry. See docs/threat-model.md for complete analysis.
Section 06

Integration

xCross provides a simple API for atomic swaps: initiate, complete, refund. All operations return Result<T, E> for explicit error handling.

Quick Start
import { initiateSwap, completeSwap, refundSwap } from '@private.me/xcross';
import type { SwapConfig, SwapProof, ProgressCallback } from '@private.me/xcross';

// Configure atomic swap
const config: SwapConfig = {
  sourceChain: 'ethereum',
  destChain: 'bitcoin',
  amount: '1000000',        // 0.01 BTC in satoshis
  recipient: 'bc1q...',
  timelockSeconds: 86400,   // 24 hours
};

// Progress callback for long-running operations
const onProgress: ProgressCallback = (stage, percent) => {
  console.log(`${stage}: ${percent}%`);
};

// Initiate swap (creates HTLC + splits secret across validators)
const initResult = await initiateSwap(config, 'initiator_eth_address', 2, 3, onProgress);

if (initResult.ok) {
  const { state, secret, htlcAddress } = initResult.value;
  // Deploy HTLC on Ethereum with secret.hash
  // Distribute secret.shares to 3 validators (need 2 to complete)
  console.log(`Swap ID: ${state.swapId}`);
  console.log(`HTLC: ${htlcAddress}`);
}

// Complete swap (collects K shares, reconstructs secret, claims funds)
const shares = [secret.shares[0]!, secret.shares[1]!]; // 2-of-3
const proof: SwapProof = {
  tier: 'T3',
  proof: '...',
  publicInputs: [state.secretHash, config.amount],
  timestamp: new Date().toISOString(),
};

const completeResult = await completeSwap(state, shares, proof, onProgress);

if (completeResult.ok) {
  const { preimage, txHash } = completeResult.value;
  // Use preimage to claim funds on destination chain
  console.log(`Swap completed! Tx: ${txHash}`);
}

// Refund if swap fails (after timelock expiry)
const refundResult = await refundSwap(state, onProgress);
if (refundResult.ok) {
  console.log(`Refunded: ${refundResult.value.txHash}`);
}
Section 07

API Reference

Core Functions

initiateSwap(config: SwapConfig, initiatorAddress: string, threshold?: number, totalShares?: number, onProgress?: ProgressCallback): Promise<Result<InitiateSwapResult, XcrossError>>
Create a new atomic swap. Generates a random 32-byte secret, splits it via XorIDA into K-of-N shares (default 2-of-3), computes HMAC per share, and returns swap state with HTLC address. The secret is split immediately after generation. Returns InitiateSwapResult (state, secret, htlcAddress) on success.
completeSwap(state: SwapState, shares: SwapShare[], proof: SwapProof, onProgress?: ProgressCallback): Promise<Result<CompleteSwapResult, XcrossError>>
Complete an atomic swap by collecting at least K threshold shares, verifying HMAC integrity, ephemerally reconstructing the secret, revealing it to claim HTLC funds, and immediately destroying the reconstructed secret material. Requires xProve proof for verification. Returns CompleteSwapResult (state, preimage, txHash) on success.
refundSwap(state: SwapState, onProgress?: ProgressCallback): Promise<Result<RefundSwapResult, XcrossError>>
Refund the swap after timelock expiry if it was not completed. Only callable after the timelock period expires. Returns RefundSwapResult (state, txHash) on success.
splitSecret(preimage: Uint8Array, threshold: number, totalShares: number, onProgress?: ProgressCallback): Promise<Result<SwapSecret, XcrossError>>
Lower-level API: split a 32-byte secret preimage into K-of-N XorIDA shares with HMAC integrity tags. Returns SwapSecret (preimage, shares, hmacs, hash). The preimage is NOT destroyed (caller manages lifecycle).
reconstructSecret(shares: SwapShare[], onProgress?: ProgressCallback): Promise<Result<Uint8Array, XcrossError>>
Lower-level API: reconstruct the secret preimage from K threshold shares after HMAC verification. Returns the 32-byte preimage. Fails if HMAC verification fails or insufficient shares provided.

Error Handling

Error Pattern
import { ERROR_DETAILS, toXcrossError } from '@private.me/xcross';

const result = await completeSwap(state, shares, proof);

if (!result.ok) {
  // Get actionable error details
  const details = ERROR_DETAILS[result.error.code];
  console.error(details.message);
  console.error('Recovery hint:', details.hint);

  // Convert to typed error class for try/catch patterns
  const error = toXcrossError(result.error.code);
  console.error(error.docUrl); // Link to docs
}
DEVELOPER EXPERIENCE

UX Enhancements

xCross provides progress callbacks and comprehensive error handling to make long-running swap operations transparent and debuggable.

Progress Callbacks

Monitor long-running operations with the optional ProgressCallback parameter. All core functions (initiateSwap, completeSwap, refundSwap) support progress tracking.

Progress Monitoring
const onProgress = (stage: string, percent: number) => {
  console.log(`[${percent}%] ${stage}`);
};

await initiateSwap(config, initiator, 2, 3, onProgress);

// Output:
// [5%] validating
// [15%] generating-secret
// [25%] splitting-secret
// [60%] generating-hmacs
// [75%] creating-htlc
// [100%] complete

Error Details Map

Every error code has an entry in ERROR_DETAILS with a human-readable message and actionable recovery hint. Error classes (XcrossConfigError, XcrossIntegrityError, XcrossExecutionError, XcrossProofError) provide documentation URLs.

Error CodeCategoryRecovery Hint
INVALID_CONFIGConfigurationCheck chain IDs, amount format, recipient address, timelock duration
SECRET_INVALIDIntegritySecret must be 32 bytes. Verify shares not tampered
HMAC_FAILEDIntegrityShare data tampered. Request fresh shares from initiator
INSUFFICIENT_SHARESIntegrityXorIDA requires at least K shares. Contact other validators
RECONSTRUCTION_FAILEDIntegrityVerify shares are from same secret and indices are valid
TIMELOCK_EXPIREDExecutionSwap can no longer be completed. Initiate refund instead
TIMELOCK_ACTIVEExecutionRefunds only allowed after timelock expiry
SWAP_ALREADY_COMPLETEDExecutionCannot complete or refund a completed swap
DOUBLE_SPENDExecutionSecret already used to claim funds. Security violation
SWAP_NOT_FOUNDExecutionSwap ID incorrect or swap never initiated. Verify ID
SWAP_FAILEDExecutionCheck blockchain connection, gas/fee, balance
PROOF_INVALIDProofProof malformed or public inputs mismatch. Regenerate
VERIFIED BY XPROVE

Verifiable Swap Execution

Every swap operation in xCross produces a verifiable audit trail via xProve. HMAC-chained integrity proofs let auditors confirm that secrets were split, stored, and reconstructed correctly — without accessing the secrets themselves.

XPROVE AUDIT TRAIL
Every XorIDA split generates HMAC-SHA256 integrity tags. xProve chains these into a tamper-evident audit trail that proves secrets were handled correctly at every step. Upgrade to zero-knowledge proofs when regulators or counterparties need public verification.

Read the xProve white paper →
Section 08

Use Cases

🌉
DeFi
Cross-Chain Token Bridges
Bridge signing keys split across independent validators. Eliminates single-validator exploit vector responsible for billions in losses.
$2.5B+ Exploit Prevention
🔗
Protocol
Multi-Chain DeFi Protocols
Protocol admin keys split across chain-specific validators. No single chain compromise affects cross-chain protocol security.
Cross-Chain
🔑
Ceremony
Bridge Key Ceremony
Auditable key generation ceremonies with XorIDA split distribution. Key is split at creation and never exists in complete form again.
Key Management
🚨
Emergency
Emergency Bridge Shutdown
Emergency pause keys split across independent parties. Threshold cooperation required to pause or resume bridge operations during incidents.
Incident Response
VERIFIABLE WITHOUT CODE EXPOSURE

Ship Proofs, Not Source

xCross generates cryptographic proofs of correct execution without exposing proprietary algorithms. Verify swap integrity using zero-knowledge proofs — no source code required.

XPROVE CRYPTOGRAPHIC PROOF
Download proofs:

Verify proofs online →

Use Cases

🏛️
REGULATORY
SEC / FinCEN Submissions
Prove bridge security for regulatory filings without exposing trade secrets or IP.
Zero IP Exposure
🏦
FINANCIAL
Audit Without Access
External auditors verify secure operations without accessing source code or production systems.
FINRA / SOX Compliant
🛡️
DEFENSE
Classified Verification
Security clearance holders verify bridge correctness without clearance for source code.
CMMC / NIST Ready
🏢
ENTERPRISE
Procurement Due Diligence
Prove security + correctness during RFP evaluation without NDA or code escrow.
No NDA Required
Section 09

Honest Limitations

xCross is not a complete bridge implementation. It provides the cryptographic foundation for information-theoretically secure atomic swaps. Blockchain integration, HTLC deployment, and validator coordination are out of scope.

What xCross Does NOT Do

  • HTLC Deployment: xCross does not deploy HTLC contracts. You must integrate with chain-specific HTLC implementations.
  • Validator Selection: xCross does not choose or manage validators. You must select independent validators with geographic/jurisdictional diversity.
  • Share Transmission: xCross does not transmit shares to validators. You must encrypt and send shares via secure channels (TLS 1.3+, Xlink, Signal Protocol).
  • Timelock Enforcement: xCross does not enforce timelocks. The blockchain HTLC contract enforces timelock expiry.
  • Fee Calculation: xCross does not calculate optimal swap fees or gas costs. You must determine appropriate fees based on current network conditions.
  • Liquidity Provision: xCross does not provide liquidity pools or market makers. It is a security layer, not a liquidity protocol.

Production Considerations

Custodian Independence: Validator independence is critical. Validators must not share infrastructure, management, or ownership. Geographic diversity across jurisdictions reduces correlated failure risk.

Share Encryption: Shares MUST be encrypted during transmission. xCross provides integrity (HMAC) but not confidentiality during transit. Use TLS 1.3+ for HTTPS, Xlink for E2EE channels, or Signal Protocol for asynchronous messaging.

Timelock Selection: Timelock duration must account for worst-case blockchain confirmation times plus validator coordination overhead. Too short = refund before completion. Too long = capital inefficiency. Recommended: 24 hours for high-value swaps, 6-12 hours for routine swaps.

Testing: Test on testnets extensively before mainnet deployment. Run abuse tests (share tampering, timelock bypass, double-spend attempts) to verify security properties.

ENTERPRISE DEPLOYMENT

xCross Enterprise (Planned)

Enterprise CLI for air-gapped bridge validator operations. Not yet implemented. Planned features: automated share distribution, threshold signing ceremonies, validator health monitoring, audit trail generation.

Coming Soon
xCross Enterprise CLI is planned for Q3 2026. It will provide:
  • Air-gapped validator operations (no network required for signing)
  • Automated share distribution to N validators via encrypted channels
  • Threshold signing ceremonies with MPC coordination
  • Validator health monitoring and alerting
  • Comprehensive audit trail generation for compliance
  • Integration with enterprise HSMs (Hardware Security Modules)

Contact contact@private.me for early access.

GET STARTED

Ready to deploy xCross?

Talk to Sol, our AI sales engineer, or book a live demo with our team.

Book a Demo

Deployment Options

📦

SDK Integration

Embed directly in your application. Runs in your codebase with full programmatic control.

  • npm install @private.me/xcross
  • TypeScript/JavaScript SDK
  • Full source access
  • Enterprise support available
Get Started →
🏢

On-Premise Upon Request

Enterprise CLI for compliance, air-gap, or data residency requirements.

  • Complete data sovereignty
  • Air-gap capable deployment
  • Custom SLA + dedicated support
  • Professional services included
Request Quote →

Enterprise On-Premise Deployment

While xCross is primarily delivered as SaaS or SDK, we build dedicated on-premise infrastructure for customers with:

  • Regulatory mandates — HIPAA, SOX, FedRAMP, CMMC requiring self-hosted processing
  • Air-gapped environments — SCIF, classified networks, offline operations
  • Data residency requirements — EU GDPR, China data laws, government mandates
  • Custom integration needs — Embed in proprietary platforms, specialized workflows

Includes: Enterprise CLI, Docker/Kubernetes orchestration, RBAC, audit logging, and dedicated support.

Contact sales for assessment and pricing →