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, proofers=["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.1.1-cp312-cp312-win_amd64.whl (357.3 kB view details)

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.1.1-cp312-cp312-manylinux_2_17_x86_64.whl (472.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.1.1-cp312-cp312-macosx_14_0_universal2.whl (356.2 kB view details)

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

colibri_stateless-0.1.1-cp38-cp38-win_amd64.whl (355.4 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.1.1-cp38-cp38-manylinux_2_17_x86_64.whl (470.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.1.1-cp38-cp38-macosx_14_0_universal2.whl (353.6 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 09bf185c05d30521dca644519e18f621719f88a8fc91f3a48a528847d5b192a8
MD5 b9bf2bd76df15d701bd72a522d44b433
BLAKE2b-256 b772fdc6a920e24af2916d7dacef570bd6ce569d6115559f3c2192e13d619b3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6ac71acf42f68e34c06be1bc4b5e209bb6d56070c0214696cd46636249ad058f
MD5 a91f8c3571e90dfb86f97e40dae689e8
BLAKE2b-256 16797bb45ae49b49f1eddb191fbf311de3a963c69e14449bd1f71ecc0f26ce54

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.1.1-cp312-cp312-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp312-cp312-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 fcefba7dc95778cf9a50638ade4014f9b7463e7890d1d4cbe3de3be23180bd8e
MD5 49c8255d8542702a28802a5fc3994241
BLAKE2b-256 5c86e924fab3029970d01f0ede71ea05c98b29891491658dd059def8adb9801c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 01b3d1eebac2996cdcdce4ba14368dddebb27a5dd8ee6c2f9576bc986d9f9e69
MD5 9115fc5686bf4d1ae72dae92a773a375
BLAKE2b-256 8f1196399b9887867087d0e18d24994f62769288ce2ed9779f0b044ae16fa5f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d59c93a876e0b13f047e6cd5397a91c6c60776456345afaaa638f73a27a3c67e
MD5 7526104452df43a07cc32ba40032287d
BLAKE2b-256 40dd367b94121246226553d099487d504d945663cf17dcd22688aae6210954f6

See more details on using hashes here.

File details

Details for the file colibri_stateless-0.1.1-cp38-cp38-macosx_14_0_universal2.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.1.1-cp38-cp38-macosx_14_0_universal2.whl
Algorithm Hash digest
SHA256 b09e4003f9819b705556db6a08b80d80c7da5de9f8f783ddefefe56a2abdafe8
MD5 c664c878547b6311b2b8f131561a7a87
BLAKE2b-256 d64528a6d22cbba0f646894bd1c06452dc9af8f8a17b4e4e2cc8eb465daaeee1

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