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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.7.1-cp312-cp312-manylinux_2_17_x86_64.whl (487.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.7.1-cp312-cp312-macosx_15_0_universal2.whl (364.0 kB view details)

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

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.7.1-cp38-cp38-manylinux_2_17_x86_64.whl (484.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.7.1-cp38-cp38-macosx_15_0_universal2.whl (362.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 15fe6fb799afaa93dbcc42c3e3d0f0647166f4087630b58882d5619d3c21ef35
MD5 6e2a2e8665e99cddba2551816a8e984b
BLAKE2b-256 c7bb0bce56427c5d8ae359bce810bc905468d74fe07437c5bf2dacb6f53dfe80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d1dd590697d278313ceb7a11a79c67cf19d490af31cc72fa6a606db957edd5e0
MD5 b91929afc0e56852a77c2066be59555e
BLAKE2b-256 35f0668ea897a399699b921c82a6aec9ba5debae0ca2e204a0cdecb05179b0de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 d3f32f5ae55d1da13cc9e593ab1ef8ded0cbbbce6651382d9f815816d54b5db5
MD5 0a56c3def29a1ce4522b407ed97cdda8
BLAKE2b-256 1ea439dd11a0a65415e95d2c9fd04735245461a8c465e82229a77faadc3cd4ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bcabe236b07b13ba12ff81ca9194da4455af06ec8379d3fafb236aeb3b9920b7
MD5 00ecac041baa2e9a27e567e012b577c2
BLAKE2b-256 ff80174ebd32ebd511ae586d5c60a9461fb46e5177cb9c22eab610a17072c080

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 38a84d9c5a99d92bd4e3cdcf860849e607bdfa9c971851d6fe13ced877b1cd8c
MD5 e3baf7658289e8bf86ca1929f17866fc
BLAKE2b-256 7ab9397f3345f12ef05cd3ad27c87cc08c05cc542a33c0dc51e696e84476f7b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.1-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 0ca3a2bd7c030846dc4fb9116a15c7d4def034c9f224fb0e3f503dccada92331
MD5 ebd9f4938c0d1fddaa3730162a9cbbea
BLAKE2b-256 567877c0b16a38c5c0004bfc5126423fc8580be85f2b133012899cc5e4b08ac0

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