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

Quick Start

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.

Build your first dWallet-controlled program in 5 minutes.

1. Create a Solana Program

[package]
name = "my-dwallet-program"
version = "0.1.0"
edition = "2024"

[dependencies]
ika-dwallet-pinocchio = { git = "https://github.com/dwallet-labs/ika-pre-alpha" }
pinocchio = "0.10"
pinocchio-system = "0.5"

[lib]
crate-type = ["cdylib", "lib"]

2. Set Up the CPI Context

#![allow(unused)]
#![no_std]
fn main() {
extern crate alloc;

use pinocchio::{entrypoint, AccountView, Address, ProgramResult};
use ika_dwallet_pinocchio::DWalletContext;

entrypoint!(process_instruction);
pinocchio::nostd_panic_handler!();

pub const ID: Address = Address::new_from_array([5u8; 32]);
}

The DWalletContext provides CPI methods for interacting with the dWallet program:

#![allow(unused)]
fn main() {
let ctx = DWalletContext {
    dwallet_program,
    cpi_authority,
    caller_program,
    cpi_authority_bump,
};
}

3. Approve a Message

When your program’s conditions are met, call approve_message via CPI:

#![allow(unused)]
fn main() {
ctx.approve_message(
    message_approval,   // writable PDA to create
    dwallet,            // the dWallet account
    payer,              // rent payer
    system_program,     // system program
    message_hash,       // 32-byte hash of the message to sign
    user_pubkey,        // 32-byte user public key
    signature_scheme,   // 0=Ed25519, 1=Secp256k1, 2=Secp256r1
    bump,               // MessageApproval PDA bump
)?;
}

This creates a MessageApproval PDA on-chain. The Ika network detects it and produces a signature.

4. Transfer dWallet Authority

Before your program can approve messages, the dWallet’s authority must point to your program’s CPI authority PDA:

#![allow(unused)]
fn main() {
// Derive the CPI authority PDA
// Seeds: [b"__ika_cpi_authority"], program_id = YOUR_PROGRAM_ID
let (cpi_authority, _bump) = Address::find_program_address(
    &[b"__ika_cpi_authority"],
    &your_program_id,
);

// Transfer ownership (called by current authority, typically the dWallet creator)
ctx.transfer_dwallet(dwallet, cpi_authority.as_array())?;
}

5. Read the Signature

After the network signs, the MessageApproval account contains the signature:

OffsetFieldSize
139status1
140signature_len2
142signatureup to 128

Status values:

  • 0 = Pending (awaiting signature)
  • 1 = Signed (signature available)

What Happens Under the Hood

  1. Your program calls approve_message via CPI -> creates a MessageApproval PDA (status = Pending)
  2. The Ika network detects the MessageApproval account
  3. The NOA (Network Operated Authority) signs the message using 2PC-MPC
  4. The NOA calls CommitSignature to write the signature on-chain (status = Signed)
  5. Anyone can read the signature from the MessageApproval account

In test mode with the mock signer, step 3 uses a single Ed25519 keypair instead of real MPC.

Pre-Alpha Environment

ResourceEndpoint
dWallet gRPChttps://pre-alpha-dev-1.ika.ika-network.net:443
Solana NetworkDevnet (https://api.devnet.solana.com)
Program IDTODO: will be updated after deployment