Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E2E Demo

Pre-Alpha Disclaimer: This is an early pre-alpha release for exploring the SDK and starting development only. There is no real MPC signing — all signatures are generated by a single mock signer, not a distributed network. Do not submit any real transactions for signing or rely on any security guarantees. The dWallet keys, trust model, and signing protocol are not final; do not rely on any key material until mainnet. All interfaces, APIs, and data formats are subject to change without notice. The Solana program and all on-chain data will be wiped periodically and everything will be deleted when we transition to Ika Alpha 1. This software is provided “as is” without warranty of any kind; use is entirely at your own risk and dWallet Labs assumes no liability for any damages arising from its use.

Prerequisites

  • Rust toolchain with cargo build-sbf
  • Bun (for TypeScript e2e)
  • Program deployed to Solana devnet

Pre-Alpha Environment

ResourceEndpoint
dWallet gRPChttps://pre-alpha-dev-1.ika.ika-network.net:443
Solana RPChttps://api.devnet.solana.com

Quick Start

Deploy your voting program to devnet, then run:

# TypeScript
just e2e-voting <DWALLET_ID> <VOTING_ID>

# Rust
just e2e-voting-rust <DWALLET_ID> <VOTING_ID>

Available Demos

CommandLanguageFile
just e2e-votingTypeScript (bun)examples/voting/e2e/main.ts
just e2e-voting-rustRustexamples/voting/e2e-rust/src/main.rs

Both demos produce identical results — the TypeScript version uses shared helpers from _shared/.

What the Demo Does

Step 1: gRPC DKG           → Creates dWallet, mock commits on-chain
Step 2: Transfer authority  → Voting program CPI PDA owns the dWallet
Step 3: Create proposal     → quorum=3, message="Transfer 100 USDC to treasury"
Step 4: Cast 3 YES votes    → Last vote triggers approve_message CPI
Step 5: Verify approval     → MessageApproval PDA exists on-chain
Step 6: gRPC presign        → Allocate presign for signing
Step 7: gRPC sign           → 64-byte Ed25519 signature returned

Expected Output

═══ dWallet Voting E2E Demo (TypeScript) ═══

[Setup] Funding payer...
  ✓ Payer: ...
[Setup] Waiting for mock + creating dWallet via gRPC...
  ✓ DWalletCoordinator: ...
  ✓ dWallet on-chain: ...
  ✓ Authority transferred to CPI PDA: ...

[1/5] Creating voting proposal (quorum=3)...
  ✓ Proposal: ...
[2/5] Vote 1/3: Alice casts YES...
  ✓ Alice voted YES
[2/5] Vote 2/3: Bob casts YES...
  ✓ Bob voted YES
[2/5] Vote 3/3: Charlie casts YES...
  ✓ Charlie voted YES
  ✓ Proposal approved (3/3 yes)
[3/5] Verifying MessageApproval on-chain...
  ✓ MessageApproval: ...
[4/5] Allocating presign via gRPC...
  ✓ Presign allocated!
[5/5] Sending Sign request via gRPC...
  ✓ Signature received from gRPC!
  → Signature: <64-byte hex>

═══ E2E Test Passed! ═══

How the Shared Helpers Work

The TypeScript e2e imports from _shared/:

import { setupDWallet, requestPresign, requestSign } from "../../_shared/ika-setup.ts";
import { log, ok, val, sendTx, pda, pollUntil } from "../../_shared/helpers.ts";

setupDWallet() handles the entire dWallet lifecycle:

  1. Waits for program initialization (polls for DWalletCoordinator PDA)
  2. Sends gRPC DKG request (creates dWallet on-chain + transfers authority)
  3. Polls for dWallet PDA to appear
  4. Transfers authority to the example program’s CPI PDA

This means the e2e test code only needs to focus on the voting-specific logic.