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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.7.3-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.3-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.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 62fd39ac7289769979d14ecbd4c7878c8dcee509919724a50713a99f7345c13e
MD5 90ab5fdc1f2b2b7f1edb510964275070
BLAKE2b-256 0af3d616e86e7c9d87cc1d4fbef1f240c1e56fee7db2325a291fe661557f9032

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 bc5783332951674d2e466702187c8b503446337ab345a132adbb731eeaa186b2
MD5 39f48ff66bbda5bf8c01c79828e038df
BLAKE2b-256 08941ec177aa958d03f6723dd7ebcb4c83e5198d07f1bf547e3cc5ac3ad8bbad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 e366765e0c9510ec929ed699b445d53bce9dc7a6620190f4fb3b3380c12c39f3
MD5 10da0c64a5cdb3de83001a36899b183c
BLAKE2b-256 c86ad197e7894b2f8cd5e685fa473571fcd7bd8a8fdd7aee89829063740447ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 53f9ac82d0ccde953c914512d3cd67352d2c201e59f8805ffdcd01610a1577ad
MD5 bb4782414893e052f341b48419b0f02d
BLAKE2b-256 e263e3c7e6986a52ebff7f0acd29deb762b6d95f5f336c6683144a849d14e497

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1365a72dbd75ba721a97907a356f9eaef46f37421d1db2de4339d6d48524718d
MD5 0f82be4e516e270c6beb6702c31633f2
BLAKE2b-256 e1dff54c0881413fdf3d4680fb3a39d3f7c6204920a5f7304912e357a385f8a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.3-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 8b5a23f7f3a07610bea6108dcda0d40a4bdb55a5940c5d54ace428d2552cd53e
MD5 94b5f3ad4147a34783d6284b228360fe
BLAKE2b-256 e934febf567394a902814690fbf93638f6c95a80cf8aede3cd373e093234fe70

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