Skip to content
SrizdebnathPublic

About

PyBitrum is a state-of-the-art, high-fidelity Web3 IDE designed specifically for the Arbitrum ecosystem. It enables developers to write smart contracts using a Pythonic syntax, which is automatically transformed into Vyper, compiled, and deployed to the Arbitrum Sepolia Testnet with a single click.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PyBitrum v1.0.0

Agents, not humans. An industrial-grade ecosystem for deploying autonomous on-chain agents using Python on Arbitrum Nitro.

Live Arbitrum Python

PyBitrum allows developers to write smart contracts in Python, compile them simultaneously to Solidity and Vyper via a dual-compiler AST pipeline, and deploy autonomous agents that execute missions on-chain — 24/7, without human intervention.


🚀 Key Features

  • Dual-Compiler Pipeline — Write once in Python, compile to both Solidity (^0.8.26) and Vyper (^0.4.0) simultaneously.
  • Autonomous Agents — Deploy AgentWallet entities with their own EOAs, private keys, and on-chain Hive Registry identities.
  • Swarm Orchestration — Coordinate fleets of agents using concurrent Python threads with shared state broadcasting.
  • Mission Board — Post bounties with ETH. Agents claim, execute, and settle — all on Arbitrum Sepolia.
  • Security Guardrails — 14 dangerous patterns blocked at compile time. @agent_action auto-injects @nonreentrant and msg.sender verification.
  • Cloud-Synced IDE — Browser-based Playground with Monaco Editor, GitHub OAuth, and one-click MetaMask deployment.

🏗 Architecture

graph TD
    Dev((Developer)) -->|Python Code| Frontend[Next.js Playground]
    Dev -->|Terminal| CLI[pybitrum CLI]
    Frontend -->|POST /api/compile| Backend[Express API Gateway]
    Backend -->|POST /compile/*| Compiler[Flask Compiler Service]
    Compiler -->|AST Transform| Vyper[Vyper Code]
    Compiler -->|AST Transform| Solidity[Solidity Code]
    Frontend -->|MetaMask| Arbitrum[Arbitrum Sepolia]
    CLI -->|AgentWallet| Arbitrum
    CLI -->|Swarm| Hive[Hive Registry Contract]
Loading

Production Services

Service Stack URL
Frontend Next.js 16, Tailwind, Monaco pybitrum.isriz.xyz
Backend Express, TypeScript, Supabase pybitrum-backend.onrender.com
Compiler Flask, solcx 0.8.20, vyper pybitrum-compiler.onrender.com

📚 Documentation

Detailed technical documentation for every service:

Document Description
System Architecture High-level system design, deployment map, and security layers
Compiler Engine 4-stage pipeline: SecurityChecker → CodeValidator → AST Parser → Transformer
Backend Services Express API routes, middleware stack, Zod schemas, and environment config
Frontend IDE Playground, Mission Board, docs hub, component architecture, and design system
SDK & CLI AgentWallet, Swarm, Contract classes, decorators, and all CLI commands
Testing Suite 100-contract industrial validation for the dual-compiler pipeline

📂 Project Structure

pybitrum/
├── frontend/          # Next.js 16 — Playground, Mission Board, Docs
│   ├── app/           # App Router pages (/, /playground, /synopsis, /docs)
│   ├── src/components # EditorPanel, Sidebar, Terminal, DeploymentModal, etc.
│   └── src/lib        # Hive Registry ABI, contract addresses
├── backend/           # Express API Gateway
│   ├── src/routes     # /api/compile, /api/deploy, /api/projects, /api/auth
│   ├── src/services   # compiler.ts, deployment.ts, database.ts
│   └── src/middleware  # authMiddleware, errorHandler
├── compiler/          # Flask Compiler Service
│   ├── server.py      # REST API (4 endpoints)
│   ├── transformer.py # PythonToVyperTransformer (36KB)
│   ├── solidity_transformer.py  # PythonToSolidityTransformer (24KB)
│   ├── security.py    # SecurityChecker (14 patterns)
│   ├── validator.py   # CodeValidator (AST walk)
│   └── ast_parser.py  # PythonASTParser
├── sdk/               # Python SDK & CLI
│   └── pybitrum/
│       ├── cli.py     # argparse CLI (all commands)
│       ├── wallet.py  # AgentWallet class
│       ├── swarm.py   # Swarm orchestrator
│       ├── contract.py # Contract base + decorators
│       └── compiler.py # Local compilation interface
├── docs/              # Technical documentation
└── tests/             # 100-contract validation suite

🛠 Quick Start

Prerequisites

  • Node.js v18+
  • Python 3.9+
  • Solidity Compiler (solc 0.8.20)
  • Vyper Compiler (vyper 0.4.0+)

Development (All Services)

# Clone and install
git clone https://github.com/Srizdebnath/PyBitrum.git
cd PyBitrum
npm install

# Start Frontend + Backend + Compiler
npm run dev

SDK Only

pip install pybitrum

# Create a new project
pybitrum new my_agent

# Compile and deploy
pybitrum compile agent.py
pybitrum deploy agent.py --network sepolia

Run Test Suite

cd compiler && source venv/bin/activate
python ../tests/runner.py

🤖 Agent Quick Start

from pybitrum import AgentWallet, Swarm

# Create an agent
agent = AgentWallet("scout-01")
print(f"Address: {agent.address}")

# Create a swarm
swarm = Swarm("Fleet_Alpha", registry_address="0x...")
swarm.spawn(["alpha", "beta", "gamma"])
swarm.join_hive()

# Define autonomous behavior
def logic(agent):
    # Your AI/DeFi/arbitrage logic here
    pass

# Launch — runs forever
swarm.run(behavior=logic)

📜 License

MIT License — PyBitrum v1.0.0

Built by Sriz Debnath

About

PyBitrum is a state-of-the-art, high-fidelity Web3 IDE designed specifically for the Arbitrum ecosystem. It enables developers to write smart contracts using a Pythonic syntax, which is automatically transformed into Vyper, compiled, and deployed to the Arbitrum Sepolia Testnet with a single click.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages