Skip to main content

SignedByMe SDK - Self-signing digital signatures with zero-knowledge proofs

Project description

SignedByMe Python SDK

Human-controlled identity for autonomous agents.

Installation

pip install signedby

Quick Start

For Agents - Authenticate to Enterprises

from signedby import SignedByClient

# Load delegation from your human owner
client = SignedByClient.from_delegation("./delegation.json")

print(f"Your npub: {client.npub}")
print(f"Authorized for: {client.scopes}")

# Authenticate to an enterprise
token = await client.login(
    client_id="acme-corp",
    nonce="random_nonce_here"
)

# Use the OIDC token
print(f"ID Token: {token.id_token}")
print(f"Subject: {token.sub}")

For Agent Setup - Initialize Identity

from signedby import SignedByAgent

# Initialize agent (creates DID if first run)
agent = SignedByAgent.init(storage_path="./agent_data")

print(f"Agent npub: {agent.npub}")

# Configure email mapping for enterprises
agent.set_email_mapping({
    "amazon.com": "you@gmail.com",
    "acme.com": "you@gmail.com"
})

# Connect to relay and watch for authorizations
agent.connect_relay("wss://relay.privacy-lion.com")

async for event in agent.watch_for_authorizations():
    print(f"New authorization from: {event.enterprise}")
    print(f"Scopes: {event.scopes}")

Error Handling

from signedby import (
    SignedByClient,
    SignedByError,
    DelegationRevokedError,
    DelegationExpiredError,
    ScopeDeniedError,
)

try:
    token = await client.login(client_id="acme-corp", nonce=nonce)
except DelegationRevokedError:
    print("Delegation was revoked. Contact your human owner.")
except DelegationExpiredError:
    print("Delegation expired. Request renewal from your human owner.")
except ScopeDeniedError:
    print("Not authorized for this enterprise.")
except SignedByError as e:
    print(f"Authentication failed: {e}")

Requirements

  • Python 3.9+
  • Supported platforms: Linux (x86_64, aarch64), macOS (x86_64, arm64), Windows (x86_64)

Documentation

License

SignedByMe Source-Available License v1.0 (SSAL-1.0)

See LICENSE for details.

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

signedby-0.1.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

signedby-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (284.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

signedby-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (296.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

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

File metadata

  • Download URL: signedby-0.1.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for signedby-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bace4b2daf02f6842be3042f0829b075766cd2dcba279782cad6301f1ec28aca
MD5 c93eb44762b75f7e2609c18784be58c1
BLAKE2b-256 25f5537ef2e6c5d646b7c476aaf056e0ab0cf615e685165c81f17cd00c978c5c

See more details on using hashes here.

File details

Details for the file signedby-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for signedby-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 be06c2e480ad8c6c986538586ff62d74643296ef451cd38a555116f119f66718
MD5 ee55bfc3a190756e83abbafde885c2f0
BLAKE2b-256 ab03a2478bbf97468d1c3d609654e514c462a01905bd6c1321a454aa0612382d

See more details on using hashes here.

File details

Details for the file signedby-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for signedby-0.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 992554fb8dd5a5464c6b3cdde2521f605b114e7a2e33c5ec473ebac76fcb45c5
MD5 3e9312d2d364e43a620c8e36019269aa
BLAKE2b-256 29a2ac9648c8eb879fbf808201fb3a57b0799705830765e23e708963fa49f293

See more details on using hashes here.

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