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.
  • 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.0.tar.gz (261.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.0-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: noxipher-0.1.0.tar.gz
  • Upload date:
  • Size: 261.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.0.tar.gz
Algorithm Hash digest
SHA256 64e620a200b051c735252565c7f1785d3679a2188dd67be679af07c8d9bd769b
MD5 79d2b4f4ecf0ede17334ca4401284d2b
BLAKE2b-256 ca0e20e82e255bf44fb60805bc714d0675af0042c9863725bb7755231e87ce40

See more details on using hashes here.

Provenance

The following attestation bundles were made for noxipher-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: noxipher-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2c272d88742a324bc8fd105b15ac52582b3f44d13c5943f85263260661f019
MD5 8fc38803919a8abf2cec68a69d34ee66
BLAKE2b-256 59f6588379269e8c59b68553cab5acf94acc0909729e295fa720345c17382ee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for noxipher-0.1.0-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