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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.4-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.4-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.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b1659ce409e609079f6e4185fc568c2f742753d10b0bfd7f70d067047f929975
MD5 fdf509ebb3c6e9b9d1a9ff97b1f4cbfb
BLAKE2b-256 769866446a92315ffbb182a61defdcced9ce1d843aaa18114755bd135d594e2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a5216652d37048ce858dc68ff63ef6e437f4aa20b8bb478bc7cf525978f5f471
MD5 6ea2cbd94eb993fe726c44880d2395aa
BLAKE2b-256 14cf32d53ba4a8cccccd366f6cd68d704a01cd0cbca30a49b98b555a9a9d2d88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 7d1efdf980b03641b00f141ba10e9f5f7ec69552f12de547b57abd1202d62f63
MD5 737ffe8dff7703c6b8bf8f8da922af07
BLAKE2b-256 113c72675a05fa2b41baccb5ca2ee530fe34c6a833f85c1ca3233169e34d73b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e6693adea0570d2137bbde10fbf7cfd4538eac319560133eaafd0019d5c8dd7e
MD5 e9e7941df05e27a33832cc16b5882a7c
BLAKE2b-256 106808293ea6b2d82eb47c19d00bff5e6986db4e2f963104c6fe69b78c7bcc25

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 784f6e8c5584cd99c81f5bd16da3182f36e9e4f95e08b4f2dab58eb389bf8f09
MD5 f1019fca50122670bbeb0cdaaed3aeb0
BLAKE2b-256 52d66e1150e1dd90e1ee7ed0f9eb44e68624dd4e6cd75c35a8cb245cfd8ec226

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.4-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 bc2227b3b922a8eb63804c14f8f6d87e18055e1dd2a922375088ce4b6bd5b7e1
MD5 7f8c7a86925b1017ba9ff8d6252437d3
BLAKE2b-256 6fdc859a7bfb1afc64c77c816bf5ab82d04956c13b190f446f6abed450487b8f

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