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.9-cp312-cp312-win_amd64.whl (371.3 kB view details)

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.9-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.9-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.9-cp38-cp38-win_amd64.whl (369.5 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.9-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.9-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.9-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5a210a6907abeb3890f8eb4835c9f23b13ddd48182b549e7b87dc633ed582c63
MD5 8f575a1f9accf3dd1b0c8a210aed8e38
BLAKE2b-256 b1c1e3f2d4e5ed9825c7ab63be746ec0ac2b166e5462ef37ee668913f973ee52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 943ab7ace9d0a6f28273fb0707f9f46c8003f527a914a6e5420b898a59425bca
MD5 12acd17a780fd04ef153bcf8ed971b74
BLAKE2b-256 9088cb9471f5a161d732139322d22f31924f6d37da6eaf352692b9ec9683842a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 7f4a7644dd0a5dbef8375608277b2ea761b49376adab440627332283fc623e83
MD5 5c5abb701d39de18016820b86e633a63
BLAKE2b-256 1c7b1d820be87efcdb2464bf750af5e41cf15d90d260ca0c1041e07bca8a0121

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 199058377e80a403ad9a8b39b73e58e109541eed96f0f5dcb0104d68a2076a6e
MD5 71ba868187933dade24d9caa62ce0487
BLAKE2b-256 89a5f4cfde322a19a512dbe84c1ac18760e7669d0676e7479771084de6862286

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8189c59c2a76f293ae590708d58f5ed02896618f6736be440e6aca7b68648ee1
MD5 cd3b39e2b11733b6b2783f8342b527da
BLAKE2b-256 261a14c2031d236a4984bbd9832c87f5b3bdeb8af65d49d1ce2906e4375ddd4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.9-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 0d58e87e51d9f8bef7220af4384eaf6146b9f58020134a05013c988136b0f77a
MD5 a03dee05a7a42e6dd068afa68ae8c6eb
BLAKE2b-256 fb68c6e103b1817f2815b760161e175ffb7c13f54c722ac22c76fbd054372a55

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