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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.5.1-cp312-cp312-manylinux_2_17_x86_64.whl (478.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 91bed2ffe376d16d93419d5826b584cdea147d4614bef4f8c632a2ddcb3864a3
MD5 1c5cd75f8320f74cdeddaf9d3c52ebff
BLAKE2b-256 c28eef4b1ef92ba511cb34b4faef3037c4065f9d568fb46d403ade8624d2f27f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 592089c2f21c6d8cfd08600a42e7f3ae62585800f53b695f9f45a7f7789b46fb
MD5 9c6940ed2198fbae2081cf79cd31fceb
BLAKE2b-256 714a12c6329f25aacbca25695d10b24edada28711a03e2673ada73ed759cb395

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 fd317d28bf0f2b7ff9560f7b61677d1b0f9c24f30fb4658ad9515d3d6ddeb8b3
MD5 2f013a0c9e7f49fd7f587c9ad9deafa2
BLAKE2b-256 4ea421dae448e734604a9d44d101ea97f8b4b0746a0160a3abac4624fbe68994

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 887d6df3c21fdcc8b3be749ea00e100ac5c04de2a96b75602c2be75935fa8a30
MD5 2bf162b9c5b801d8239a8e3428d939b5
BLAKE2b-256 489487fe73eda66a72aebced158c0c4ce521dde4799a3fff94afeab29a82a11f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 94b1deb848aa31e374835c6f0459e26478380403e445fb41b4c873f1b75ca728
MD5 a70735eb799262e49c2f140a934f137e
BLAKE2b-256 f69804d2acde85737247ab85eb73a0ef3fb260deafbfef786effa629a94ff42a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.5.1-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 0db0d73286558c82698a4e4e1839b81b2836935e62ecf66e37c381eb5b9e118a
MD5 521944f61884d8b4c4951d6a690eafd4
BLAKE2b-256 b071f89f62d90a352054d5674dbd249b95e82bcbafb0d0b0e4601767a454c905

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