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

Instruction Reference

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.

Instructions in the Ika dWallet Solana program. The first byte of instruction data is the discriminator.

Instruction Groups

GroupDisc RangeInstructions
Message8approve_message
Ownership24transfer_ownership
DKG31commit_dwallet
Signing42–43transfer_future_sign, commit_signature

Message

approve_message (disc 8)

Create a MessageApproval PDA requesting a signature from the Ika network. Supports both direct signer and CPI callers.

Accounts (CPI path):

#AccountWSDescription
0message_approvalyesnoMessageApproval PDA (must be empty)
1dwalletnonodWallet account
2caller_programnonoCalling program (executable)
3cpi_authoritynoyesCPI authority PDA (signed via invoke_signed)
4payeryesyesRent payer
5system_programnonoSystem program

Data (67 bytes):

OffsetFieldSize
0discriminator1
1bump1
2message_hash32
34user_pubkey32
66signature_scheme1

The dWallet program verifies:

  • caller_program is executable
  • cpi_authority matches PDA(["__ika_cpi_authority"], caller_program)
  • dwallet.authority == cpi_authority

Ownership

transfer_ownership (disc 24)

Transfer dWallet authority to a new pubkey.

Accounts (signer path):

#AccountWSDescription
0current_authoritynoyesCurrent dWallet authority (signer)
1dwalletyesnodWallet account

Accounts (CPI path):

#AccountWSDescription
0caller_programnonoCalling program (executable)
1cpi_authoritynoyesCPI authority PDA (signer)
2dwalletyesnodWallet account

Data (33 bytes):

OffsetFieldSize
0discriminator1
1new_authority32

DKG

commit_dwallet (disc 31)

NOA-only: create a dWallet account after DKG completes.

Accounts:

#AccountWSDescription
0coordinatornonoDWalletCoordinator PDA
1neknonoNetworkEncryptionKey PDA
2noanoyesNOA signer
3dwalletyesnoDWallet PDA (must be empty)
4authoritynonoInitial dWallet authority
5payeryesyesRent payer
6system_programnonoSystem program

Data:

OffsetFieldSize
0discriminator1
1curve1
2is_imported1
3public_key_len1
4public_key65
69bump1
70public_output_len2
72public_output256
328noa_signature64

Signing

transfer_future_sign (disc 42)

Transfer the completion authority of a PartialUserSignature.

Accounts (CPI path):

#AccountWSDescription
0partial_user_sigyesnoPartialUserSignature account
1caller_programnonoCalling program (executable)
2cpi_authoritynoyesCPI authority PDA (signer)

Data (33 bytes):

OffsetFieldSize
0discriminator1
1new_completion_authority32

commit_signature (disc 43)

NOA-only: write the signature into a MessageApproval account.

Accounts:

#AccountWSDescription
0message_approvalyesnoMessageApproval PDA
1neknonoNetworkEncryptionKey PDA
2noanoyesNOA signer

Data:

OffsetFieldSize
0discriminator1
1signature_len2
3signature128

Voting Example Instructions

These are defined by the example voting program, not the dWallet program:

create_proposal (disc 0)

Create a voting proposal.

Accounts:

#AccountWSDescription
0proposalyesnoProposal PDA (["proposal", proposal_id])
1dwalletnonodWallet account
2creatornoyesProposal creator
3payeryesyesRent payer
4system_programnonoSystem program

Data (103 bytes): proposal_id(32) | message_hash(32) | user_pubkey(32) | signature_scheme(1) | quorum(4) | message_approval_bump(1) | bump(1)

cast_vote (disc 1)

Cast a vote. Triggers approve_message CPI when quorum is reached.

Accounts (base, 5):

#AccountWSDescription
0proposalyesnoProposal PDA
1vote_recordyesnoVoteRecord PDA (["vote", proposal_id, voter])
2voternoyesVoter
3payeryesyesRent payer
4system_programnonoSystem program

Additional accounts when quorum reached (5):

#AccountWSDescription
5message_approvalyesnoMessageApproval PDA
6dwalletnonodWallet account
7caller_programnonoVoting program
8cpi_authoritynonoCPI authority PDA
9dwallet_programnonodWallet program

Data (35 bytes): proposal_id(32) | vote(1) | vote_record_bump(1) | cpi_authority_bump(1)