Mera
ExecutionInstant confidential swapsClear from encrypted balances in one 150ms slot.Hidden-size limit ordersLock encrypted size in a private escrow PDA.Sealed RFQ block tradesRequest signed quotes without leaking size.
Vault & AuditShielded vault & keysDeposit SOL, SPL, or Token-2022 into a Ring.Viewing key verifierDecrypt and prove a single settled fill.
Docs/Getting Started
2 min read

Quickstart

Connect a wallet, shield assets into a Ring, settle your first confidential swap, and verify the Transaction Viewing Key receipt.

This guide takes you from an unshielded Solana wallet to a settled confidential swap and a verified Transaction Viewing Key (TVK) receipt, both in the web terminal and with @mera/sdk.

Web terminal flow

  1. Open Vault and connect a Solana wallet.
  2. Confirm the active Ring in the selector (Default Ring is open to any wallet without allowlisting).
  3. Select SOL or USDC, enter an amount, and press Shield Assets. Approve the unsigned v0 transaction in your wallet. The transfer moves tokens into the Ring's ShieldedVault PDA and creates an encrypted CommitmentNote.
  4. Open Terminal, select the Swap tab, and choose a pair such as SOL / USDC.
  5. Enter an input amount from your shielded balance. Mera requests a sealed quote with a 25-second expiry countdown and displays the execution price, 0.10% execution fee, and minimum output.
  6. Press Execute Swap and sign the transaction. The swap clears atomically in a single slot, updates your shielded balances, and adds the fill to the recent fills table with a Copy TVK action.
  7. Click Copy TVK, open Receipts, paste the key, and press Verify Receipt. The verifier recomputes the SHA-256 settlement commitment hash, checks the on-chain RfqSettlementRecord PDA, and displays the exact pair, input amount, output amount, execution price, fee, slot, and transaction signature.

TypeScript SDK flow

Install @mera/sdk alongside @solana/web3.js in a Node.js or TypeScript project, then create a client with createMeraClient and a keypairSigner (or any Wallet Standard signer implementing MeraSigner).

ts
import { Keypair } from '@solana/web3.js'
import { createMeraClient, keypairSigner } from '@mera/sdk'

const signer = keypairSigner(Keypair.generate())

const mera = createMeraClient({
  apiUrl: 'http://127.0.0.1:36102',
  signer,
})

// 1. Inspect available rings, mints, and pairs
const { items: mints } = await mera.getMints()
const solMint = mints.find((m) => m.symbol === 'SOL')!

// 2. Shield 1 SOL (1_000_000_000 lamports) into the Default Ring
const deposit = await mera.shieldDeposit({
  ringId: 'ring-default',
  mint: solMint.mint,
  amount: '1000000000',
})
console.log('Shielded tx:', deposit.signature, 'slot:', deposit.slot)

// 3. Quote and settle an Instant Confidential Swap (sell 0.5 SOL for USDC)
const { quote, submission } = await mera.executeSwap({
  ringId: 'ring-default',
  pairId: 'SOL-USDC',
  side: 'sell',
  inputAmount: '500000000',
  slippageBps: 50,
})
console.log('Settled in:', submission.finalityMs, 'ms')
console.log('TVK receipt:', submission.tvk)

// 4. Verify the TVK receipt without wallet access
if (submission.tvk) {
  const receipt = await mera.verifyTvk(submission.tvk)
  console.log('Verified:', receipt.verified, 'On-chain match:', receipt.onchainMatched)
  console.log('Execution price:', receipt.executionPrice, 'Fee:', receipt.feeAmount)
}

What each call returns

CallKey returned fields
shieldDepositid, status (confirmed), signature, slot, finalityMs
executeSwapquote (quoteId, outputAmount, minOutputAmount, feeAmount, expiresAt) and submission (signature, slot, finalityMs, settlementId, tvk)
verifyTvkverified, onchainMatched, pairId, inputAmount, outputAmount, executionPrice, feeAmount, feeRecipient, commitmentHash, nullifierHash, slot, signature

Next steps