Skip to main content

Python SDK for Midnight blockchain — Privacy-first, async-first

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

noxipher-0.1.8.tar.gz (279.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noxipher-0.1.8-py3-none-any.whl (75.7 kB view details)

Uploaded Python 3

File details

Details for the file noxipher-0.1.8.tar.gz.

File metadata

  • Download URL: noxipher-0.1.8.tar.gz
  • Upload date:
  • Size: 279.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for noxipher-0.1.8.tar.gz
Algorithm Hash digest
SHA256 d1b0bf08866ce09bd957b4c9fcac124227241490db41909dae345681c31fb5ce
MD5 c79942377bd2b7da605e9cfda028633d
BLAKE2b-256 6cc58fd19c357ac972fa10262a3e154a06819eedc2db389a6d46aed7ca557e88

See more details on using hashes here.

Provenance

The following attestation bundles were made for noxipher-0.1.8.tar.gz:

Publisher: release.yml on g1BSsQ/Noxipher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file noxipher-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: noxipher-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 75.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for noxipher-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 625a70ef4e26d38f12c45870d50abd2ac2d39b7c2eaf57b211b809c11af33c70
MD5 0d2fffbb0539dbd4ccb2efdbcea7aa50
BLAKE2b-256 383047025db6003f208a0d785e44377ac85345bac60c7a107d9a13f35ce114c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for noxipher-0.1.8-py3-none-any.whl:

Publisher: release.yml on g1BSsQ/Noxipher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page