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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.7.2-cp312-cp312-manylinux_2_17_x86_64.whl (487.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.7.2-cp312-cp312-macosx_15_0_universal2.whl (364.0 kB view details)

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

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.7.2-cp38-cp38-manylinux_2_17_x86_64.whl (484.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.7.2-cp38-cp38-macosx_15_0_universal2.whl (362.5 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 86674d4f9dad6bc8952feeefd106fbc10964c5e1565152210430382902098ca9
MD5 610dbf1c4afad692de8cab3b7e6aeeea
BLAKE2b-256 ff4f55d4ac9ac027cc7ce2b4f4f6000ddebd6225ca793b3fcfbc911df2159ff2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0d70b72b1f344f4ee15235c11517452c2e3a1e96ddb290352641cabfdb708d64
MD5 6a45fb399cf223828fa70b7eedc75b75
BLAKE2b-256 ac075de92425cb4477e911b9a2e8d25695133eb6c1a6d7895e1a43fb66f80240

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 8772f2485c804df0d03d22bb24fa4169a7f05dcb30b4cdee31d2a3e6bfe33c1d
MD5 f6987eeb8c073a5aecec70f1f9162a9e
BLAKE2b-256 a97d36c07307a96959eacd4ca27aebf068b58b8896f5e64d82b5318b51f5dea4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 be1a4fa1bbb147d49ce0df24ea61dbfadb999aaaf3be4973f53923842e27e036
MD5 cc16eceb7a9049f548529c22780cb391
BLAKE2b-256 9c1127a240cf036986100c398f5f069519d6e3c80d9c9d716e3d96c5214e157c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 005e4078807eeb8a437e4fe3f5bbb3c84eb1d46ac2335ed4ada55e76ceb648f7
MD5 ad5507526cb4a76edd06160bc5123eba
BLAKE2b-256 27a7a664e605108dbd86194d95c1ffd529d41a2d73700e6aad965f61153310d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.7.2-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 febbed78be52e603aaf1b880656151d992ab2dbb0fb88edeab633a380253c57e
MD5 5f22fec6518ebf74bebffacf8d82f185
BLAKE2b-256 a127d98c6b660825d1d7e85a8f3df0d982c466420b677ac3fa2fc98313ae5db7

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