Metadata-Version: 2.4
Name: bitseal
Version: 0.3.2
Summary: Python SDK and offline verifier for the BitSeal cryptographic proof-of-existence service.
Author-email: Orygn LLC <security@orygn.tech>
Maintainer-email: Orygn LLC <security@orygn.tech>
License: MIT
Project-URL: Homepage, https://bitseal.orygn.tech
Project-URL: Documentation, https://bitseal.orygn.tech/docs
Project-URL: Repository, https://github.com/OrygnsCode/BitSeal-SDK
Project-URL: Issues, https://github.com/OrygnsCode/BitSeal-SDK/issues
Project-URL: Authority Key, https://bitseal.orygn.tech/.well-known/bitseal-authority-key.json
Project-URL: Key Ceremony, https://bitseal.orygn.tech/legal/key-ceremony
Project-URL: Security Policy, https://bitseal.orygn.tech/security
Keywords: bitseal,proof-of-existence,cryptography,blake3,ed25519,sha3,merkle-tree,timestamping,opentimestamps,bitcoin,provenance,digital-integrity
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Legal Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Archiving
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: blake3
Requires-Dist: cryptography
Requires-Dist: filetype
Requires-Dist: numpy
Requires-Dist: opentimestamps
Requires-Dist: pillow
Requires-Dist: requests
Requires-Dist: rich
Dynamic: license-file

# BitSeal Core SDK

<div align="center">

<img src="logo.svg" width="120" alt="BitSeal Logo" />

### The Digital Integrity Standard

**Official Website:** [https://bitseal.orygn.tech/](https://bitseal.orygn.tech/)

[![Website](https://img.shields.io/badge/Website-bitseal.orygn.tech-22d3ee?style=for-the-badge)](https://bitseal.orygn.tech/)
[![License](https://img.shields.io/badge/License-MIT-white?style=for-the-badge)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?style=for-the-badge)](https://www.python.org/)

</div>

---

## Overview

**BitSeal** is a cryptographic proof-of-existence service. It creates tamper-evident, timestamped proofs for files using BLAKE3 Merkle trees and Ed25519 digital signatures.

This repository (**BitSeal-SDK**) is the reference implementation of the protocol. It contains the full cryptographic pipeline: chunking, BLAKE3 Merkle tree construction, Ed25519 signing, and both online and fully-offline verification. Every seal produced by the web service at [bitseal.orygn.tech](https://bitseal.orygn.tech/) can be verified end-to-end against the code in this repository without trusting the web service itself. The unified manifest format (`merkle-blake3-64k-v1`) guarantees that a web seal and a CLI seal of the same bytes yield the same root hash.

**Trust Code, Not Corporations.**  
*Developed by Orygn LLC.*

---

## Features

*   **Ed25519 Signatures**: High-performance, high-security Edwards-curve Digital Signature Algorithm.
*   **Dual-Hashing Architecture**:
    *   **BLAKE3**: Blindingly fast local client-side verification.
    *   **SHA3-512**: NIST-standardized (FIPS 202) secondary whole-file digest for cryptographic redundancy.
*   **Merkle Tree Manifests**: Tamper-evident data structures for seal logs.
*   **Client-side hashing**: Files never leave the device during the sealing process. Only the manifest is transmitted.

---

## Installation

```bash
pip install -r requirements.txt
```

## Audit & Verification

This code serves as the reference implementation for the BitSeal protocol.

### 1. Verify a Seal (Reference Script)

You can run the included script to verify any seal root hash generated by the [Evidence Sealer](https://bitseal.orygn.tech/seal):

```bash
# Online: look up the seal on the public ledger and verify its signature
python verify.py --root <ROOT_HASH>

# Offline: verify a downloaded manifest.json with no network access
python verify.py --manifest path/to/manifest.json
```

Offline mode reconstructs the 40-byte signed message (`root_bytes || little-endian f64 timestamp`) and runs an Ed25519 verify against the Authority public key. Supply `--public-key` to pin a specific PEM; otherwise the current key is fetched once from the well-known endpoint.

### 2. Python Integration

Developers can import the core logic to build independent custom verifiers:

```python
from BitSealCore import BitSealLedger

# Initialize the public ledger reader
ledger = BitSealLedger()

# Verify a seal hash
result = ledger.verify_seal("c868c3e09...")

if result['valid']:
    print(f"✅ Authenticated: {result['timestamp_utc']}")
else:
    print(f"❌ Invalid: {result['error']}")
```

---

## Verification Logic

 The core verification process (`BitSealCore.py`) performs the following checks:
1.  **Format Validation**: Ensures the hash is a valid hex string of correct length.
2.  **Ledger Lookup**: Query the public ledger for the existence of the seal.
3.  **Signature Verification**: Cryptographically verify that the seal was signed by the **BitSeal Authority Key** (Ed25519 Public Key).
4.  **Integrity Check**: Recompute the hash of the manifest to ensure no data has been altered.

---

## Legal & Compliance

BitSeal logic is designed to meet standards for digital chain of custody.
For full legal documentation and the technical whitepaper, visit the [Documentation Portal](https://bitseal.orygn.tech/docs).

---

## License

This SDK is available under the MIT License.
&copy; 2026 [Orygn LLC](https://orygn.tech). All Rights Reserved.
