Skip to main content

AI-assisted ERC-3643 Real World Asset tokenization scaffolder

Project description

forge

AI-assisted ERC-3643 Real World Asset tokenization scaffolder.

Turn a natural language asset description into a deployment-ready ERC-3643 token in minutes, not weeks.

PyPI Python License: MIT Tests


Table of Contents


What is forge?

forge is a CLI tool and Python library that uses AI (Claude/GPT-4) to analyze natural language descriptions of real-world assets and generate deployment-ready ERC-3643 (T-REX) compliant token contracts.

For beginners: ERC-3643 is the Ethereum standard for tokenizing real-world assets like real estate, bonds, or art. Unlike regular ERC-20 tokens (which anyone can send to anyone), ERC-3643 tokens enforce compliance rules — you must be KYC-verified, an accredited investor, or meet other legal requirements before you can hold or transfer them.


The Problem

Setting up a compliant RWA token from scratch takes weeks:

Week 1: Research which ERC standard to use
Week 2: Figure out compliance rules for your jurisdiction
Week 3: Write smart contracts from scratch
Week 4: Deploy to testnet and fix bugs
Week 5: Legal review of compliance configuration
Week 6: Mainnet deployment

Getting these wrong isn't a UX problem — it's a legal problem. An incorrect compliance configuration can mean your protocol violates securities law.


How It Works

┌─────────────────────────────────────────────────────────────┐
│                    YOUR INPUT (Natural Language)            │
│                                                             │
│  "Grade A office building in Singapore CBD,                │
│   fractional ownership, accredited investors only,          │
│   quarterly rental yield distribution"                      │
└──────────────────────────┬──────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────┐
│              LLM ANALYSIS (Claude / GPT-4)                 │
│                                                             │
│  • Detects asset type: real_estate                          │
│  • Detects jurisdiction: SG (Singapore)                     │
│  • Maps compliance rules: KYC + accredited + lock period    │
│  • Recommends oracle: Chainlink NAV feed                   │
│  • Configures dividends: quarterly USDC distribution        │
└──────────────────────────┬──────────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────────┐
│                  ASSET CONFIG (JSON)                        │
│                                                             │
│  {                                                         │
│    "asset_type": "real_estate",                            │
│    "token": { "name": "SCOT", "symbol": "SCOT" },         │
│    "compliance": { "kyc_required": true, ... },            │
│    "oracle": { "provider": "chainlink", ... },             │
│    "dividend": { "frequency": "quarterly", ... }           │
│  }                                                         │
└──────────────┬──────────────────────┬───────────────────────┘
               │                      │
               ▼                      ▼
┌──────────────────────┐  ┌──────────────────────────────────┐
│    VALIDATOR         │  │    SCAFFOLDER                     │
│                      │  │                                   │
│  • ERC-3643 rules    │  │  • Token.sol (ERC-3643)          │
│  • Jurisdiction      │  │  • Compliance.sol                 │
│  • Lock periods      │  │  • IdentityRegistry.sol           │
│  • Score 0-100       │  │  • deploy.js (Hardhat)           │
│                      │  │  • hardhat.config.js             │
└──────────────────────┘  └──────────────────────────────────┘

Installation

# With Anthropic Claude (recommended)
pip install forge-rwa[anthropic]
export ANTHROPIC_API_KEY=sk-ant-...

# With OpenAI GPT-4
pip install forge-rwa[openai]
export OPENAI_API_KEY=sk-...

# Both providers
pip install forge-rwa[all]

# Development tools
pip install forge-rwa[dev]

Quick Start

1. Analyze an asset

forge analyze "US Treasury 10-year bond, retail investors eligible, semi-annual coupon" --output bond.json

2. Validate the config

forge check bond.json

3. Generate contracts

forge scaffold bond.json --output-dir ./my-token
cd my-token && npm install && npx hardhat compile

CLI Reference

Command Description Example
forge analyze LLM-powered asset analysis forge analyze "real estate in Dubai"
forge check Validate compliance config forge check config.json
forge scaffold Generate Solidity contracts forge scaffold config.json -o ./token
forge demo Run without API key forge demo

Python API

from forge import AssetAnalyzer, ComplianceValidator, Scaffolder

# Analyze
analyzer = AssetAnalyzer()
config = analyzer.analyze("US Treasury bond, retail eligible, quarterly coupon")

# Validate
validator = ComplianceValidator()
result = validator.validate(config)
print(f"Score: {result.compliance_score}/100")

# Scaffold
if result.is_valid:
    scaffolder = Scaffolder()
    scaffolder.generate(config, output_dir="./my-token")

Asset Types

Type KYC Accredited Only Lock Period Oracle Dividends
real_estate Often 90-180 days NAV Rental yield
treasury_bond No Short Price Coupon
private_equity Yes 1+ year NAV Dividends
invoice Institutional Until maturity Price Interest
carbon_credit Optional No None Price None
art Optional No None NAV None

Architecture

forge/
├── forge/
│   ├── __init__.py          # Package exports
│   ├── cli.py               # CLI entry point
│   ├── models.py            # AssetConfig, TokenConfig, ComplianceRules
│   ├── analyzer.py          # LLM-powered asset analysis
│   ├── validator.py         # Compliance validation engine
│   ├── scaffolder.py        # Solidity contract generator
│   └── py.typed             # PEP 561 marker
├── tests/
│   └── test_forge.py        # 14 tests
├── pyproject.toml
├── LICENSE
└── CHANGELOG.md

ERC-3643 Explained

ERC-3643 (also called T-REX — Token for Regulated EXchanges) is the standard for compliant security tokens on EVM chains.

The 4 Core Components

  1. ONCHAINID (Identity) — Every token holder needs an on-chain identity linked to their KYC
  2. Identity Registry — Maps wallet addresses → verified identities
  3. Compliance Module — Enforces rules (max holders, lock periods, jurisdictions) on every transfer
  4. Token Contract — ERC-3643 token that checks compliance before every transfer

Why Not ERC-20?

ERC-20 has no compliance hooks — anyone can transfer to anyone. RWA tokens represent regulated securities requiring:

  • KYC before receiving tokens
  • Accredited investor verification
  • Lock periods enforced on-chain
  • Max holder counts (Reg D limits)
  • Transfer restrictions (sanctioned countries blocked)

Configuration Reference

{
  "asset_type": "real_estate",
  "asset_name": "Singapore CBD Office Tower",
  "jurisdiction": "SG",
  "token": {
    "name": "Singapore CBD Office Tower Token",
    "symbol": "SCOT",
    "decimals": 18,
    "max_supply": 1000000,
    "transferable": true,
    "pausable": true
  },
  "compliance": {
    "kyc_required": true,
    "accredited_investor_only": true,
    "max_investors": 500,
    "lock_period_days": 180,
    "jurisdictions_blocked": ["KP", "IR", "CU", "SY"]
  },
  "oracle": {
    "enabled": true,
    "provider": "chainlink",
    "update_frequency_hours": 24
  },
  "dividend": {
    "enabled": true,
    "payment_token": "USDC",
    "distribution_frequency": "quarterly"
  }
}

Contributing

git clone https://github.com/shubhamdusane/forge
cd forge
pip install -e ".[dev]"
pytest tests/

Roadmap

  • v0.1 — analyze / check / scaffold (CLI + Python API)
  • v0.2 — ONCHAINID integration
  • v0.3 — Dividend distribution contracts
  • v0.4 — Multi-jurisdiction templates (US/EU/UAE/SG)
  • v0.5 — Testnet deployment wizard
  • v1.0 — Full production suite

License

MIT © 2026 Shubham Dusane

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forge_rwa-0.1.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forge_rwa-0.1.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file forge_rwa-0.1.0.tar.gz.

File metadata

  • Download URL: forge_rwa-0.1.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for forge_rwa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a0b81f5e5622d44a5ad38045a3fb6639c0017264a507bdffe90b4f57ef34e87
MD5 9c10d7b916aac25399d9bc1a240df0bb
BLAKE2b-256 301eb02e514c9457e05ea7d559f6805329ae0f07d865a0c2ac085bee5ca26975

See more details on using hashes here.

File details

Details for the file forge_rwa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: forge_rwa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for forge_rwa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00faa19eeb406a691c536dee3b9779731aad59372122d452a471c36fd8b914eb
MD5 f0630fb7a9402446fe59885b5ee0fbf0
BLAKE2b-256 bf3e697987b0f838ef4504bf810771201766d7069338c5a75e8a0811fc77a52d

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