Skip to main content

A production-hardened enterprise solution for Decentralized Identifier (DID) key recovery by Sirraya Labs, offering three complementary recovery architectures—social threshold recovery with multiple guardians, deterministic seed-based recovery, and distributed MPC recovery with proactive security. Built with AES-256-GCM encryption, circuit breakers, audit logging, and metrics collection, it ensures secure key recovery without vendor lock-in. Deploy as a Python library, CLI tool, or REST API server.

Project description

Sirraya DID Key Recovery (DID-KR) Enterprise v2.1

License Python 3.8+

A production-hardened implementation of Decentralized Identifier (DID) key recovery by Sirraya Labs.

🏢 Sirraya Labs - Enterprise Implementation

This is the official reference implementation from Sirraya Labs, designed for enterprise-grade DID key recovery with production-ready security and mathematical rigor.

🔥 Key Features

  • Three Recovery Architectures:

    • 🔐 Social ZKP Recovery - Feldman Verifiable Secret Sharing with t-of-n guardians
    • Deterministic Temporal Recovery - Seed-based recovery with PBKDF2
    • 🤝 MPC-Mediated Recovery - Threshold cryptography with proactive refresh
  • Enterprise-Grade Security:

    • AES-256-GCM encryption with AAD
    • Circuit breakers for fault tolerance
    • Comprehensive audit logging
    • Metrics collection
  • Multiple Interfaces:

    • 🖥️ CLI tool
    • 🌐 REST API (Flask)
    • 📦 Python library

📦 Installation

# Basic installation (core crypto)
pip install sirraya-did-kr

# With API server support
pip install sirraya-did-kr[flask]

# With Ethereum DID support
pip install sirraya-did-kr[eth]

# Full installation (all features)
pip install sirraya-did-kr[full]

🚀 Quick Start

As a CLI tool:

# Generate DIDs
sirraya-did-kr generate-dids --count 5

# Setup social recovery
sirraya-did-kr social-setup --did did:key:z6Mk... --guardians did:key:z6Mk... --threshold 2

# Start API server
sirraya-did-kr --api --port 8080

As a Python library:

from sirraya_did_kr import RecoveryService, RecoveryDatabase, MemoryCache

# Initialize
db = RecoveryDatabase("did_kr.db")
cache = MemoryCache()
service = RecoveryService(db, cache)

# Setup social recovery
result = service.setup_social_recovery(
    did="did:key:z6Mk...",
    guardian_dids=["did:key:z6Mk...", "did:key:z6Mk..."],
    threshold=2
)
print(f"Recovery setup: {result['recovery_id']}")

As an API server:

# Terminal 1: Start the server
sirraya-did-kr --api --port 8080

# Terminal 2: Test the API
curl -X POST http://localhost:8080/api/v1/did/generate \
  -H "Content-Type: application/json" \
  -d '{"method": "key"}'

📚 Documentation

API Endpoints

Method Endpoint Description
GET /health Health check
GET /metrics System metrics
POST /api/v1/did/generate Generate new DID
POST /api/v1/recovery/social/setup Setup social recovery
POST /api/v1/recovery/social/refresh/<did> Proactive refresh
POST /api/v1/recovery/deterministic/setup Setup seed recovery
POST /api/v1/recovery/deterministic/recover Recover with seed
POST /api/v1/recovery/mpc/setup Setup MPC recovery
GET /api/v1/recovery/validate/<did> Validate recovery graph
GET /api/v1/recovery/status/<did> Get recovery status

CLI Commands

sirraya-did-kr generate-dids [--count N] [--method key|ethr]
sirraya-did-kr social-setup --did DID --guardians DIDS... [--threshold N] [--auto-refresh DAYS]
sirraya-did-kr refresh --did DID
sirraya-did-kr det-setup --did DID --seed-phrase WORDS...
sirraya-did-kr det-recover --did DID --seed-phrase WORDS...
sirraya-did-kr mpc-setup --did DID --providers DIDS...
sirraya-did-kr status --did DID
sirraya-did-kr validate --did DID
sirraya-did-kr --api [--port PORT]

👨‍💻 Author

Amir Hameed Mir - Principal Architect - Sirraya Labs

📄 License

Apache 2.0 - See LICENSE file.


Built by Sirraya Labs for production-grade decentralized identity systems

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

sirraya_did_kr-2.1.2.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

sirraya_did_kr-2.1.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file sirraya_did_kr-2.1.2.tar.gz.

File metadata

  • Download URL: sirraya_did_kr-2.1.2.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.3

File hashes

Hashes for sirraya_did_kr-2.1.2.tar.gz
Algorithm Hash digest
SHA256 caee3090c0927840540b6560bb9b19578d0891064be2a49633716bec2ea1fc53
MD5 065e8bc716ea8898be8cb6e2576b5f5c
BLAKE2b-256 4169cdfa10e62c529befade184f0db1ceef0471a13e52a689336635e08883a94

See more details on using hashes here.

File details

Details for the file sirraya_did_kr-2.1.2-py3-none-any.whl.

File metadata

  • Download URL: sirraya_did_kr-2.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.3

File hashes

Hashes for sirraya_did_kr-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 065cfb50ea4c6bca1e17fdf51114a1a74836e07ac837bfe9309a3ed650be7f05
MD5 70698710299ce18a145aa8515885f1bf
BLAKE2b-256 ae38c3314ac9ba6e7ffbc27b515223d5360c0e33bfcccf6f7c2e6ddebbd50494

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