Skip to content

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 httpx and websockets.
  • 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


Project Overview

Noxipher ๐ŸŒ‘

CI PyPI version License: MIT Python 3.11+ Code style: ruff

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, and websockets for 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 ScaleBigInt and 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