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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.0-cp312-cp312-manylinux_2_17_x86_64.whl (485.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.0-cp312-cp312-macosx_15_0_universal2.whl (363.0 kB view details)

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

colibri_stateless-0.6.0-cp38-cp38-win_amd64.whl (368.9 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.0-cp38-cp38-manylinux_2_17_x86_64.whl (482.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.0-cp38-cp38-macosx_15_0_universal2.whl (361.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6d1965a913bc3a33f91846e30ebcca68c6e54c3d60bbe066b0cf84a60c15c00c
MD5 fc7d11641f1da3af05aa523361b0c715
BLAKE2b-256 46ce9d117699d272eacd42be52156f3dfabf14355fc49276cf815d5b37125481

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 768b29c9898c0ed1e18fb72d2ffdf63c9d45726ce6787b2f9b700e76c1ce67d5
MD5 244736d664c63a79348baf3d1899a5e6
BLAKE2b-256 5a02881aec7df3861f6bab65043043cb2d72b0b6da2d750a9b6fe7a3405b8c89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 04fb88ecebefc7e9634d17b205b16a831fe5c9fe2ccd80f058f4ae106831ee5e
MD5 272c8251bc5bce1c188c2daaaf72e3cc
BLAKE2b-256 8f517919fc790d4c613387f15fb8e974336e9c46278ac7e0db6755bb36026c21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 97c28ddb13aec7848ed27e2935abec5fd4648b8ecf5aac359bc2433415935272
MD5 2d52674d642042278b5858b27e035a6a
BLAKE2b-256 825af6b0d266ba00856e6717dd75122cfb558e795c5b8ff5e35e993602d09bff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1adbfbf8724ba40bc62e2c85caf98244a9394a2eadda8ca46df5b51c5810036d
MD5 cc2a1a708d24988a1f6ba80f47cebd9c
BLAKE2b-256 e7396ca6c4e7583771079ff16fe7468fba0be3ce898e283cc7c1c6bea9539637

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.0-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 53cabf83dd2b8bd9a90e90aca855a700ffd0747c04242bcb7b70e4acde28ca49
MD5 e480e7a54e2d33211b5671ad5c740d23
BLAKE2b-256 fc5bd67e4a586ff62173a54683d2f3c5f073d7efac27d9fe8146cf15b8ff8fc4

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