nostr-secure-enclave
Python package for Nostr Secure Enclave. Server-side key management for AI entities, bots, and backend services.
Package: nostr-secure-enclave (PyPI)
Implementation
Pure Python using cryptography for AES-256-GCM + secp256k1 for Schnorr signing (BIP-340).
Use Cases
- OpenClaw / AI entity identity
- Bot process keypairs
- Backend service identity
- MCP tool server signing
API
import os
from nse import NSE, NostrEvent
from nse.storage import FileStorage
# Initialize with master key + persistent storage
nse = NSE(
master_key=os.environ['NSE_MASTER_KEY'],
storage=FileStorage('.nse'),
)
# Generate on first run
if not nse.exists():
info = nse.generate()
print(f"Identity: {info.npub}")
# Sign events
signed = nse.sign(NostrEvent(
kind=1,
content="Hello Nostr",
tags=[],
created_at=int(time.time()),
))
# Read identity (no unlock needed)
pubkey = nse.get_public_key()
npub = nse.get_npub()
# Wipe everything
nse.destroy()
Storage Backends
MemoryStorage— testing / ephemeral processesFileStorage(directory)— persistent file storage
Security Notes
- AES-256-GCM encryption with unique IV per operation
- Best-effort memory zeroing after signing (
bytearray.fill(0)) - Python's GC may retain copies of key material — this is a documented limitation
hardware_backedis alwaysFalsefor Python keys (honest)
Status: Implemented (Phase 6) — 27 tests passing
Metadata
Release files for nostr-secure-enclave 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nostr_secure_enclave-0.1.0.tar.gz | 7.7 kB | Without provenance | Details for nostr_secure_enclave-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nostr_secure_enclave-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nostr_secure_enclave-0.1.0-py3-none-any.whl |
Total release size: 14.4 kB
Release files / nostr_secure_enclave-0.1.0.tar.gz
| Download URL | nostr_secure_enclave-0.1.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e05dfd746f88905443ee76e6cc16e44ffbdc657e7cc42ca4dc3a16f61f632bb
|
|
BLAKE2b-256 checksum How to use checksums |
5da0ebd2f3f920d16c38abe68719db4a2cac5f9ca46837b7b67039d5e898499c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / nostr_secure_enclave-0.1.0-py3-none-any.whl
| Download URL | nostr_secure_enclave-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1918c8b55052d118d118f6bdbd7d384e44bee5961e1e5a2ca19adfe7c717e7e5
|
|
BLAKE2b-256 checksum How to use checksums |
8a046893940b56d27924d9a06b793d2c1ae8d50619e80469602129dfb781e8c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for nostr-secure-enclave 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.