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, proofers=["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.4.11-cp312-cp312-win_amd64.whl (362.9 kB view details)

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.4.11-cp312-cp312-manylinux_2_17_x86_64.whl (478.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.4.11-cp312-cp312-macosx_15_0_universal2.whl (356.5 kB view details)

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

colibri_stateless-0.4.11-cp38-cp38-win_amd64.whl (361.1 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.4.11-cp38-cp38-manylinux_2_17_x86_64.whl (476.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.4.11-cp38-cp38-macosx_15_0_universal2.whl (354.9 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3b69ce89cf11577e1b4d40cfc5bff9192b7be750f93aa43b55ef6db85fba83ff
MD5 d9139fa25314deb46a2314e128e1a877
BLAKE2b-256 f9a167a9e786299a2a44ac5bf9fa0d17495cd5f930ed9f026acf784918570fe5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2cb1f8262dc55869567a3ebdbcc7550ce2225ea0c4c762900608a8b2592d4928
MD5 845dd1003ab424b5a84441c981f41eba
BLAKE2b-256 4d14811e9d93c089eac635cdb9c5e9a708cb5ed7b4d2ff23bccb98875e229efa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 b28ae550731cd318eb819aa8b8a0b4f9c3303cff2bab610c55179dcadcf14527
MD5 1958c135c168edf210f53bcb9cfdb4ca
BLAKE2b-256 02ba68583f9332b09871615bae92d72f6bd52f103f676b5179ff57984793ac95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3fcac5692ac185131fc6aafeb334fb20cabd51efab7e42872dc80ca46a88abce
MD5 5f9c1086e84c2a3a75bb3a2103efc9b3
BLAKE2b-256 426476589bee19eda1e794919492a0e820cc6d799f1530c4f82a0da0f67f9baa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 78e3972636c5ef2888643fca5c699a5482a04116df4cecbf88657ffa253edd0d
MD5 655e45fe63634eb5ac5e7f72045dbab4
BLAKE2b-256 aff2f846e7536cc39cc30e69b7e4e782f09d180a481927ddcace2161363307f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.4.11-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 bf6b5997240b00cff1f99e41ae7e46acf41e91f05d5a6aa100937192626ec44f
MD5 1cd0030a1c5073d9c9c8cd891c2974d7
BLAKE2b-256 3ad68b5b336b9dc9ec54792dc75311e73e8097e24d496a18f039f09dbc39add4

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