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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.6-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.6-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.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 89ee9efe1edae5c2959b2c79dd929a20d5438184379d8e6bd4146b0ffe075b4c
MD5 0d48fd9c86e662f116e6b10298440de6
BLAKE2b-256 56277b71f0f1361684e5f92422a5a4681266cadab597ebde30140eac61865539

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 65ac693d47d34c78242eceaadec637a91786b19675c6e86d0538167b31266e91
MD5 822c4591004043cc2cae37969196db25
BLAKE2b-256 acd75b922d51042dabd73581c54dc31aead44bf519f78ff4a7d7209f958767c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 15da50d2945a88dfc30bb89d0f6112d001788a30453a686a0392900c58c2e5ba
MD5 43b4261ea21f60f81733281ce76a2862
BLAKE2b-256 47dfe8cfbad521f8a6d1d75dcb5e49928d0e0df941bc74a26f44b8bc5697a922

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 516df739a456c41d0382cdb61bc6cd335949eab47c622ffc5153f8814d82f3a1
MD5 20d74c69f14349857491997c42725393
BLAKE2b-256 fdf918d336f17161623148bc340390517dfe42e90c1110f0c3d20a0f88380ca9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e386048f7d6ce0025db8878e07c979d13ac0f8d7870a94f9afebd9d2d3aafda5
MD5 6494eb4237d4470ef83e0f728015cd04
BLAKE2b-256 56ff46afadf8e2e48b9ac8ecd223ae9327f018a104bf72de69ad9fb3e44a7eb3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.6-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 c3e78b4b92c2e4c379b061a0ea20951b19f6045a77ffdb6c38ab578b65c455f9
MD5 c7c5b8754dd9b36889d7848a5a485da6
BLAKE2b-256 00aa5ed16e0566720b3d51573b560863ab775305fe30c6f1f01646e3d6b7b47f

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