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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.10-cp312-cp312-manylinux_2_17_x86_64.whl (486.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.10-cp312-cp312-macosx_15_0_universal2.whl (363.7 kB view details)

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

colibri_stateless-0.6.10-cp38-cp38-win_amd64.whl (369.5 kB view details)

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.10-cp38-cp38-manylinux_2_17_x86_64.whl (484.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.10-cp38-cp38-macosx_15_0_universal2.whl (362.1 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3d4b44a5cb297eea3c10bf3f33cb256e5f22ebb9cf5e75dfe8e1755337258112
MD5 ac5013cf8a01e4267aded7005f5e9bf4
BLAKE2b-256 8bb2c71b819ac280b019a65717323e8d925885022bb579d623e746416b3083a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4ce772352bfea57863bc295b83af64f014a0095ae3e4d9fc953e08bd1ebde13c
MD5 5a0fc06a7f3657809bbf7ea885f3d179
BLAKE2b-256 7b6448368744acc046313f5aae7bb03ba679a84d47fa490c0de7f91d5f9179c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 7b886c2ef9e363988b122df53ddd764960dac44c0fc55afd5d4ccb8473874468
MD5 eedb65132039baae3de3e9f98bf66b45
BLAKE2b-256 6716134601e159347f3f2e2198d45a13567e3eeb3f3fa9c61dd53d56ff0b92ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f84c4078a2dd6d5492749ecdac6f98286f667238e90aed994157bbfcc89fa645
MD5 680864649b9d8749944d9671c1f049a5
BLAKE2b-256 6d8ba3cdec4bc06efba6ac3bd5755f388e1df02c67cb718a96c0908255482f35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4549cb0f76ca6f337200f8a0f5c49f558ae98f8e5d70fd0023227c1c02d2cfcd
MD5 b9e22996575284c182b492f26ce5eaa3
BLAKE2b-256 6725301c3a09acb45af6fd11efcd271e53759a807fbdf01811b2af1a638cf3a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.10-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 0cef76d2cb1a1e573363699d456031be0a9a23d4e0eb5cdf0035fca194ca2246
MD5 2b69996d4204c4625bf3a1d6e1b96d32
BLAKE2b-256 7cc907cfd836ca01bc493e41e2bfe8316430e0c2ba992ac5a361b94a4fa2bf21

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