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

Account Reference

Pre-Alpha Disclaimer: This is a pre-alpha release for development and testing only. Signing uses a single mock signer, not real distributed MPC. All 11 protocol operations are implemented (DKG, Sign, Presign, FutureSign, ReEncryptShare, etc.) across all 4 curves and 7 signature schemes, but without real MPC 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.

All account types in the Ika dWallet system. Each account starts with a 2-byte prefix: discriminator(1) | version(1), followed by the account data.

dWallet Program Accounts

Account Discriminators

DiscriminatorAccount Type
1DWalletCoordinator
2DWallet
3NetworkEncryptionKey
4GasDeposit
9PartialUserSignature
11EncryptedUserSecretKeyShare
14MessageApproval
15DWalletAttestation

DWalletCoordinator (disc 1)

Program-wide state. PDA seeds: ["dwallet_coordinator"].

OffsetFieldSizeDescription
0discriminator11
1version11
2authority32Admin authority pubkey (NOA or multisig)
34epoch8Current epoch number (LE u64)
42total_dwallets_created8Total dWallets created (LE u64)
50paused1Whether program is paused (0=no, 1=yes)
51bump1PDA bump seed
52_reserved64Reserved for future use

Total: 116 bytes (2 + 114)


NetworkEncryptionKey (disc 3)

The network encryption public key used for DKG. PDA seeds: ["network_encryption_key", noa_pubkey].

OffsetFieldSizeDescription
0discriminator13
1version11
2(fields)162NEK data

Total: 164 bytes


DWallet (disc 2)

A distributed signing key. PDA seeds: ["dwallet", chunks_of(curve_u16_le || public_key)] – the curve u16 LE (2 bytes) is concatenated with the raw public key into a single buffer, then split into 32-byte pieces (Solana’s MAX_SEED_LEN) and each chunk is passed as its own seed.

pubkey lengthpayload sizechunks
32 bytes (Ed25519 / Curve25519 / Ristretto)34 bytes[32, 2]
33 bytes (compressed Secp256k1 / Secp256r1)35 bytes[32, 3]
65 bytes (uncompressed SEC1)67 bytes[32, 32, 3]
OffsetFieldSizeDescription
0discriminator12
1version11
2authority32Who can approve messages (user or CPI PDA)
34curve2Curve type (u16 LE): 0=Secp256k1, 1=Secp256r1, 2=Curve25519, 3=Ristretto
36state10=DKGInProgress, 1=Active, 2=Frozen
37public_key_len1Actual key length (32 or 33)
38public_key65dWallet public key (padded)
103created_epoch8Epoch when created (LE u64)
111noa_public_key32NOA Ed25519 public key used during DKG
143is_imported1Whether the key was imported (0=standard, 1=imported)
144bump1PDA bump seed
145_reserved8Reserved for future use

Total: 153 bytes (2 + 151)


DWalletAttestation (disc 15)

Variable-size PDA storing BCS-serialized versioned attestation data + NOA Ed25519 signature. One per type per dWallet. Created by commit instructions (CommitDWallet, CommitFutureSign, CommitEncryptedUserSecretKeyShare, CommitPublicUserSecretKeyShare).

OffsetFieldSizeDescription
0discriminator115
1version11
2noa_signature64NOA Ed25519 signature over the attestation data
66bump1PDA bump seed
67attestation_datavariableBCS-serialized versioned attestation struct

Header: 67 bytes. Total: 67 + len(attestation_data).

PDA seed patterns by type:

TypeSeeds
DKG["dwallet", chunks..., "attestation"]
MakePublic["dwallet", chunks..., "public_user_share"]
EncryptedShare (ReEncrypt)["dwallet", chunks..., "encrypted_user_share", &enc_key, "attestation"]
FutureSign["dwallet", chunks..., "partial_user_sig", &scheme_u16_le, &msg_digest, [&meta_digest], "attestation"]

GasDeposit (disc 4)

Per-user gas deposit. PDA seeds: ["gas_deposit", user_pubkey].

OffsetFieldSizeDescription
0discriminator14
1version11
2user_pubkey32Ed25519 public key for gRPC auth
34ika_balance8Available IKA balance (LE u64)
42sol_balance8Available SOL balance in lamports (LE u64)
50total_ika_deposited8Lifetime IKA deposited
58total_ika_consumed8Lifetime IKA consumed
66total_sol_deposited8Lifetime SOL deposited
74total_sol_consumed8Lifetime SOL consumed
82pending_ika_withdrawal8Pending IKA withdrawal amount
90pending_sol_withdrawal8Pending SOL withdrawal amount
98withdrawal_epoch8Epoch when withdrawal becomes available (0=none)
106last_settlement_epoch8Epoch of last gas settlement
114created_at_epoch8Epoch when created
122bump1PDA bump seed
123_reserved16Reserved

Total: 139 bytes (2 + 137)


MessageApproval (disc 14)

A signing request. PDA seeds: ["dwallet", chunks..., "message_approval", &scheme_u16_le, &message_digest, [&message_metadata_digest]].

The message_metadata_digest seed is only included when non-zero.

OffsetFieldSizeDescription
0discriminator114
1version11
2dwallet32dWallet account pubkey
34message_digest32Keccak-256 digest of message to sign
66message_metadata_digest32Keccak-256 digest of metadata (zero if none)
98approver32dWallet authority who authorized signing
130user_pubkey32User public key authorized for gRPC Sign
162signature_scheme2DWalletSignatureScheme (u16 LE, values 0-6)
164epoch8Epoch when approved (LE u64)
172status1Pending(0) or Signed(1)
173signature_len2Signature byte count (LE u16)
175signature128Signature bytes (padded)
303bump1PDA bump seed
304_reserved8Reserved

Total: 312 bytes (2 + 310)

Status values:

  • 0 = PENDING – awaiting signature from the network
  • 1 = SIGNED – signature is available

PartialUserSignature (disc 9)

Partial user signature for the FutureSign flow. PDA seeds: ["dwallet", chunks..., "partial_user_sig", &scheme_u16_le, &message_digest, [&message_metadata_digest]].

The message_metadata_digest seed is only included when non-zero.

OffsetFieldSizeDescription
0discriminator19
1version11
2dwallet32dWallet account pubkey
34completion_authority32Authority that can complete the signature
66message_digest32Keccak-256 digest of message
98message_metadata_digest32Keccak-256 digest of metadata (zero if none)
130signature_scheme2DWalletSignatureScheme (u16 LE)
132partial_signature_len2Length of partial signature data (LE u16)
134partial_signature256Partial signature from user
390presign_id32Presign ID used
422created_epoch8Epoch when created (LE u64)
430status1Pending(0) or Signed(1)
431signature_len2Final MPC signature length (LE u16)
433signature128Final MPC signature (written by NOA)
561bump1PDA bump seed
562_reserved8Reserved

Total: 570 bytes (2 + 568)


EncryptedUserSecretKeyShare (disc 11)

Metadata for an encrypted user secret key share. PDA seeds: ["dwallet", chunks..., "encrypted_user_share", &encryption_key].

Attestation data is stored in a separate DWalletAttestation PDA rooted under this share’s seed hierarchy.

OffsetFieldSizeDescription
0discriminator111
1version11
2dwallet32dWallet account pubkey
34encryption_key32Encryption key pubkey
66encryption_key_owner32Address of encryption key owner
98source_share32Source share pubkey (zero if DKG-created)
130is_re_encrypted10=DKG, 1=re-encrypted
131created_epoch8Epoch when created (LE u64)
139bump1PDA bump seed
140_reserved8Reserved

Total: 148 bytes (2 + 146)


PDA Seed Hierarchy

All dWallet-derived PDAs are rooted from the dWallet’s ["dwallet", chunks(curve_u16_le || pk)] prefix:

AccountFull PDA Seeds
DWallet["dwallet", chunks...]
DKG attestation["dwallet", chunks..., "attestation"]
MakePublic attestation["dwallet", chunks..., "public_user_share"]
EncryptedShare["dwallet", chunks..., "encrypted_user_share", &enc_key]
ReEncrypt attestation["dwallet", chunks..., "encrypted_user_share", &enc_key, "attestation"]
MessageApproval["dwallet", chunks..., "message_approval", &scheme_u16_le, &message_digest, [&meta_digest]]
PartialUserSignature["dwallet", chunks..., "partial_user_sig", &scheme_u16_le, &message_digest, [&meta_digest]]
FutureSign attestation["dwallet", chunks..., "partial_user_sig", &scheme_u16_le, &msg_digest, [&meta_digest], "attestation"]

The [&meta_digest] notation means the seed is only included when the message metadata digest is non-zero.


Ika System Accounts (SDK Types)

These accounts are part of the Ika System program, readable via ika-solana-sdk-types.

SystemState (disc 1)

PDA seeds: ["ika_system_state"]. Total: 365 bytes.

OffsetFieldSizeDescription
0discriminator11
1version11
2epoch8Current epoch (LE u64)
34authority32System authority

Validator (disc 2)

PDA seeds: ["validator", identity_pubkey]. Total: 973 bytes.

OffsetFieldSizeDescription
0discriminator12
1version11
2identity32Validator identity pubkey
98state1PreActive(0), Active(1), Withdrawing(2)
159ika_balance8IKA token balance (LE u64)

StakeAccount (disc 3)

PDA seeds: ["stake_account", stake_id_le_bytes]. Total: 115 bytes.

OffsetFieldSizeDescription
0discriminator13
1version11
2owner32Stake owner pubkey
74principal8Staked amount (LE u64)
98state1Active(0), Withdrawing(1)

ValidatorList (disc 4)

PDA seeds: ["validator_list"].

OffsetFieldSizeDescription
0discriminator14
1version11
2validator_count4Total validators (LE u32)
6active_count4Active validators (LE u32)

Voting Example Accounts

Proposal (disc 1)

PDA seeds: ["proposal", proposal_id]. Total: 195 bytes.

OffsetFieldSizeDescription
0discriminator11
1version11
2proposal_id32Unique identifier
34dwallet32dWallet pubkey
66message_hash32Message hash to sign
98user_pubkey32User public key
130signature_scheme1Signature scheme
131creator32Creator pubkey
163yes_votes4Yes count (LE u32)
167no_votes4No count (LE u32)
171quorum4Required yes votes (LE u32)
175status1Open(0), Approved(1)
176msg_approval_bump1MessageApproval PDA bump
177bump1Proposal PDA bump
178_reserved16Reserved

VoteRecord (disc 2)

PDA seeds: ["vote", proposal_id, voter]. Total: 69 bytes.

OffsetFieldSizeDescription
0discriminator12
1version11
2voter32Voter pubkey
34proposal_id32Proposal identifier
66vote1Yes(1) or No(0)
67bump1VoteRecord PDA bump

Account Type Summary

AccountDiscTypeSizePDA SeedsProgram
DWalletCoordinator1PDA116["dwallet_coordinator"]dWallet
DWallet2PDA153["dwallet", chunks(curve_u16_le || pk)]dWallet
NetworkEncryptionKey3PDA164["network_encryption_key", noa]dWallet
GasDeposit4PDA139["gas_deposit", user_pubkey]dWallet
PartialUserSignature9PDA570["dwallet", chunks..., "partial_user_sig", ...]dWallet
EncryptedUserSecretKeyShare11PDA148["dwallet", chunks..., "encrypted_user_share", &enc_key]dWallet
MessageApproval14PDA312["dwallet", chunks..., "message_approval", ...]dWallet
DWalletAttestation15PDA67+["dwallet", chunks..., <type-label>]dWallet
SystemState1PDA365["ika_system_state"]Ika System
Validator2PDA973["validator", identity]Ika System
StakeAccount3PDA115["stake_account", stake_id]Ika System
ValidatorList4PDA18+["validator_list"]Ika System
Proposal1PDA195["proposal", id]Voting example
VoteRecord2PDA69["vote", id, voter]Voting example

Instruction Discriminators

InstructionDiscDescription
CreateDKGRequest0
CompleteDKGFirstRound1
SubmitUserDKGVerification2
CompleteDKG3
RejectDKG4
CreateImportedKeyDKGRequest5
CompleteImportedKeyVerification6
RejectImportedKeyVerification7
ApproveMessage8
CreatePresignRequest11
CompletePresign12
RejectPresign13
CreatePartialUserSignature14
VerifyPartialUserSignature15
RejectPartialUserSignature16
CreateEncryptionKey17
CreateEncryptedShare18
VerifyEncryptedShare19
RejectEncryptedShare20
AcceptEncryptedShare21
MakeUserSecretKeySharePublic22
VerifyMakePublic23
TransferOwnership24
CreateSigningDelegation25
CloseSigningDelegation26
RequestNetworkDKG27
CommitNetworkDKG28NOA commits network DKG result
RequestNetworkKeyReconfiguration29
CommitNetworkKeyReconfiguration30NOA commits key reconfiguration
CommitDWallet31NOA commits DKG result (creates DWallet + attestation PDA)
CommitFutureSign33NOA commits FutureSign (creates attestation PDA)
CommitEncryptedUserSecretKeyShare34NOA commits encrypted share (creates attestation PDA)
CommitPublicUserSecretKeyShare35NOA commits public share (creates attestation PDA)
CreateDeposit36
TopUp37
SettleGas38
UpdateFees39
PauseCurve40
UnpauseCurve41
TransferFutureSign42
CommitSignature43NOA writes signature (dispatches to MessageApproval or PartialUserSignature by discriminator)
RequestWithdraw44
Withdraw45
Initialize46
EmitEvent228Self-CPI event handler