Python SDK for Midnight blockchain — Privacy-first, async-first
Project description
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. - 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:
- Midnight Node: For extrinsic submission and chain state.
- Indexer: For transaction history and UTXO discovery.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64e620a200b051c735252565c7f1785d3679a2188dd67be679af07c8d9bd769b
|
|
| MD5 |
79d2b4f4ecf0ede17334ca4401284d2b
|
|
| BLAKE2b-256 |
ca0e20e82e255bf44fb60805bc714d0675af0042c9863725bb7755231e87ce40
|
Provenance
The following attestation bundles were made for noxipher-0.1.0.tar.gz:
Publisher:
release.yml on g1BSsQ/Noxipher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noxipher-0.1.0.tar.gz -
Subject digest:
64e620a200b051c735252565c7f1785d3679a2188dd67be679af07c8d9bd769b - Sigstore transparency entry: 1339663586
- Sigstore integration time:
-
Permalink:
g1BSsQ/Noxipher@523fd7f4e28482b10be64d1f81e896f14f5c472e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/g1BSsQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@523fd7f4e28482b10be64d1f81e896f14f5c472e -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a2c272d88742a324bc8fd105b15ac52582b3f44d13c5943f85263260661f019
|
|
| MD5 |
8fc38803919a8abf2cec68a69d34ee66
|
|
| BLAKE2b-256 |
59f6588379269e8c59b68553cab5acf94acc0909729e295fa720345c17382ee3
|
Provenance
The following attestation bundles were made for noxipher-0.1.0-py3-none-any.whl:
Publisher:
release.yml on g1BSsQ/Noxipher
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noxipher-0.1.0-py3-none-any.whl -
Subject digest:
5a2c272d88742a324bc8fd105b15ac52582b3f44d13c5943f85263260661f019 - Sigstore transparency entry: 1339663588
- Sigstore integration time:
-
Permalink:
g1BSsQ/Noxipher@523fd7f4e28482b10be64d1f81e896f14f5c472e -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/g1BSsQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@523fd7f4e28482b10be64d1f81e896f14f5c472e -
Trigger Event:
push
-
Statement type: