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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.8-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.8-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.8-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 010002b003bffcfdfeb01f501318c62e5fc1063a0e4e322f52373836bf750b3b
MD5 a009c87e43f2b692381c2a9396da279b
BLAKE2b-256 993ee6c4c1ecfb80c11d7f35ace7e60df07abff9e2bbae596b1da1e09fbda1a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 aba91f2ed52e2b7e5b964cb18315fe7b78c55139a695eed9b05677e78a35952b
MD5 3f5c9b36182f700796d5a7db3d226615
BLAKE2b-256 cc3b1aa89dea87701cca0398c116e4ccd3ed75760a0c58c42a42afba70521424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 ec6a84dfa2c37214fedce13542fd955e72b8537a48e86383d7b17f0eba3c462d
MD5 8851a37f2f32e70d1cd05460259c6035
BLAKE2b-256 35f78269e1e1a0d1721486204569f09470e4f4313d8f7a9079c6a4c21f4cfb17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 dc6ea226acd94b09c7e721c7f236a9527f32ecad53a7c563fa4990c00d978f8e
MD5 d2c4fc2e6efff15ed180f213ed5eb4d8
BLAKE2b-256 0c35b0ee7fbb466519add6b6314e0d046ff3ead0ea2df498b11fef6bd2f1bc66

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 522cc92119778fbfc26c8da245624974623a9556082188027b89c8dd57f881b3
MD5 f847eaaa9ae2faa92ecb6298357b6c4e
BLAKE2b-256 a7b70c1cd5a525b526ed30da233f9acafba9bdc2d0dc183509b0dcc373f1e628

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.8-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 6fc958b801baf4b98fde3922409dcb58184db16462826eb31b7b34c1cce1f312
MD5 32356c691f3eb6be4a9ded6150427b11
BLAKE2b-256 893a7c82063c4733d3d261e7f5ad1c07f3fe7e246b4d714024d7e053dafcd9fd

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