Skip to main content

Python bindings for Colibri stateless Ethereum proof library

Project description

C4 Logo

Colibri Python Bindings (corpus core colibri client)

ETH2.0_Spec_Version 1.4.0

The colibri client is a stateless and trustless ethereum client, which is optimized for the mobile apps or embedded devices, because it does not hols the state, but verifies on demand.

🚀 Quick Start

Installation

pip install colibri-stateless

Basic Usage

import asyncio
from colibri import Colibri

async def main():
    # Initialize client for Ethereum Mainnet
    client = Colibri(chain_id=1, provers=["https://mainnet.colibri-proof.tech"])
    
    # Make verified RPC call
    result = await client.rpc("eth_blockNumber", [])
    print(f"Current block: {result}")
    
    # Get account balance with proof verification
    balance = await client.rpc("eth_getBalance", [
        "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5", 
        "latest"
    ])
    print(f"Balance: {balance}")

# Run async function
asyncio.run(main())

✨ Key Features

  • 🔐 Cryptographic Verification - All RPC responses verified with Merkle proofs
  • 🚀 Async/Await Support - Modern Python async support for network operations
  • 💾 Pluggable Storage - Customizable storage backends for caching
  • 🧪 Comprehensive Testing - Mock HTTP requests and storage for testing
  • 🌐 Multi-Chain Support - Ethereum Mainnet, Sepolia, Gnosis Chain, and more
  • 📦 Easy Integration - Simple pip install with pre-built native extensions

📖 Documentation

Full Documentation: GitBook Guide

  • API Reference - Complete class and method documentation
  • Storage System - Custom storage implementations
  • Testing Framework - Mock data and integration tests
  • Configuration - Chain setup and advanced options
  • Building from Source - Development and contribution guide

🛠️ Development

Building from Source

# Clone repository
git clone https://github.com/corpus-core/colibri-stateless.git
cd colibri-stateless/bindings/python

# Build native extension
./build.sh

# Install in development mode
pip install -e .

# Run tests
python -m pytest tests/

Integration Tests

# Run with real blockchain data (offline)
from colibri.testing import discover_tests, run_test_case

tests = discover_tests()
for test_name, test_config in tests.items():
    result = await run_test_case(test_name, test_config)
    print(f"Test {test_name}: {'PASSED' if result else 'FAILED'}")

📋 System Requirements

  • Python 3.8+
  • CMake 3.20+ (for building from source)
  • C++17 compiler (for building from source)

🔗 Related Projects

  • Core Library: colibri-stateless
  • Swift Bindings: iOS/macOS native integration
  • Kotlin Bindings: Android/JVM integration
  • JavaScript Bindings: Web/Node.js integration

📄 License

MIT License - see LICENSE for details.

🤝 Contributing

Contributions welcome! Please read our Contributing Guide and check the Development Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

colibri_stateless-0.6.5-cp312-cp312-win_amd64.whl (371.3 kB view details)

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.5-cp312-cp312-manylinux_2_17_x86_64.whl (486.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.5-cp312-cp312-macosx_15_0_universal2.whl (363.7 kB view details)

Uploaded CPython 3.12macOS 15.0+ universal2 (ARM64, x86-64)

colibri_stateless-0.6.5-cp38-cp38-win_amd64.whl (369.5 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.5-cp38-cp38-manylinux_2_17_x86_64.whl (484.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.5-cp38-cp38-macosx_15_0_universal2.whl (362.1 kB view details)

Uploaded CPython 3.8macOS 15.0+ universal2 (ARM64, x86-64)

File details

Details for the file colibri_stateless-0.6.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a5c8d4862ae95691bdcfe44c865fdcb6ca2b364bcc117c914193042c0a61be2
MD5 33e5603b5e7c8150b56d0afe7fca1f76
BLAKE2b-256 0070aef4fb6cf2ad2d20fd1bf804e6e45df1e4089996993d5cfc62200b70ec49

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.6.5-cp312-cp312-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a5d36c4c41d768128f5f95ec00a407a41e4faf40da9ff58788a8b689be72b672
MD5 5fb838a92491d9302a09f27f015b1a33
BLAKE2b-256 78419a6942692767fedb39c373106d68b8eeab2e4223c6e7ceab7a1b79a293c7

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.6.5-cp312-cp312-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 a8b80a204fe4461dd4a3ab13928c8feada5ceb7f841d4eef454bd48077b17974
MD5 0c7de22b3f910d0f8d8ffc546e0fd692
BLAKE2b-256 da046d89afee98c335ce534b1ff0621e8fbf75202e9359b110b9243d75ec60e8

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.6.5-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9816dbb8ccd3a117d3c86219846aa4b63c459098680779a4cdf7498ddf08fd3c
MD5 5a3d983047a4db28e3e60b96e2910734
BLAKE2b-256 7a9a39ac563034fcf72dfa1289a9e41a0ee4ff720b96800dc0e643ff932b799f

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.6.5-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 39fea888948bff6bbae77cac5419ac13f678cda3fe040cd6d1a66a310f72740f
MD5 76563c5fa74cf94e9cd607e7ae93486d
BLAKE2b-256 17e1c3ccb50f4b1418169364afbf751c6cffe6292a9dbe5b900a819c15964298

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.6.5-cp38-cp38-macosx_15_0_universal2.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.5-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 682b5cb8b92876dee84de69e57b7e292d8afbde73220771eec02dfcde03329c5
MD5 b8ea8c585f205d763e98ac4fb1cb4663
BLAKE2b-256 571c5f5c806a509495dbdc40021f16175b6d39d27d12b79a699737a4ec789537

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