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

Request Types

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.

DWalletRequest Enum

All operations are encoded as variants of the DWalletRequest enum, BCS-serialized inside SignedRequestData.request.

#![allow(unused)]
fn main() {
pub enum DWalletRequest {
    DKG { ... },                            // Supported in mock
    DKGWithPublicShare { ... },             // Supported in mock
    Sign { ... },                           // Supported in mock
    ImportedKeySign { ... },                // Supported in mock (same as Sign)
    Presign { ... },                        // Supported in mock
    PresignForDWallet { ... },              // Supported in mock
    ImportedKeyVerification { ... },        // Not yet implemented
    ReEncryptShare { ... },                 // Not yet implemented
    MakeSharePublic { ... },                // Not yet implemented
    FutureSign { ... },                     // Not yet implemented
    SignWithPartialUserSig { ... },         // Not yet implemented
    ImportedKeySignWithPartialUserSig { ... }, // Not yet implemented
}
}

Mock Support

RequestMock StatusNotes
DKGSupportedSecp256k1 and Curve25519 (Ed25519). Auto-commits dWallet on-chain and transfers authority to intended_chain_sender.
DKGWithPublicShareSupportedSame as DKG in mock.
SignSupportedSigns with Ed25519 or Secp256k1 key (based on DKG curve). signature_algorithm and hash_scheme are accepted but ignored by mock.
ImportedKeySignSupportedSame as Sign in mock.
PresignSupportedReturns random presign data.
PresignForDWalletSupportedSame as Presign in mock.
ImportedKeyVerificationNot implementedReturns error.
ReEncryptShareNot implementedReturns error.
MakeSharePublicNot implementedReturns error.
FutureSignNot implementedReturns error.
SignWithPartialUserSigNot implementedReturns error.
ImportedKeySignWithPartialUserSigNot implementedReturns error.

Supported Curves

CurveDKGSignNotes
Secp256k1YesYesBitcoin, Ethereum
Secp256r1NoNoComing soon
Curve25519YesYesSolana, Sui (Ed25519)
RistrettoNoNoComing soon

DKG

Create a new dWallet via Distributed Key Generation.

#![allow(unused)]
fn main() {
DWalletRequest::DKG {
    dwallet_network_encryption_public_key: Vec<u8>,
    curve: DWalletCurve,
    centralized_public_key_share_and_proof: Vec<u8>,
    encrypted_centralized_secret_share_and_proof: Vec<u8>,
    encryption_key: Vec<u8>,
    user_public_output: Vec<u8>,
    signer_public_key: Vec<u8>,
}
}
FieldDescription
dwallet_network_encryption_public_keyNetwork encryption key (from on-chain NEK account)
curveTarget curve (Secp256k1, Secp256r1, Curve25519, Ristretto)
centralized_public_key_share_and_proofUser’s public key share + ZK proof
encrypted_centralized_secret_share_and_proofEncrypted user secret share
encryption_keyEncryption key for the secret share
user_public_outputUser’s DKG public output
signer_public_keyUser’s signer key

Response: TransactionResponseData::Attestation with the DKG output and NOA attestation.

DKGWithPublicShare

Alternative DKG variant where the user provides a public share instead of an encrypted secret.

#![allow(unused)]
fn main() {
DWalletRequest::DKGWithPublicShare {
    dwallet_network_encryption_public_key: Vec<u8>,
    curve: DWalletCurve,
    centralized_public_key_share_and_proof: Vec<u8>,
    public_user_secret_key_share: Vec<u8>,
    signer_public_key: Vec<u8>,
}
}

Sign

Sign a message using an existing dWallet.

#![allow(unused)]
fn main() {
DWalletRequest::Sign {
    message: Vec<u8>,
    curve: DWalletCurve,
    signature_algorithm: DWalletSignatureAlgorithm,
    hash_scheme: DWalletHashScheme,
    presign_id: Vec<u8>,
    message_centralized_signature: Vec<u8>,
    approval_proof: ApprovalProof,
}
}
FieldDescription
messageRaw message bytes to sign
curvedWallet curve
signature_algorithmDWalletSignatureAlgorithm enum (see below)
hash_schemeDWalletHashScheme enum (see below)
presign_idID of a previously allocated presign
message_centralized_signatureUser’s partial signature
approval_proofOn-chain proof of message approval

Response: TransactionResponseData::Signature with the completed signature.

ApprovalProof

The approval proof ties the gRPC signing request to an on-chain MessageApproval:

#![allow(unused)]
fn main() {
pub enum ApprovalProof {
    Solana {
        transaction_signature: Vec<u8>, // Solana tx signature
        slot: u64,                       // Slot of the transaction
    },
    Sui {
        effects_certificate: Vec<u8>,    // Sui effects certificate
    },
}
}

Presign

Allocate a global presign (usable with any dWallet).

#![allow(unused)]
fn main() {
DWalletRequest::Presign {
    curve: DWalletCurve,
    signature_algorithm: DWalletSignatureAlgorithm,
}
}

Response: TransactionResponseData::Presign with presign ID and data.

PresignForDWallet

Allocate a presign bound to a specific dWallet.

#![allow(unused)]
fn main() {
DWalletRequest::PresignForDWallet {
    dwallet_id: Vec<u8>,
    curve: DWalletCurve,
    signature_algorithm: DWalletSignatureAlgorithm,
}
}

Cryptographic Parameter Enums

DWalletCurve

VariantDescription
Secp256k1Bitcoin, Ethereum
Secp256r1WebAuthn, secure enclaves
Curve25519Solana, Sui, Ed25519
RistrettoSubstrate, Polkadot

DWalletSignatureAlgorithm

VariantIndexUse For
ECDSASecp256k10Secp256k1 (Ethereum, Bitcoin)
ECDSASecp256r11Secp256r1 (WebAuthn)
Taproot2Secp256k1 (Bitcoin Taproot)
EdDSA3Curve25519 (Solana, Sui)
SchnorrkelSubstrate4Ristretto (Substrate, Polkadot)

DWalletHashScheme

VariantIndexUse For
Keccak2560Ethereum, general purpose
SHA2561Bitcoin, general purpose
DoubleSHA2562Bitcoin transaction signing
SHA5123Ed25519 signing
Merlin4Schnorrkel/Substrate

ChainId

VariantDescription
SolanaSolana blockchain
SuiSui blockchain

SignatureScheme

VariantValueKey Size
Ed25519032 bytes
Secp256k1133 bytes
Secp256r1233 bytes