TBC Rust SDK
Rust SDK for constructing and signing TuringBitChain transactions and implemented contracts.
Install
[]
= "0.2"
The Cargo package name is tbc-sdk; the Rust import name is tbc_sdk.
Implemented modules
- Base transactions, scripts, keys, sighashes, and API access
- Random private keys, WIF import, English BIP39 mnemonics, and BIP32 xprv/xpub keys
- FT mint, transfer, batch transfer, and merge
- NFT collection creation, mint, batch mint, and transfer
- StableCoin creation, mint, transfer, batch transfer, and merge
- OrderBook buy/sell order creation, matching, and cancellation
- TBC-native MultiSig wallet creation plus distributed TBC/FT build, sign, and finish flows (surface and security model, testnet evidence)
- PoolNFT v2 creation, liquidity, swaps, FTLP lifecycle, and query-backed explicit-context resolution (API mapping and creation authority, testnet evidence); PoolNFT v1 is not supported
Minimal usage
use ;
let api = main;
let tx = new;
assert_eq!;
assert!;
Wallets and HD keys
Create a standalone random private key directly from the operating system's secure random source:
use PrivateKey;
Generate or restore an English BIP39 mnemonic, then derive the default TBC
account path m/44'/236'/0'/1/0:
use ;
HdNetwork::Mainnet serializes xprv/xpub and HdNetwork::Testnet serializes
tprv/tpub. An extended public key can derive only non-hardened children;
hardened derivation requires the extended private key.
Development
In 0.2.0, every supported signed builder finalizes the fee from the exact post-signature transaction size at 80 sat/KB. Signature-length changes are handled with a non-decreasing target, and a builder returns an explicit error instead of an under-target fallback if finalization cannot converge.
License
MIT