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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.5.0-cp312-cp312-manylinux_2_17_x86_64.whl (478.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.5.0-cp312-cp312-macosx_15_0_universal2.whl (356.9 kB view details)

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

colibri_stateless-0.5.0-cp38-cp38-win_amd64.whl (361.4 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.5.0-cp38-cp38-manylinux_2_17_x86_64.whl (476.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.5.0-cp38-cp38-macosx_15_0_universal2.whl (355.3 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 50941e2706e76757b60757c47706034283623226c5ea45e7f88c32fba0bb28e7
MD5 b38e9581de64ae7f3dc6fd21cd99d279
BLAKE2b-256 7f8c2522954d5d228e9aa9f5ab388bb3ab22fd2ad6827f6dbf500acb16d486d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b57c38e0fbc8eb798a5d6c246f1e9856056ebf45b16b453974f4c0b2ecd1d917
MD5 aaa1d58e6f25091a80a5a0fc67672f41
BLAKE2b-256 d6946713c88f6bf2e7641d525783aac2aa694403eaf40a45a1c615f08b2f0048

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 abfc76dc72195239e46498f1b8c20db1ac740be8070e30b567ff765b19a1729d
MD5 88b935a5253d52729ac3718445ee6224
BLAKE2b-256 a6a0096422108910143a8a36c7237555e0451ab1e3ad7e48d6a720851ae62b47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7dc1a6e81640fb2b423e0e4e676e5c1f95fffd926e2150691fa10213f3f0fe70
MD5 f096878753caef0e6a336de340a28a4a
BLAKE2b-256 f45079f7c5e387f1db2ea9092a569d8014f89ab5f9c43942a09d2ac3cfc78186

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2bacc1e5d508035c8451a33fbedc19e67343862095a50736ebc54847f0c79527
MD5 05cebb98a971b59304ebb2fc41dd3b1f
BLAKE2b-256 7068ca7ebb3d35fd311847487ccd0477ecbb5a61f1770c330fdefa67e31c042b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.0-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 064a4443a81e0b7e27e26f853ed3647c0f8a84be2e49c21b18edec99db695022
MD5 74617073c761d6a48560194eb43e4f04
BLAKE2b-256 cb111885b68b24510aeaae2f4f747ce7e068cde2e8c3b4c2b441a10d2d4c1080

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