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:
| Offset | Field | Size |
|---|---|---|
| 139 | status | 1 |
| 140 | signature_len | 2 |
| 142 | signature | up to 128 |
Status values:
0= Pending (awaiting signature)1= Signed (signature available)
What Happens Under the Hood
- Your program calls
approve_messagevia CPI -> creates aMessageApprovalPDA (status = Pending) - The Ika network detects the
MessageApprovalaccount - The NOA (Network Operated Authority) signs the message using 2PC-MPC
- The NOA calls
CommitSignatureto write the signature on-chain (status = Signed) - Anyone can read the signature from the
MessageApprovalaccount
In test mode with the mock signer, step 3 uses a single Ed25519 keypair instead of real MPC.
Pre-Alpha Environment
| Resource | Endpoint |
|---|---|
| dWallet gRPC | https://pre-alpha-dev-1.ika.ika-network.net:443 |
| Solana Network | Devnet (https://api.devnet.solana.com) |
| Program ID | TODO: will be updated after deployment |