Python SDK for Bolyra — unified ZKP identity for humans and AI agents
Project description
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.
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 bolyra-0.4.0.tar.gz.
File metadata
- Download URL: bolyra-0.4.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
866e5b4c498c7520bcb34a75dcaac4904d44bb9c5e07e5f10ba7c6a5fb0287eb
|
|
| MD5 |
b713b2410d383c82e37fe586e09abf5b
|
|
| BLAKE2b-256 |
6eb82e559c6b73897dd1dd7057c71a761532ddbee8857ae7a634ab5f1284dbfe
|
Provenance
The following attestation bundles were made for bolyra-0.4.0.tar.gz:
Publisher:
release.yml on bolyra/bolyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bolyra-0.4.0.tar.gz -
Subject digest:
866e5b4c498c7520bcb34a75dcaac4904d44bb9c5e07e5f10ba7c6a5fb0287eb - Sigstore transparency entry: 1809246413
- Sigstore integration time:
-
Permalink:
bolyra/bolyra@cb443745ce687ea1cf7b101a0504aa1a2c2e2f04 -
Branch / Tag:
refs/tags/bolyra-python@0.4.0 - Owner: https://github.com/bolyra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cb443745ce687ea1cf7b101a0504aa1a2c2e2f04 -
Trigger Event:
push
-
Statement type:
File details
Details for the file bolyra-0.4.0-py3-none-any.whl.
File metadata
- Download URL: bolyra-0.4.0-py3-none-any.whl
- Upload date:
- Size: 21.7 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 |
179d93ffb8a6f31547b0649289dba2eeea4f3d8d717cd0ea1abfc2fc300221d8
|
|
| MD5 |
82eba95b9e085e6cbdee971e90fbdb63
|
|
| BLAKE2b-256 |
4fe0af373207d9051869c41d585d4efd4dd4e632973911395ba6a23b9ee7bdce
|
Provenance
The following attestation bundles were made for bolyra-0.4.0-py3-none-any.whl:
Publisher:
release.yml on bolyra/bolyra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bolyra-0.4.0-py3-none-any.whl -
Subject digest:
179d93ffb8a6f31547b0649289dba2eeea4f3d8d717cd0ea1abfc2fc300221d8 - Sigstore transparency entry: 1809246418
- Sigstore integration time:
-
Permalink:
bolyra/bolyra@cb443745ce687ea1cf7b101a0504aa1a2c2e2f04 -
Branch / Tag:
refs/tags/bolyra-python@0.4.0 - Owner: https://github.com/bolyra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cb443745ce687ea1cf7b101a0504aa1a2c2e2f04 -
Trigger Event:
push
-
Statement type: