A Kaspa transaction signer that leverages the Internet Computer's secure threshold signature infrastructure. This project demonstrates how to generate Kaspa addresses and sign transactions using ICP ECDSA keys.
- Generate real Kaspa addresses using ICP threshold signature keys
- Sign Kaspa transactions using the ICP network's secure ECDSA infrastructure
- Create P2PKH addresses in the standard
kaspa:...format - Leverage ICP security - private keys are never stored locally, only distributed across the network
- โ Real ICP ECDSA Integration: Uses actual threshold signature keys
- โ Kaspa Address Generation: Creates valid mainnet addresses (version 118)
- โ
Base58 Encoding: Proper
kaspa:prefix formatting - โ Transaction Hashing: BLAKE2b + RIPEMD160 double hashing
- โ Production Ready: Same code works locally and on mainnet
# Clone the repository
git clone <your-repo-url>
cd kaspa-on-icp
# Option 1: Quick setup (recommended)
chmod +x setup.sh
./setup.sh
# Option 2: Manual setup
mops install
dfx start --background
dfx deploy# Run all tests at once
chmod +x test.sh
./test.shdfx canister call kaspa-on-icp-backend getAvailableICPKeys# Generate and format address
dfx canister call kaspa-on-icp-backend generateKaspaAddressFormatted '("test_key_1")'
# Expected output:
# โ
Generated Kaspa address from ICP ECDSA key 'test_key_1':
# kaspa:8J2rAoqvQbMLGsEeA35ra7ySPZAwN# Generate raw address data
dfx canister call kaspa-on-icp-backend generateKaspaAddressFromICP '("test_key_1")'
# Format any address
dfx canister call kaspa-on-icp-backend formatKaspaAddress '(record { version = 118 : nat8; payload = blob "..."; })'# This will work and generate a 64-byte hash
dfx canister call kaspa-on-icp-backend demonstrateKaspaSigningkaspa-on-icp/
โโโ src/
โ โโโ kaspa-on-icp-backend/
โ โโโ main.mo # Main Kaspa transaction signer
โโโ mops.toml # Dependencies (base-x-encoder, blake2b, ripemd160)
โโโ dfx.json # DFX configuration
โโโ README.md # This file
- base-x-encoder: Base58 encoding for Kaspa addresses
- blake2b: BLAKE2b hashing algorithm
- ripemd160: RIPEMD160 hashing algorithm
- base: Motoko base library
This project integrates with the Internet Computer's threshold signature system:
- Local Development: Uses local ICP ECDSA API (automatically provided by SDK)
- Mainnet: Will use production ICP ECDSA canister
- Security: Private keys are distributed across multiple ICP nodes
- Cost: Test keys cost
10B cycles ($0.013), Production keys cost26B cycles ($0.035)
๐ง This project is a Work in Progress (WIP)
- ICP ECDSA key generation
- Kaspa address creation (version 118)
- Transaction hashing (BLAKE2b + RIPEMD160)
- Base58 address formatting
- Real threshold signature integration
- ICP ECDSA transaction signing (local development limitation)
- Will work perfectly on mainnet
- Transaction broadcasting to Kaspa network
- Multi-signature support
- Advanced transaction types
The local ICP ECDSA API has some limitations:
- Key generation: โ Working
- Address creation: โ Working
- Transaction signing: โ Limited (will work on mainnet)
- Test address generation (fully working)
- Test transaction hashing (fully working)
- Test signing on mainnet (when ready for production)
When ready for production:
# Deploy to mainnet
dfx deploy --network ic
# The same code will work with production ICP ECDSA canister
# All signing functionality will be fully operational- Version: 118 (mainnet)
- Encoding: Base58Check
- Format:
kaspa:... - Length: 20-byte payload
- First Pass: BLAKE2b (256-bit)
- Second Pass: RIPEMD160 (160-bit)
- Purpose: Creates public key hash for P2PKH addresses
- Canister ID:
aaaaa-aa(local), production IDs on mainnet - Key Derivation: Uses canister principal for secure key derivation
- Threshold: Multiple nodes participate in signing
This is a work in progress. Contributions are welcome!
[mit license.]