chainkit-sdk-pro
v1.0.3
Published
Universal BCH developer toolkit for tokenized usage, micro-payments, access control, rewards, and revenue splitting.
Maintainers
Readme
ChainKit SDK
Universal BCH developer toolkit for rapid integration of tokenized usage, micro-payments, access control, rewards, and revenue splitting into any application.
Features
- Prebuilt CashToken contract templates (mint, burn, split, track, access)
- Unified SDK and CLI for seamless token operations
- Demo-ready examples for all features
- Modular, extensible, and production-ready
Quickstart
npm install
node chainkit-cli.js --helpExample Usage
Importing the SDK
import ChainKit from 'chainkit-sdk';
// or, for named imports:
// import { contract, token, nft, mint, burn, trackAction } from 'chainkit-sdk';Instantiate a Contract
const contract = ChainKit.contract.getContractInstance('TokenContract', [owner, admin, false]);
console.log('Contract address:', contract.address);Mint Tokens
const result = await ChainKit.mint.mintToken(minterWif, userPubKey, 'DemoToken', 1000, 'chipnet');
console.log('Mint result:', result);Burn Tokens
const result = await ChainKit.burn.burnToken(holderWif, userPubKey, 500);
console.log('Burn result:', result);Build a Token Transaction
const tx = await ChainKit.token.buildTokenTx({
contractName: 'TokenContract',
constructorArgs: [owner, admin, false],
action: 'mint',
params: { amount: 1000, from: owner, to: user, key: minterWif },
fee: 500,
});
console.log('Token TX:', tx);Build a Split Payment Transaction
const tx = await ChainKit.splitPayment.buildSplitPaymentTx({
contractName: 'SplitPayment',
constructorArgs: [pk1, pk2, admin, 0],
recipients: [{ address: 'bchtest:...', amount: 1000 }],
keys: [key1, key2],
fee: 500,
});
console.log('Split Payment TX:', tx);Track an Action
const result = await ChainKit.trackAction.trackAction(userWif, userPubKey, 'LOGIN', 'chipnet');
console.log('Track result:', result);API Reference
See src/ modules for detailed API docs and usage examples.
Contracts
- See
contracts/for all CashScript templates.
Testing
npm testContributing
See CONTRIBUTING.md for guidelines. Join our support channel for help.
ChainKit SDK removes the friction of building CashToken-powered features from scratch, letting you focus on your app’s unique value while BCH handles fast, low-fee microtransactions.
Legacy and Advanced Features
ChainKit-SDK
A modular, production-ready SDK for Bitcoin Cash (BCH) smart contracts, tokens, NFTs, and cross-chain interoperability.
Features
- Contract deployment and interaction (CashScript)
- UTXO management
- Split payment flows
- Token mint/burn/transfer
- NFT actions
- Cross-chain atomic swaps and NFT bridging (BCH <-> EVM)
- Utilities for address validation, fee calculation, etc.
Quick Start
import ChainKit from './src/sdk.js';
// Example: Deploy and interact with SplitPayment contract
const contract = ChainKit.contract.getContractInstance('SplitPayment', [pk1, pk2, admin, locktime]);
const utxos = await ChainKit.utxo.fetchUtxos(contract.address);
const tx = await ChainKit.splitPayment.buildSplitPaymentTx({
contractName: 'SplitPayment',
constructorArgs: [pk1, pk2, admin, locktime],
recipients: [{address: 'bchtest:...', amount: 1000}],
keys: [key1, key2],
fee: 500,
});
console.log(tx.toString());Modules
contract.js: Contract instantiation, deployment, address derivationutxo.js: UTXO fetching and selectionsplitPayment.js: Split payment transaction buildertoken.js: Token contract transaction buildernft.js: NFT contract transaction buildercrossChain.js: Atomic swaps, NFT bridging, cross-chain messagingutils.js: Address validation, satoshi conversion, fee calculationsdk.js: Global entry point
Example Scripts
See examples/ for sample flows.
Testing
Run tests in tests/ for reliability.
Wallet & Explorer Integration
- Add wallet signing/broadcasting via Electron Cash, Paytaca, etc.
- Link transactions/contracts to block explorers.
CLI Tools
- Coming soon: contract management, batch operations.
License
MIT
ChainKit SDK
Project Description
ChainKit SDK is a universal BCH developer toolkit that enables rapid integration of tokenized usage, micro-payments, access control, rewards, and revenue splitting into any application — whether games, SaaS platforms, social apps, content services, or real-world services.
- Prebuilt CashToken contract templates for minting, burning, splitting, and tracking tokens
- SDK / CLI functions for seamless token operations and event tracking
- Demo-ready examples that showcase universal applicability while visually engaging for judges
ChainKit SDK removes the friction of building CashToken-powered features from scratch, letting developers focus on their app’s unique value while BCH handles fast, low-fee microtransactions.
Problem Statement / Gap in BCH Ecosystem
While BCH supports CashTokens, existing tools are low-level and fragmented:
- Developers must manually write contracts for each tokenized feature
- No unified SDK exists for micro-transactions, pay-per-action, token-gated access, or multi-party revenue splits
- Scaling and tracking usage across multiple apps is complex
ChainKit SDK closes this gap by providing modular, reusable, developer-ready infrastructure, enabling BCH adoption at scale.
MVP (2–3 Weeks)
1️⃣ Contract Templates
- Mint, burn, transfer CashTokens
- Pay-per-action logic (burn-on-use)
- Revenue splitting / referral support
2️⃣ SDK / CLI
mintToken(user, type, amount)burnToken(user, amount)splitPayment(userList, amounts)trackAction(user, actionType)
3️⃣ Demo App (Optional for Judges)
- Mini-game, social app, or API demo
- Flow: Mint token → perform action → token burned → reward distributed → balances updated
- Shows universal applicability, not just game-focused
Demo App Flow & Features
The demo app showcases the universal applicability of ChainKit SDK. Example flow:
- Mint Token:
- User receives a CashToken (e.g., for joining, purchasing, or as a reward).
- Perform Action:
- User performs an action (e.g., play a game, access content, trigger a service).
- Burn Token:
- Token is burned as payment for the action (pay-per-use logic).
- Distribute Reward / Split Payment:
- Revenue or reward is split among multiple parties (e.g., referral, team, platform).
- Track Action:
- The action is tracked on-chain for analytics, rewards, or access control.
- Balances Updated:
- All balances and states are updated and displayed to the user.
Features:
- Universal: Works for games, SaaS, social, content, or real-world services
- Visual: Demo-ready for judges, with clear flows and state updates
- Modular: Each step uses a ChainKit SDK function
The demo can be implemented as a CLI, web app, or API, depending on the target audience and use case.
