Skip to content

Architecture

SIP Protocol operates as an application layer between user applications and the NEAR Intents settlement system.

┌─────────────────────────────────────────────────────────────────┐
│ APPLICATION LAYER │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ DApps │ │ Wallets │ │ DAOs │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────────┼────────────────┘ │
│ ▼ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ @sip-protocol/sdk │ │
│ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────────────┐ │ │
│ │ │ Intent │ │ Stealth │ │ Privacy │ │ Wallet Adapters │ │ │
│ │ │ Builder │ │ Address │ │ Manager │ │ (ETH/SOL/NEAR) │ │ │
│ │ └─────────┘ └─────────┘ └─────────┘ └─────────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │ │
├──────────────────────────┼───────────────────────────────────────┤
│ PRIVACY LAYER (SIP) │
│ ┌───────────────────────┴───────────────────────────────────┐ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │
│ │ │ Pedersen │ │ Stealth │ │ Viewing Keys │ │ │
│ │ │ Commitments │ │ Addresses │ │ (Compliance) │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────────┘ │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │
│ │ │ Funding │ │ Validity │ │ Fulfillment │ │ │
│ │ │ Proof │ │ Proof │ │ Proof │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │ │
├──────────────────────────┼───────────────────────────────────────┤
│ SETTLEMENT LAYER │
│ ┌───────────────────────┴───────────────────────────────────┐ │
│ │ NEAR Intents + Chain Signatures │ │
│ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │
│ │ │ 1Click API │ │ Solvers │ │ Chain Signatures │ │ │
│ │ └──────────────┘ └──────────────┘ └──────────────────┘ │ │
│ └───────────────────────────────────────────────────────────┘ │
│ │ │
├──────────────────────────┼───────────────────────────────────────┤
│ BLOCKCHAIN LAYER │
│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │ NEAR │ │ ETH │ │ Solana │ │ Zcash │ │Bitcoin │ │
│ └────────┘ └────────┘ └────────┘ └────────┘ └────────┘ │
└─────────────────────────────────────────────────────────────────┘

The main entry point that orchestrates all operations:

const sip = new SIP({
network: 'testnet',
proofProvider: new MockProofProvider(),
})

Fluent API for constructing shielded intents:

const intent = await sip
.intent()
.input('solana', 'SOL', amount)
.output('ethereum', 'ETH')
.privacy(PrivacyLevel.SHIELDED)
.build()

Chain-specific wallet integrations:

AdapterChainProvider
EthereumWalletAdapterEthereumMetaMask, WalletConnect
SolanaWalletAdapterSolanaPhantom, Solflare
MockWalletAdapterTestingMock provider

ZK proof generation interfaces:

ProviderStatusUse Case
MockProofProviderAvailableTesting, development
NoirProofProviderPlannedProduction
User Intent → Standard intent → Solver → Settlement

No privacy features. All data visible on-chain.

User Intent
Generate stealth address (recipient privacy)
Create Pedersen commitments (amount privacy)
Generate ZK proofs (funding + validity)
Submit shielded intent
Solver fulfills (only sees commitments)
Fulfillment proof generated
Settlement to stealth address

Same as shielded, plus:

  • Encrypt transaction metadata with viewing key
  • Auditor can decrypt specific transactions
  • ViewingProof for audit reports
C = value·G + blinding·H
  • Perfectly hiding: Cannot extract value from C
  • Computationally binding: Cannot change value after commit
  • Homomorphic: C₁ + C₂ commits to sum of values

Based on EIP-5564:

  1. Recipient publishes meta-address (P, Q)
  2. Sender generates ephemeral key r
  3. Sender computes stealth address A = Q + H(r·P)·G
  4. Recipient scans for R values, derives private key

Hierarchical key derivation:

Master Viewing Key
├── Full Viewing Key (all transactions)
├── Auditor Key (time-limited)
└── Transaction Key (single transaction)

Encryption: XChaCha20-Poly1305 with HKDF key derivation.

Connects to NEAR’s 1Click API for cross-chain settlement:

const adapter = new NEARIntentsAdapter({
network: 'testnet',
endpoint: 'https://1click.chaindefuser.com',
})

Handles Zcash-specific shielded transactions:

const zcash = new ZcashShieldedService({
rpcUrl: 'http://localhost:8232',
})
FilePurpose
packages/sdk/src/sip.tsMain SIP client
packages/sdk/src/intent.tsIntentBuilder
packages/sdk/src/stealth.tsStealth addresses
packages/sdk/src/crypto.tsPedersen commitments
packages/sdk/src/privacy.tsViewing keys
packages/sdk/src/proofs/Proof providers
packages/sdk/src/adapters/Network/wallet adapters
OperationTime (avg)
Generate meta-address0.9ms
Derive stealth address5.4ms
Create commitment7.2ms
Verify commitment6.6ms
Full shielded intent~25ms

Measured on Apple M1, Node.js 20.

  • Language: TypeScript (strict)
  • Monorepo: pnpm + Turborepo
  • Crypto: @noble/curves, @noble/hashes, @noble/ciphers
  • Testing: Vitest
  • CI/CD: GitHub Actions