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

Uploaded CPython 3.12Windows x86-64

colibri_stateless-0.6.12-cp312-cp312-manylinux_2_17_x86_64.whl (487.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.12-cp312-cp312-macosx_15_0_universal2.whl (364.2 kB view details)

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

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

Uploaded CPython 3.8Windows x86-64

colibri_stateless-0.6.12-cp38-cp38-manylinux_2_17_x86_64.whl (484.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

colibri_stateless-0.6.12-cp38-cp38-macosx_15_0_universal2.whl (362.6 kB view details)

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

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4c6d3e1b0fa54630b01efaa4638e8371754ed0ab2aa75fd3bfd57b97d52da85
MD5 ff9eb440d5c0e443aa37cd54b79fba4d
BLAKE2b-256 ee317392bbb77c78f691046f20d7b782a515f392a96306ba6be86cd854e7f178

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp312-cp312-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 92264283fbc4d7fa5bcc64e03e80c59e0d66e1afb39159ce56e544fa4a73bf79
MD5 ac4a32f7c55e4c31e77ee30d68abb379
BLAKE2b-256 4a7ed2e9a4dbd1c966ab036dd768d8cdee9ef4d59fba90de739c9de4973790ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp312-cp312-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 25bdd572b1b7fe1b60591d706bcc320dc6ce5acf06da0b80f852f92bd98479f2
MD5 2a19715760c2afacadb95245289d5251
BLAKE2b-256 c18fa9e25b46007a79ebd9cf5e8503a4d339df26848a7fd271553f8f1cb51e13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 89b6c1b3c4e75aa9acd107151c0ef975bf1bb6c592a84ea595aa9c4bdf34e0cd
MD5 5b15fead0aa90ac5be3ceb90581aeb07
BLAKE2b-256 f1dfd6296dafcd697d7292c8d69928ed6e431a95d0191fddceb44480f1b8fe9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6a929d65bb14ce092f9810f4e9c6d796dc401dd8bfa65ca59f9b988854e1425d
MD5 021bd863b92c4b4293d41bd3a2ff3f20
BLAKE2b-256 2317d9f396d5decc07e0e2dff3cf4302a4943f8a0a6c560f1ca666a1a6aa485e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for colibri_stateless-0.6.12-cp38-cp38-macosx_15_0_universal2.whl
Algorithm Hash digest
SHA256 d33a974ec90f8f4aff741bfde9977cb758c4d75079adc85ea141d82b7f0f7173
MD5 af4ff63e49b322aa4c2f135b9250c3d9
BLAKE2b-256 7866e904d3ac14cd5df54f050d2a8bad2852a52457fb67a49491d9bfc6607f27

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