Single-Slot Sealed Settlement
How Mera combines Alpenglow 150ms finality with atomic shielded settlement, the vault solvency invariant, and two-sided confidentiality.
Mera settles every swap, hidden-size limit order fill, and sealed RFQ block trade in a single Solana v0 transaction inside one 150ms slot. Both counterparties start from encrypted balances in the same Ring, nullify their spent input notes, receive encrypted output notes, and record a cryptographic settlement hash atomically.
Why 150ms finality matters for dark execution
Under Solana's legacy 12.8 second finality, a maker quoting a sealed block had to widen spreads to cover multi-slot price drift while waiting for confirmation. Anza's Alpenglow consensus upgrade reduced target finality to 150ms. At that latency, a maker can sign a sealed quote or match a private escrow and clear atomically in one slot without optimistic-UI rollback risk or an off-chain sequencer.
Two-sided confidentiality compared
| Venue model | Maker quoting logic | Maker inventory | Taker wallet & size | Post-trade balance | Settlement layer |
|---|---|---|---|---|---|
| Public Solana DEX / Aggregator | Public | Public | Public | Public | Solana L1 |
| One-sided Proprietary AMM | Private | Private | Public | Public | Solana L1 |
| Mera | Private | Private (shielded notes) | Private (encrypted commitments) | Private (encrypted commitments) | Solana L1 (150ms slot) |
One-sided proprietary AMMs shield the market maker's quoting curve while leaving every taker's wallet, fill size, and post-trade balance visible on the public ledger. Mera uses Solana Privacy Rings primitives so both makers and takers clear from encrypted UTXO balances natively on Solana L1.
What happens in one settlement transaction
A single v0 transaction compiled over Mera's Address Lookup Table executes the following steps atomically in mera_core:
- Access and state check. The instruction confirms
ProtocolConfig.paused == falseandRingConfig.frozen == false, and checks that the inputCommitmentNoteaccounts belong to the Ring, match the expected mints, are unspent (spent == false), and hold sufficient balance. - Double-spend prevention. The instruction marks the input notes spent and initializes one
NullifierRecordPDA (["nullifier", ring, nullifier]) per spent input. Because Solana rejects duplicate account initialization, a spent note can never be reused. - Protocol fee transfer.
mera_corecomputesfee_paid = floor(gross_amount * fee_bps / 10_000)and executestoken_interface::transfer_checkedfrom the Ring'sShieldedVaulttoken account toProtocolConfig.fee_recipient's ATA, decrementingtotal_shieldedand incrementingtotal_fees_collected. - Output commitment creation. The instruction initializes encrypted output
CommitmentNotePDAs (["note", ring, commitment]) for both the taker and the maker, and updatesRingConfig.commitment_roottoSHA-256(old_root || out_commitment_a || out_commitment_b). - Settlement record and event. The instruction initializes an
RfqSettlementRecordPDA (["settlement", ring, settlement_id_hash]) containing thecommitment_hash,nullifier_hash,tvk_hint,fee_paid, andsettled_slot, then emits aSettlementClearedCPI event (emit_cpi!).
The vault solvency invariant
For every Ring and mint, mera_core enforces a strict balance invariant across the ShieldedVault PDA and its SPL/Token-2022 token account:
vault_token_account.amount == sum(unspent CommitmentNote amounts) + sum(open PrivateEscrowOrder locked amounts)Every deposit_shielded transfers tokens in and increases total_shielded by the exact same amount. Every withdraw_shielded burns a nullifier and transfers tokens out while decreasing total_shielded. Every settlement moves ownership between encrypted notes inside the same Ring vaults and transfers only fee_paid out to the fee recipient, reducing total_shielded by fee_paid. Every place_hidden_order locks an input note inside PrivateEscrowOrder, which either settles atomically via fill_hidden_order or returns in full via cancel_hidden_order.
Transaction assembly and co-signing
For two-sided executions (settle_confidential_swap and settle_sealed_rfq), the taker's wallet signs first as fee payer and taker signer. The matching relay receives the taker-signed v0 transaction at POST /v1/transactions/submit, attaches the maker's co-signature, and relays the completed transaction to Solana. This ordering respects Wallet Standard security requirements so wallets never reject pre-signed transactions.
Planned settlement upgrades
On Mera's roadmap, Build 1 adds parallel multi-maker sealed RFQ fan-out with Rotor and location-aware leader dispatch, and Build 2 switches mera_core's commitment and solvency verifier path to CPI into Helius Solana Privacy Rings' mainnet verifier program.