Noxipher Documentation
Welcome to the official documentation for Noxipher, a professional-grade Python SDK for the Midnight Network.
Noxipher is designed to be privacy-first and async-first, giving developers a robust interface to interact with Midnight nodes, indexers, and proof servers.
Highlights
- 100% Async: Fully asynchronous interface using
httpxandwebsockets. - Protocol Parity: Strict compatibility with Midnight v8.1.0-rc.1 cryptographic operations.
- Smart Wallets: Unified management of NIGHT, ZK, and DUST tokens.
Next Steps
- Head over to the Getting Started guide to install and run your first code.
- Check out the API Reference to explore the available modules.
- Read the Midnight Protocol Specification to understand the technical details behind Noxipher.
Project Overview
Noxipher ๐
Noxipher is a professional-grade Python SDK for the Midnight Network, a privacy-focused blockchain. It provides a robust, asynchronous interface for interacting with Midnight nodes, indexers, and proof servers.
๐ Features
- Asynchronous First: Built with
httpx,gql, andwebsocketsfor high-performance async workflows. - Protocol Parity: 100% byte-perfect parity with Midnight v8.1.0-rc.1 for key derivation (Zswap CSK/CPK/ESK, Dust DSK).
- Byte-Perfect SCALE Serialization: Custom implementation of Midnight's
ScaleBigIntand tagged serialization protocol (v5.0 spec). - Comprehensive Wallet Support: Unified management of NIGHT (unshielded), ZK (shielded), and DUST (fee) tokens.
- Smart Transaction Building: Automatic UTXO discovery and selection for unshielded transfers.
- Node & Indexer Integration: Direct interaction with Substrate-based node RPCs and GraphQL indexers.
๐ฆ Installation
# Basic installation
pip install noxipher
# With Node interaction support (requires Rust toolchain for bindings)
pip install "noxipher[node]"
๐ ๏ธ Quick Start
import asyncio
from noxipher.core.client import NoxipherClient
from noxipher.wallet.wallet import MidnightWallet
from noxipher.core.config import Network
async def main():
# Initialize client (defaults to PREPROD)
async with NoxipherClient(network=Network.PREPROD) as client:
# Load wallet from mnemonic
wallet = MidnightWallet.from_mnemonic("your 24 words...", Network.PREPROD)
# Check unshielded balance
balance = await client.get_balance(wallet)
print(f"Balance: {balance}")
# Send an unshielded NIGHT transfer
receipt = await client.send_unshielded_transaction(
wallet,
recipient_address="mn_addr_preprod1...",
amount=1_000_000 # 1 NIGHT
)
print(f"Transaction finalized in block {receipt.block_height}")
if __name__ == "__main__":
asyncio.run(main())
๐๏ธ Architecture
Noxipher coordinates three main services: 1. Midnight Node: For extrinsic submission and chain state. 2. Indexer: For transaction history and UTXO discovery. 3. Proof Server: For generating Zero-Knowledge proofs (required for shielded transactions).
๐งช Testing
# Run unit tests
pytest tests/unit/
# Run SCALE serialization validation
python tests/unit/test_scale.py
๐ License
MIT ยฉ g1BSsQ