bolyra
Python SDK for Bolyra — zero-knowledge identity verification for AI agents.
Install
pip install bolyra
Quick Start
from bolyra import Permission, permissions_to_bitmask, validate_cumulative_bit_encoding
# Define agent permissions
bitmask = permissions_to_bitmask([
Permission.READ_DATA,
Permission.WRITE_DATA,
Permission.FINANCIAL_SMALL,
])
print(f"Bitmask: {bitmask}") # 7
# Validate cumulative encoding
validate_cumulative_bit_encoding(bitmask) # OK — no exception
# Types for identity and credentials
from bolyra import HumanIdentity, AgentCredential, HandshakeResult
Architecture
The Python SDK provides:
- Pure Python types, validation, and error handling (zero dependencies)
- Subprocess bridge to the Node.js
@bolyra/sdkfor ZK proof generation (snarkjs is JavaScript-only)
For proof generation and verification, install the Node.js SDK:
npm install @bolyra/sdk
API
Types
HumanIdentity— EdDSA identity with secret, public key, and commitmentAgentCredential— AI agent credential with model hash, permissions, expiryHandshakeResult— Mutual handshake verification resultPermission— 8-bit permission enum with cumulative encoding
Functions
permissions_to_bitmask(permissions)— Convert permission list to bitmaskvalidate_cumulative_bit_encoding(bitmask)— Validate cumulative bit rulesvalidate_human_secret(secret)— Validate secret is within BN254 fieldvalidate_agent_expiry(expiry)— Validate expiry is in the future
Errors
All errors extend BolyraError with a .code property matching the TypeScript SDK.
License
Apache-2.0 — see LICENSE.
Release files for bolyra 0.5.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 | |
|---|---|---|---|
| bolyra-0.5.0.tar.gz | 32.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bolyra-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.7 kB
Release files / bolyra-0.5.0.tar.gz
| Download URL | bolyra-0.5.0.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ae360ad2016b6171400fc7872adcb37426a5d01de251b231c6494d34c0bb1486
|
|
BLAKE2b-256 checksum How to use checksums |
692b5b82082ff8c49573efdc6db0e09f9d0bc6e603edd3fe4d3f92f4e050348a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.
Transparency logRelease files / bolyra-0.5.0-py3-none-any.whl
| Download URL | bolyra-0.5.0-py3-none-any.whl |
|---|---|
| Size | 26.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af44db8bf602a37d427bb9130d67379dfd11d84d45eed021edbadad53856e42b
|
|
BLAKE2b-256 checksum How to use checksums |
42b6a1f2004bd5a347d02a34b6f7ed4fd91646fb7c6a52db99cae1a242b04858
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.
Transparency log