| KMD Version Information | This example demonstrates how to retrieve version information from the KMD (Key Management Daemon) server using the version() method. |
| Wallet Creation and Listing | This example demonstrates how to create, list, rename, and get info about wallets using the KMD (Key Management Daemon) client. |
| Wallet Session Management | This example demonstrates how to manage wallet sessions using KMD handle tokens. Handle tokens are used to unlock wallets and perform operations on them. They have an expiration time and should be released when no longer needed. |
| Key Generation | This example demonstrates how to generate new keys in a wallet using the KMD generateKey() method. Keys are generated deterministically from the wallet’s master derivation key, which means they can be recovered if you have the wallet’s mnemonic or master derivation key. |
| Key Import and Export | This example demonstrates how to import and export keys using the KMD importKey() and exportKey() methods. Key concepts: - Importing externally generated keys into a wallet
- Exporting private keys from a wallet
- Understanding that imported keys are NOT backed up by the master derivation key
|
| Key Listing and Deletion | This example demonstrates how to list all keys in a wallet and delete specific keys using the KMD listKeysInWallet() and deleteKey() methods. |
| Master Key Export | This example demonstrates how to export the master derivation key (MDK) for wallet backup using the KMD exportMasterKey() method. Key concepts: - The master derivation key (MDK) is the root key used to deterministically
generate all keys in the wallet - With the MDK, you can recreate a wallet and regenerate all derived keys
- Imported keys CANNOT be recovered from the MDK
- The MDK should be stored securely as it can regenerate all wallet keys
|
| Multisig Account Setup | This example demonstrates how to create multisig accounts using the KMD importMultisig() method. Key concepts: - A multisig account requires M-of-N signatures to authorize transactions
- The threshold (M) is the minimum number of signatures required
- The public keys (N) are the participants who can sign
- The multisig version parameter (currently always 1) defines the format
- The resulting multisig address is deterministically derived from the
public keys, threshold, and version |
| Multisig Account Management | This example demonstrates how to manage multisig accounts using KMD: - listMultisig() - List all multisig accounts in a wallet
- exportMultisig() - Get the multisig preimage information
- deleteMultisig() - Remove a multisig account from the wallet
Key concepts: - Multisig accounts can be listed to see all multisigs in a wallet
- The multisig preimage contains the original parameters: publicKeys, threshold, version
- Deleting a multisig only removes it from the wallet, not from the blockchain
- Funds in a deleted multisig address remain on the blockchain
|
| Transaction Signing with KMD | This example demonstrates how to sign transactions using the KMD signTransaction() method. It shows the complete workflow of creating a wallet, generating a key, funding it, signing a transaction, and submitting it to the network. |
| Multisig Transaction Signing with KMD | This example demonstrates how to sign multisig transactions using the KMD signMultisigTransaction() method. It shows: - Creating a multisig account with 2-of-3 threshold
- Funding the multisig account via the dispenser
- Creating a payment transaction from the multisig account
- Signing with the first participant (partial signature)
- Signing with the second participant (completing the multisig)
- Submitting the fully signed transaction to the network
|
| Program Signing (Delegated Logic Signatures) with KMD | This example demonstrates how to sign programs/contracts using the KMD signProgram() method. It shows: - Creating a simple TEAL program (logic signature)
- Compiling the TEAL program using algod’s tealCompile
- Signing the compiled program bytes with signProgram()
- Understanding the resulting signature for delegated logic signatures
- How to use the signature with a LogicSigAccount
What is Program Signing? Program signing creates a “delegated logic signature” (delegated lsig). This allows an account holder to authorize a smart contract (TEAL program) to sign transactions on their behalf. When you sign a program: 1. You’re attesting that you authorize this program to act for your account 2. Transactions signed by this delegated lsig will be authorized by your account 3. The program logic determines which transactions are approved Use cases for delegated logic signatures: - Recurring payments (program checks amount and frequency)
- Subscription services (program validates payment recipients)
- Limited spending authorizations (program enforces constraints)
- Conditional transfers (program checks external conditions)
|
| Multisig Program Signing (Delegated Multisig Logic Signatures) with KMD | This example demonstrates how to sign programs with multisig using the KMD signMultisigProgram() method. It shows: - Creating a 2-of-3 multisig account
- Creating a simple TEAL program (logic signature)
- Compiling the TEAL program using algod tealCompile
- Signing the program with the first participant (partial signature)
- Signing the program with the second participant (completing the multisig)
- Understanding delegated multisig logic signatures
What is Multisig Program Signing? Multisig program signing creates a “delegated multisig logic signature”. This combines two powerful concepts: 1. Multisig: Requiring multiple parties to approve 2. Delegated Logic Signatures: Authorizing a program to act on behalf of an account With a delegated multisig lsig: - The multisig account authorizes a program to sign transactions
- Multiple parties must sign the program (meeting the threshold)
- Once signed, the program can authorize transactions within its logic
- No further interaction needed from the multisig participants
Use cases for delegated multisig logic signatures: - Multi-party controlled recurring payments
- Joint account automation (e.g., business partners authorizing limit)
- Escrow with automated release conditions
- DAO treasury with programmatic spending rules
|