Metadata-Version: 2.4
Name: tencoinlib
Version: 0.2.0
Summary: Official Python library for Tencoin – HD wallets, SegWit, BIP39, RPC client
Author: Tencoin Development Team
License: MIT
Project-URL: Homepage, https://tencoin.org
Project-URL: Repository, https://github.com/tencoinorg/tencoin/tree/main/tencoinlib
Project-URL: Issues, https://github.com/tencoinorg/tencoin/issues
Project-URL: Documentation, https://tencoinlib.readthedocs.io
Keywords: tencoin,blockchain,cryptocurrency,hd-wallet,bip39,segwit,rpc
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: ecdsa>=0.19.2
Requires-Dist: requests>=2.34.2
Requires-Dist: bech32>=1.2.0
Requires-Dist: coincurve>=21.0.0
Requires-Dist: cryptography>=50.0.0
Requires-Dist: argon2-cffi>=25.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Provides-Extra: async
Requires-Dist: aiohttp>=3.8.0; extra == "async"
Provides-Extra: mnemonic
Requires-Dist: mnemonic>=0.20; extra == "mnemonic"

# Tencoinlib

Official Python library for Tencoin – HD wallets, transactions, RPC client, and message signing.

## Features

- **HD Wallets**: BIP-39 (seed phrases) + BIP-84 (SegWit native addresses)
- **Full BIP-32 Support**: Standard xprv/xpub extended keys with master/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...`)
  - **Legacy P2PKH**: Pay-to-pubkey-hash addresses (`T...`)
  - **Legacy P2SH**: Pay-to-script-hash addresses (`M...`)
  - **P2WSH**: SegWit script addresses (`tc1q...` with 32-byte program)
- **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
  - **Key Derivation**:
  - **BIP-84 (P2WPKH)**: `m/84'/5353'/0'/0/0` for native SegWit addresses
  - **BIP-44 (P2PKH)**: `m/44'/5353'/0'/0/0` for legacy P2PKH addresses
  - Additional custom BIP-32 paths supported via the BIP-32 API
- **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)
- **TIMELOCK Outputs**: Conditional outputs (flag `0xC1`) that lock funds
  until a specific block height or Unix timestamp is reached


## Installation

```bash
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:

```python
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.2.0  
> **Developer:** `TASH999uKBUFN1AqAkDjJ8dQqWbXw6G5bh`  
> **Signature:** `xEmCyXtjGQyyitQdQfgSVKEHvGUsrxKJaoEzLhFD7GVLv5J8hT6Agd1sxkwdocW/KzNKdGLxAx16yFqxNGeImyA=`
