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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.2-cp312-cp312-manylinux_2_17_x86_64.whl (486.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.2-cp312-cp312-macosx_15_0_universal2.whl (363.5 kB view details)

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

colibri_stateless-0.6.2-cp38-cp38-win_amd64.whl (369.1 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.2-cp38-cp38-manylinux_2_17_x86_64.whl (483.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.2-cp38-cp38-macosx_15_0_universal2.whl (362.0 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8c326a36a0d54d82540328debdccb28fa4e546b554b390bfe75c0aef711012f4
MD5 ca9a908953497dc59c3e33bba3ab8b42
BLAKE2b-256 468a8f8ad9ee42b7d31d0287966c652a1982582afe651559d49168e09c058318

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 51b8c205a584c7c3c47c1ee77722fb148636001f0ea95bd08dd5e9ca0dcec494
MD5 8fc4ced4a4c54dc3d8e8310265d94972
BLAKE2b-256 bc763c9dd55f8bee4d1cf3b129e9439999f6fbdecc3935844b274c371d2caa6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 e087110e5626199d48aa147b9e557478e7bd0003f7ab9ab31a957086121d13a9
MD5 e50f5a4f17186ea133f03b4e7a7bc7a7
BLAKE2b-256 ba3e4949a0658e0478842b7f97455fe75ca60c797b6fc7b2619f192d33e90bc6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ac44783b6d227d00b061666c8ad4c9bdfa04028a70d49802b69609b87ad4343a
MD5 bcc8959d9ee6cdc1b97acfb2323ec45d
BLAKE2b-256 53e916fec3cd76d831f81d19d0215d42c39cd91fc1f27cce5ce071c9cc399ac4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5f9bad944768e89c6f85121394ea0c54e20ba11ffc095de30a28025ee2e33976
MD5 8f986f0fa6e6b52469d04c15daaecc9b
BLAKE2b-256 e400877f6e880bb5ed3202114b250fb257e707d67857ca477bd5bcf55adfe11d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.2-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 3a2348a52e6a41d85158b286554ceed98d7f604747198ef73ad3a6763616bc0d
MD5 48071c26ad6dad62a450e31011f0d3cc
BLAKE2b-256 094d36579ad9493c383bc6aadf7bdef7947672862e0c2a98de0d604acd8ed882

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