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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.1-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.1-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.1-cp38-cp38-win_amd64.whl (368.9 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.1-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.1-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.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e52b4bfbe88d18803e2fe1df69ba25419f3783e423725ccca85584817b3f57ed
MD5 d5d399ac16343698c9be59a14305afbf
BLAKE2b-256 c31d50a098be4b6acc86a86bc70bf9809abcb71ad24fbaf5e074db6aac5f2ffd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 79a96731db97dac98e75cb1223edc84ae6537898c51feed1603e3f5f966cf51d
MD5 102b03cbf64513f3ebff6304a832870d
BLAKE2b-256 afecff5e642c05a0f8721506884dd43f401dc6f6aac79e5bbc8ae94b27bcd864

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 d7bff1c42f53e050c7f47bfea5c67c1c5200be28e1c00b12c754ddd60137402f
MD5 d2076056ad8f78a0082938d4a24589dd
BLAKE2b-256 fd631d40e6a09a1010cac5cec7584cd20d05490d40a53c6a90909e8512a812b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 537403c130330f46ad735b2c95ef9c9d575a54c883f49528f7014b5d735c0feb
MD5 fbb879911d56b054d6406434318b4f63
BLAKE2b-256 fecb9de809e90cd00209561e349cbc68923a47ab16e49a25e9c3091fc0be3a44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 de2ce721f39261141f5b316047b88f1b42628842acd6d0c26b96edaa571bcafc
MD5 4df5cfb9c2bff701f07515f39a0cb9b7
BLAKE2b-256 5885eb4f9a2dd148e5f43c9be0da725bbd4a55f346e1a9289ace9e9308d20e6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.1-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 b26cb764c0244a2d0fb541afe9e7afe54f46bf5620e93ca612dda43956e27c24
MD5 d66f2428a14309f27ba92a48852cc378
BLAKE2b-256 0457f2e55ee23ea46fbfae0df8eb6becc95437d885ae932fde711a3541cc6caa

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