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

Response 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.

TransactionResponseData

The SubmitTransaction RPC returns a TransactionResponse containing BCS-serialized TransactionResponseData:

#![allow(unused)]
fn main() {
pub enum TransactionResponseData {
    Signature { signature: Vec<u8> },
    Attestation {
        attestation_data: Vec<u8>,
        network_signature: Vec<u8>,
        network_pubkey: Vec<u8>,
        epoch: u64,
    },
    Presign {
        presign_id: Vec<u8>,
        presign_data: Vec<u8>,
        epoch: u64,
    },
    Error { message: String },
}
}

Response Variants

Signature

Returned for Sign and ImportedKeySign requests.

#![allow(unused)]
fn main() {
TransactionResponseData::Signature {
    signature: Vec<u8>,  // The completed signature bytes
}
}
FieldTypeDescription
signatureVec<u8>The completed digital signature

The signature is always 64 bytes:

  • ECDSASecp256k1 / ECDSASecp256r1: 64 bytes (r || s)
  • Taproot: 64 bytes (Schnorr signature)
  • EdDSA: 64 bytes (Ed25519 signature)
  • SchnorrkelSubstrate: 64 bytes

Attestation

Returned for DKG and DKGWithPublicShare requests.

#![allow(unused)]
fn main() {
TransactionResponseData::Attestation {
    attestation_data: Vec<u8>,     // DKG output data
    network_signature: Vec<u8>,    // NOA signature over the attestation
    network_pubkey: Vec<u8>,       // NOA public key
    epoch: u64,                     // Epoch of the attestation
}
}
FieldTypeDescription
attestation_dataVec<u8>The DKG output (public key, proofs, etc.)
network_signatureVec<u8>NOA’s signature attesting to the output
network_pubkeyVec<u8>NOA’s public key for verification
epochu64Ika epoch when the attestation was produced

The attestation_data + network_signature are passed to the CommitDWallet on-chain instruction to create the dWallet account.

Presign

Returned for Presign and PresignForDWallet requests.

#![allow(unused)]
fn main() {
TransactionResponseData::Presign {
    presign_id: Vec<u8>,     // Unique presign identifier
    presign_data: Vec<u8>,   // Precomputed signing data
    epoch: u64,               // Epoch of the presign
}
}
FieldTypeDescription
presign_idVec<u8>Unique identifier for this presign
presign_dataVec<u8>Precomputed data used during signing
epochu64Ika epoch when the presign was created

Store the presign_id – you will pass it to Sign requests later.

Error

Returned when the operation fails.

#![allow(unused)]
fn main() {
TransactionResponseData::Error {
    message: String,  // Human-readable error description
}
}

Always check for the Error variant before processing the response.

Deserialization Example

#![allow(unused)]
fn main() {
use ika_dwallet_types::TransactionResponseData;

let response = client.submit_transaction(request).await?;
let result: TransactionResponseData = bcs::from_bytes(&response.into_inner().response_data)?;

match result {
    TransactionResponseData::Signature { signature } => {
        println!("Got signature: {} bytes", signature.len());
    }
    TransactionResponseData::Attestation { attestation_data, network_signature, .. } => {
        println!("DKG complete, attestation: {} bytes", attestation_data.len());
        // Submit CommitDWallet on-chain with attestation_data + network_signature
    }
    TransactionResponseData::Presign { presign_id, .. } => {
        println!("Presign allocated: {}", hex::encode(&presign_id));
    }
    TransactionResponseData::Error { message } => {
        eprintln!("Error: {message}");
    }
}
}

PresignInfo (Query Response)

Returned by GetPresigns and GetPresignsForDWallet:

#![allow(unused)]
fn main() {
// Proto message
message PresignInfo {
  bytes presign_id = 1;
  bytes dwallet_id = 2;
  uint32 curve = 3;
  uint32 signature_scheme = 4;
  uint64 epoch = 5;
}
}
FieldTypeDescription
presign_idbytesUnique presign identifier
dwallet_idbytesAssociated dWallet (empty for global presigns)
curveu32Curve identifier
signature_schemeu32Signature scheme identifier
epochu64Epoch when allocated