Tencoinlib
Official Python library for Tencoin – HD wallets, transactions, RPC client, and message signing.
Features
-
HD Wallets: BIP-39 seed phrases with purpose-aware BIP-44, BIP-49, and BIP-84 derivation
-
Full BIP-32 Support: Standard xprv/xpub extended keys with master and account-level derivation
-
Watch-Only Wallets: Create wallets directly from xpub (no seed/private key required)
-
Multiple Address Types:
- SegWit v0 (P2WPKH): Native SegWit addresses (
tc1q...) using BIP-84 - Legacy P2PKH: Pay-to-pubkey-hash addresses (
T...) using BIP-44 - Nested SegWit (P2SH-P2WPKH): BIP-49-compatible addresses (
M...) - P2WSH: SegWit script addresses (
tc1q...with 32-byte program)
- SegWit v0 (P2WPKH): Native SegWit addresses (
-
Purpose-Aware HD Derivation:
- BIP-44 (P2PKH):
m/44'/5353'/account'/0/index - BIP-49 (P2SH-P2WPKH):
m/49'/5353'/account'/0/index - BIP-84 (P2WPKH):
m/84'/5353'/account'/0/index - BIP-44, BIP-49, and BIP-84 use completely separate derivation paths and account-level extended keys
- Account-level xprv/xpub can be derived for each supported purpose
- BIP-44 (P2PKH):
-
Custom Scripts: Support for multisig and custom redeem/witness scripts
-
Transaction Signing: Automatic detection and signing for SegWit (BIP-143) and Legacy (P2PKH/P2SH) inputs
-
Multisig Signing: Create and sign P2SH multisignature transactions with configurable M-of-N signing policies
-
Message Signing: Bitcoin Core–compatible message signing and verification with public key recovery
-
Library Integrity Verification: Cryptographic proof that the installed library is authentic and unmodified
-
Seed Phrases: 12–24 word English mnemonics (full BIP-39 compliance)
-
Wallet Recovery: From mnemonic phrases – compatible with standard BIP-39 implementations
-
Full BIP-39 Compatibility: Mnemonics generated by other standard libraries (e.g., bip-utils, Electrum, MetaMask, Ian Coleman's tool) are validated and recovered
-
Secure Seed Generation: PBKDF2-HMAC-SHA512 with official 2048-word English wordlist
-
Encrypted Wallet Files (
.tcw): AES-256-GCM + Argon2id, locked/unlocked state, no plaintext secrets on disk -
OP_RETURN Outputs: On-chain data embedding (up to 80 bytes per output)
-
Conditional Outputs C1–C5: Native consensus-enforced outputs, all creatable with
TransactionBuilderand spendable withspend_conditional()/ `wallet.spend_conditional -
WIF conversion:
hex_to_wif()/wif_to_hex()for compressed and uncompressed private keys, public-key compress/decompress, and address derivation for both forms (P2PKH works with either; SegWit needs compressed). Uncompressed P2PKH outputs can be spent. Every signing / decryption function accepts a private key as bytes, hex or WIF and detects the form automatically. -
TMSG (Tencoin Message): End-to-end encrypted messages, files and folders (ECDH secp256k1 + AES-256-GCM) to one public key (v1) or many (v2), off-chain or on-chain in an
OP_RETURNoutput, plusrpc.get_public_key()(getpublickey) to find a recipient's key. -
HASHLOCK Outputs: Create and spend HASHLOCK outputs using a secret and the owner's signature (
spend_hashlock(); every conditional type is covered byspend_conditional()). -
Complete RPC Client: every node command (JSON-RPC 2.0, token or user/password authentication, typed errors, amounts in Tenos, verbosity 0–3), the five
create_*_output()commands for C1–C5, and typed objects (Condition,OutputState,ConditionalUnspent,MempoolAcceptResult, …) that keep the node's own field names. -
TCS Secret Generator: Generate and verify Tencoin secrets in the
TCS-...format, including checksum validation.
Installation
pip install tencoinlib
Support Tencoin Development
Tencoin is an open-source project developed and maintained independently.
Your support helps fund the continued development, maintenance, and growth of Tencoin and its ecosystem, including Tencoinlib.
Donations may support:
- Tencoin Core and protocol development
- Tencoinlib development and maintenance
- Network infrastructure and public nodes
- Wallets and ecosystem tools
- Servers, hosting, and development infrastructure
- Security, testing, and long-term maintenance
If you use Tencoinlib, build applications on Tencoin, or simply want to support the project, consider making a donation.
Every contribution helps keep Tencoin open-source, independent, and continuously improving.
Donation Addresses
Bitcoin (BTC)
bc1qwnl7zm39ghdrvr4849dtzhn0ycx28ty7n2fxjf
Ethereum (ETH)
0xEd727b0599c0f50348276E98424c9B9B62e87408
Tether (USDT – ERC-20)
0xEd727b0599c0f50348276E98424c9B9B62e87408
Tether (USDT – TRC-20)
TGK9TPq1gq7tNNQe9zrTmttHJcVadwCLGn
Solana (SOL)
95Nt1JUPbcvVy14AoB3AjivAws1neQUfmCwxL5bGFgFA
Thank you for supporting open-source development and the Tencoin ecosystem.
Verify Authenticity
Each release is signed by the official Tencoin developer. You can verify that your installed library is authentic and has not been tampered with:
from tencoinlib.integrity import compute_library_hash, get_file_manifest
from tencoinlib import verify_message, DEVELOPER_ADDRESS
from tencoinlib import __version__
# Paste the signature for your release from tencoin.org
SIGNATURE = "PASTE_SIGNATURE_HERE"
library_hash = compute_library_hash()
is_valid = verify_message(DEVELOPER_ADDRESS, library_hash, SIGNATURE)
print("=" * 64)
print(f" Version : {__version__}")
print(f" Developer address : {DEVELOPER_ADDRESS}")
print(f" Library hash : {library_hash}")
print(f" Files hashed : {len(get_file_manifest())}")
print(f" Authentic : {'✓ YES' if is_valid else '✗ NO — library may be tampered with'}")
print("=" * 64)
Release: v0.4.3 Developer:
TASH999uKBUFN1AqAkDjJ8dQqWbXw6G5bhSignature:IM3hJUFGNJ3eIDeSkLn0+qAOhZWAP3aFV1mKKDjXFolVWKOpsbqnGjtUmqqB4h2R2WsZZ7Sq6yxqY+QWn8iO/WU=
Metadata
Release files for tencoinlib 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tencoinlib-0.4.3.tar.gz | 157.2 kB | Without provenance | Details for tencoinlib-0.4.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tencoinlib-0.4.3-py3-none-any.whl | Python 3 | none | any | Details for tencoinlib-0.4.3-py3-none-any.whl |
Total release size: 331.1 kB
Release files / tencoinlib-0.4.3.tar.gz
| Download URL | tencoinlib-0.4.3.tar.gz |
|---|---|
| Size | 157.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8df29580d95a13f40e5c13a788b550f46b8c91dfc3bf2794ec11f0a62a3df00e
|
|
BLAKE2b-256 checksum How to use checksums |
6bce6816ea3984cb4d86caed123c3eb68f90297fa27c3fdcb48fb93e69f8de4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tencoinlib-0.4.3-py3-none-any.whl
| Download URL | tencoinlib-0.4.3-py3-none-any.whl |
|---|---|
| Size | 173.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
59399f73ff278ff3fcbf1fa06e8ba604a00e2bccf5896005082c0d750b17bd55
|
|
BLAKE2b-256 checksum How to use checksums |
fe17c48625b8e67e778ab3ee6fbf100f83e8fa6a0cb3a26d4d42f34123be6896
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for tencoinlib 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.