PROTOCOL DOCS
Three protocols, one story — Bridgeless Encrypted Capital Markets on Solana
PROGRAM: 833YAgrbapXntBN8Nrvx
ORDER LIFECYCLE
SUBMIT ORDER
FHE encrypt
EXECUTE MATCH
match_orders(EUint64)
SETTLE MATCH
set Settled status
SIGN SETTLEMENT
Ika CPI → approve_message
dWALLET SIGNS
2PC-MPC Ed25519
LIFI BRIDGE
cross-chain delivery
01
ENCRYPT FHE SDK
Homomorphic order matching

Orders are encrypted client-side using FHE ciphertexts. The matching engine runs match_orders entirely on encrypted data — the program never sees plaintext prices or sizes. Only the final execution result (fill amounts, exec price) is revealed at settlement.

INTEGRATION DETAILS
Instructionsubmit_order, execute_match
DSL macro#[encrypt_fn] match_orders(bid, ask) → (fill, exec_price)
Key typesEUint64 ciphertexts for all numeric fields
CPI seedb"__encrypt_cpi_authority"
Program4ebfzWdKnrnGseuQpezXdG8yCdHqwQ1SSBHD3bWArND8 (devnet)
02
IKA dWALLET — 2PC-MPC
Distributed settlement signing

Settlement authorization requires a distributed Ed25519 signature produced by the Ika network via 2PC-MPC. No single party holds the private key. The Noctex program CPI-calls the Ika program to create a MessageApproval PDA; the off-chain Ika network then produces the signature, committing it on-chain.

INTEGRATION DETAILS
DKGgRPC DKG via ika-pre-alpha — produces dWallet PDA + Ed25519 pubkey
CPI callsign_settlement → invoke approve_message on Ika program
MessageApproval86ckVnh4twmLruwH42YSwNrehNWZd6VdGfNBUnsXGbsJ (status=Signed)
Signaturef231157b…700b (64-byte Ed25519 on-chain)
dWallet PDA3om31VWzJx6oPt37qYcUSZFosfFGZgeegX7VjQBi7aRG
Hash schemekeccak256 (both client TS + Rust bootstrap must match)
03
LI.FI SDK
Cross-chain token delivery

After a settlement is authorized by the dWallet signature, LI.FI routes the settled tokens cross-chain. A single settlement signature on Solana unlocks delivery to any supported EVM chain. The SDK is used to get bridge quotes and execute cross-chain transfers after settlement.

INTEGRATION DETAILS
SDK@lifi/sdk — getQuote, executeRoute
Widget@lifi/widget — embeddable swap/bridge UI
Flowsettle_match → MessageApproval signed → LI.FI bridge route
ChainsSolana → Ethereum / Arbitrum / Base / Optimism
IntegrationSettlementRoute component in Trade page
KEY INTEGRATION CODE
FHE match_orders (programs/noctex/src/fhe.rs)rust
#[encrypt_fn]
pub fn match_orders(
    bid_price: EUint64,
    ask_price: EUint64,
    bid_amount: EUint64,
    ask_amount: EUint64,
) -> (EUint64, EUint64, EUint64) {
    let matched = bid_price.is_greater_or_equal(&ask_price);
    let min_amount = bid_amount.min(&ask_amount);
    let fill = if matched { min_amount } else { EUint64::from(0u64) };
    let exec  = if matched { ask_price  } else { EUint64::from(0u64) };
    (fill, fill, exec)
}
Ika CPI approve_message (programs/noctex/src/dwallet.rs)rust
pub fn invoke_approve_message(ctx: &Context<SignSettlement>, ...) {
    let data = approve_message_data(bump, msg_digest, meta_digest, user, scheme);
    let accounts = vec![
        ctx.accounts.dwallet.to_account_metas(None),
        ctx.accounts.message_approval.to_account_metas(None),
        ctx.accounts.cpi_authority.to_account_metas(None),
        ctx.accounts.coordinator.to_account_metas(None),
        ctx.accounts.payer.to_account_metas(None),
        ctx.accounts.system_program.to_account_metas(None),
        ctx.accounts.caller_program.to_account_metas(None),
    ];
    invoke_signed(&ix, &account_infos, &[CPI_AUTHORITY_SEED]);
}
LI.FI route after settlement (client/src/lifi-settle.ts)typescript
import { createConfig, getQuote, executeRoute } from "@lifi/sdk";

createConfig({ integrator: "noctex" });

export async function bridgeSettlement(
  fromChain: "SOL",
  toChain: number,  // Arbitrum=42161, Base=8453
  amount: string,
  fromToken: string,
  toToken: string,
) {
  const quote = await getQuote({
    fromChain, toChain,
    fromToken, toToken,
    fromAmount: amount,
    fromAddress: walletPubkey,
  });
  return executeRoute(quote.routes[0]);
}