name: kaspa-dev description: "Comprehensive Kaspa blockchain development toolkit for building transactions, integrating wallets, creating dApps, block explorers, and interacting with the Kaspa network. Use when working with Kaspa blockchain development including: (1) Building and broadcasting transactions, (2) Generating addresses and managing wallets, (3) Creating dApps or block explorers, (4) Integrating Kaspa into existing applications (RainbowKit, OisyWallet, etc.), (5) Working with KRC20 tokens, (6) Setting up Kaspa nodes, (7) Using Kaspa SDKs (Rust, Go, JavaScript/TypeScript, Python, WASM). Supports Rust, Go, JavaScript/TypeScript, Python, and Motoko (Internet Computer) development."
This skill provides comprehensive support for Kaspa blockchain development across multiple programming languages and use cases. Whether you're building a simple wallet integration, a full dApp, a block explorer, or working with KRC20 tokens, this skill provides the patterns, SDK references, and boilerplate code you need.
Kaspa provides official SDKs for multiple languages:
kaspa-wasm - WebAssembly-based SDK for browser and Node.jskaspa-rpc-client and kaspa-wallet-core - Native Rust SDKgithub.com/kaspanet/kaspad - Official Go implementationkaspa package on Mops for Internet Computer integrationJavaScript/TypeScript:
import { PrivateKey, NetworkType } from 'kaspa-wasm';
const privateKey = PrivateKey.random(NetworkType.Mainnet);
const publicKey = privateKey.toPublicKey();
const address = publicKey.toAddress(NetworkType.Mainnet);
console.log('Address:', address.toString());
console.log('Private Key:', privateKey.toString());
Rust:
use kaspa_wallet_core::keys::{PrivateKey, PublicKey};
use kaspa_consensus_core::network::NetworkType;
let private_key = PrivateKey::random(NetworkType::Mainnet);
let public_key = private_key.to_public_key();
let address = public_key.to_address(NetworkType::Mainnet);
println!("Address: {}", address.to_string());
Go:
import (
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
"github.com/kaspanet/kaspad/util"
)
privateKey, _ := util.GeneratePrivateKey()
publicKey := privateKey.PublicKey()
address, _ := util.NewAddressPublicKey(publicKey.Serialize(), util.Bech32PrefixKaspaMain)
fmt.Printf("Address: %s\n", address.String())
JavaScript/TypeScript:
import { Transaction, RpcClient, NetworkType } from 'kaspa-wasm';
const rpc = new RpcClient({
url: 'wss://api.kaspa.org',
network: NetworkType.Mainnet
});
await rpc.connect();
// Get UTXOs for the sender address
const utxos = await rpc.getUtxosByAddresses([senderAddress]);
// Build transaction
const tx = new Transaction({
version: 0,
inputs: utxos.map(utxo => ({
previousOutpoint: utxo.outpoint,
signatureScript: '', // Will be filled after signing
sequence: 0,
sigOpCount: 1
})),
outputs: [{
amount: amount,
scriptPublicKey: recipientScriptPublicKey
}],
lockTime: 0,
subnetworkId: '00000000000000000000000000000000'
});
// Sign transaction
const signedTx = await signTransaction(tx, privateKey);
// Broadcast
const txId = await rpc.submitTransaction(signedTx);
console.log('Transaction ID:', txId);
For detailed SDK documentation and examples:
For integrating Kaspa into wallets like RainbowKit, OisyWallet, or custom wallets:
See references/wallet-integration.md for: - Wallet connection patterns - Transaction signing flows - Address management - Network switching
小葱技能站7w4.net发现了升级插件。
For setting up and operating Kaspa nodes:
See references/node-operations.md for: - Docker deployment - Binary installation - Building from source - Configuration options - RPC node setup - Monitoring and maintenance
When building a Kaspa dApp:
To build a block explorer:
See API reference for available endpoints.
Kaspa supports KRC20 tokens (similar to ERC20 on Ethereum). For token development:
See references/krc20-tokens.md for: - Token contract structure - Transfer and approval mechanisms - Token metadata - Integration patterns
Kaspa has three network types:
kaspa:)kaspatest:)kaspadev:)Always use the correct network type for your use case.
Kaspa uses Bech32 encoding for addresses:
kaspa:qqkqkzjvr7zwxxmjxjkmxx (62 characters total)kaspatest:qqkqkzjvr7zwxxmjxjkmxxkaspadev:qqkqkzjvr7zwxxmjxjkmxxThe scripts/ directory contains utility scripts:
generate-address.py: Generate Kaspa addressesbuild-transaction.py: Build and sign transactionsmonitor-address.py: Monitor address for incoming transactionsThe assets/ directory contains boilerplate templates:
dapp-template/: React/Next.js dApp starterexplorer-template/: Block explorer starterwallet-adapter/: Wallet adapter implementation这是一个专注于 Kaspa 区块链开发的工具包,质量中等偏上。优点是内容全面、文档分类清晰、代码示例多,开发者可以快速上手。不足是主文档内容不够丰富,缺少使用引导和常见问题解答,部分实用脚本不完整。对于需要深入开发的专业用户有一定帮助,但新手可能需要更多入门指导。