RillCoin

AI 与智能体

by rillcoin

提供 AI agent wallets、Proof of Conduct 声誉体系,以及在 L1 上实现的 concentration decay 机制。

什么是 RillCoin

提供 AI agent wallets、Proof of Conduct 声誉体系,以及在 L1 上实现的 concentration decay 机制。

README

Rill

Wealth should flow like water.

Build Tests Rust License

A cryptocurrency with progressive concentration decay. Holdings above configurable thresholds gradually decay back into the mining pool, promoting circulation and discouraging long-term hoarding.


Overview

Rill implements a novel economic model where concentrated wealth naturally flows back into circulation through a mathematically-governed decay mechanism. Large balances above threshold values experience sigmoid-function-based decay, with decayed funds returning to miners as supplemental block rewards.

The project is implemented in Rust across 6 library crates and 3 binaries, with over 920 tests including unit, integration, property-based, and adversarial test coverage.


Key Features

  • Concentration Decay: Balances above thresholds decay to the mining pool using fixed-point sigmoid curves
  • Integer-Only Consensus: All consensus math uses u64 fixed-point arithmetic (10^8 precision) — no floating point
  • Ed25519 Signatures: Fast, secure transaction signing with 32-byte public keys
  • BLAKE3 Merkle Trees: High-performance transaction tree hashing
  • libp2p Networking: Production-grade P2P with Gossipsub, Kademlia DHT, and mDNS discovery
  • RocksDB Storage: Persistent blockchain storage with 8 column families
  • HD Wallet: BIP-39 seed phrases, decay-aware coin selection, AES-256-GCM encrypted storage
  • JSON-RPC: Bitcoin-style RPC interface for node queries and transaction submission

Quick Start

Prerequisites

  • Rust 1.85+ (2024 edition)
bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Building

bash
git clone https://github.com/rillcoin/rill.git
cd rill

# Build all binaries
cargo build --release

# Run all 920+ tests
cargo test --workspace

# Check for warnings
cargo clippy --workspace -- -D warnings

Running a Local Testnet Node

bash
# Start a regtest node (instant blocks, no real PoW)
./target/release/rill-node --regtest --data-dir /tmp/rill-regtest

Create a Wallet

bash
./target/release/rill-cli wallet create --network testnet

Start Mining

bash
./target/release/rill-miner \
    --rpc-endpoint http://127.0.0.1:38332 \
    --mining-address trill1<your-address>

Run a 3-Node Testnet with Docker

bash
docker-compose up --build

Architecture

code
rill-core       Foundation types (Transaction, Block, Address, UTXO, traits)
  |
rill-decay      Concentration decay algorithm — sigmoid curves, fixed-point math
  |
rill-consensus  Block validation, PoW, difficulty adjustment, mining rewards
  |
rill-network    P2P networking (libp2p: Gossipsub, Kademlia, Noise, mDNS)
  |
rill-wallet     HD wallet, BIP-39 mnemonics, decay-aware coin selection
  |
rill-node       Full node: RocksDB storage, JSON-RPC server, mempool

See docs/ARCHITECTURE.md for a detailed description of every crate, the storage column families, network protocol, and design decisions.


Project Structure

code
rill/
├── crates/
│   ├── rill-core/       # Core types, traits, crypto, constants
│   ├── rill-decay/      # Sigmoid decay algorithm (fixed-point, integer-only)
│   ├── rill-consensus/  # Block production, validation, PoW, difficulty
│   ├── rill-network/    # P2P networking (libp2p)
│   ├── rill-wallet/     # HD wallet, coin selection, encrypted persistence
│   ├── rill-node/       # Full node library: storage, RPC, mempool
│   └── rill-tests/      # Integration, property-based, and adversarial tests
├── bins/
│   ├── rill-node/       # Full node binary
│   ├── rill-cli/        # Command-line wallet and node query tool
│   └── rill-miner/      # Standalone mining daemon
├── docs/
│   ├── ARCHITECTURE.md  # Technical architecture overview
│   └── TESTNET.md       # Testnet and deployment guide
├── Dockerfile           # Multi-stage build (rust:1.85-bookworm → debian:bookworm-slim)
└── docker-compose.yml   # 3-node local testnet

Network Types

ModeFlagP2P PortRPC PortDescription
mainnet(default)1833318332Production network
testnet--testnet2833328332Public test network
regtest--regtest3833338332Local dev network, instant blocks

CLI Reference

bash
# Node
rill-node --testnet --data-dir /tmp/rill
rill-node --regtest --data-dir /tmp/rill --no-network

# Miner
rill-miner --rpc-endpoint http://127.0.0.1:18332 --mining-address rill1...

# Wallet
rill-cli wallet create --network testnet
rill-cli wallet restore --network testnet
rill-cli address
rill-cli balance --rpc-endpoint http://127.0.0.1:28332
rill-cli send --to trill1... --amount 10.5 --rpc-endpoint http://127.0.0.1:28332

# Node queries
rill-cli getblockchaininfo --rpc-endpoint http://127.0.0.1:28332
rill-cli getsyncstatus
rill-cli getpeerinfo
rill-cli validateaddress rill1...

RPC Methods

Available JSON-RPC methods:

MethodDescription
getblockcountCurrent chain height
getblockhashBlock hash at a given height
getblockFull block data
getblockheaderBlock header fields
gettransactionTransaction by ID
sendrawtransactionSubmit a raw transaction
getmempoolinfoMempool size and fee info
getblockchaininfoHeight, supply, decay pool, IBD status, UTXO count
getsyncstatusSync state, height, peer count
getpeerinfoConnected peer count
getinfoGeneral node info
getblocktemplateBlock template for mining
submitblockSubmit a mined block
getutxosbyaddressUTXOs for an address
getclusterbalanceDecay cluster total balance

See docs/TESTNET.md for full RPC documentation with request/response examples.


Development

Code Standards

  • Rust Edition: 2024
  • MSRV: 1.85
  • Formatting: cargo fmt (default settings)
  • Linting: cargo clippy -- -D warnings (zero warnings policy)
  • Arithmetic: All consensus math uses checked_add, checked_mul, etc.
  • Errors: thiserror for library crates, anyhow for binaries
  • Logging: tracing with structured fields

Testing

bash
# All tests
cargo test --workspace

# Integration tests only
cargo test -p rill-tests

# Property-based tests (faster in release mode)
cargo test --release proptest

# Benchmarks
cargo bench

Git Workflow

  • Branch naming: <agent>/<description> (e.g., core/implement-transaction-type)
  • Commit messages: <crate>: <description> (e.g., rill-core: implement Transaction struct)
  • Always run cargo test --workspace before committing
  • Pre-commit hooks enforce code quality and project isolation

Decay Mechanics

The decay algorithm operates on individual UTXOs grouped into clusters:

  1. UTXOs in clusters below 0.1% of circulating supply: no decay
  2. UTXOs in clusters above threshold: sigmoid decay rate applied per block
  3. Decay rate increases with concentration, approaching a maximum of ~15% per year
  4. Decayed value accumulates in a pool and flows back to miners as supplemental rewards

All decay calculations use integer-only fixed-point arithmetic with u64 for consensus determinism.

See docs/ARCHITECTURE.md for the full mathematical specification.


Technical Details

Consensus

  • Block Time: 60 seconds target
  • Proof of Work: SHA-256 double-hash (Phase 1); RandomX planned for Phase 2
  • Difficulty Adjustment: LWMA over 60-block window, clamped to [prev/3, prev*3]
  • Supply Cap: 21,000,000 RILL (mining) + 1,050,000 RILL (dev fund premine, 4-year vesting)
  • Initial Reward: 50 RILL per block, halving every 210,000 blocks
  • UTXO Model: Bitcoin-style unspent transaction outputs
  • Coinbase Maturity: 100 blocks

Network Protocol

  • Transport: TCP with libp2p Noise encryption (XX handshake) and Yamux multiplexing
  • Block/TX Gossip: Gossipsub topics /rill/blocks/1 and /rill/txs/1
  • Peer Discovery: Kademlia DHT + mDNS
  • Wire Format: bincode

Storage (RocksDB Column Families)

Column FamilyContents
blocksFull block data
headersBlock headers
utxosUnspent transaction output set
height_indexHeight-to-hash mapping
undoUndo data for chain reorganizations
metadataChain tip, UTXO count, and misc metadata
clustersAggregate cluster balances for decay
address_indexAddress-to-UTXO index

Documentation

  • docs/TESTNET.md: Building, running, mining, CLI usage, Docker, RPC reference
  • docs/ARCHITECTURE.md: Crate descriptions, design decisions, storage layout, decay mechanism
  • docs/AGENT-RUNNER.md: Multi-agent development workflow
  • ADRs: .claude/skills/architecture/ — Architectural Decision Records
  • Decay Spec: .claude/skills/decay-mechanics/ — Mathematical specification

Contributing

Before submitting changes:

  1. Run cargo test --workspace
  2. Run cargo clippy --workspace -- -D warnings
  3. Run cargo fmt --check
  4. Ensure all public APIs have doc comments

This project uses specialized subagents for development. See .claude/agents/ for the agent architecture.


License

Licensed under either of:

at your option.


Philosophy

"Wealth should flow like water."

RillCoin explores what happens when concentrated wealth naturally circulates rather than accumulating indefinitely. The decay mechanism is transparent, predictable, and governed by mathematics rather than discretion.

Large holders can avoid decay by spending, distributing holdings across multiple addresses, or participating in the economy rather than purely accumulating. The goal is a cryptocurrency that remains liquid and accessible, where the economic incentives favor circulation over concentration.


Status: Phase 4 implementation complete. Full node, wallet, and miner binaries functional. 920+ tests. Testnet deployment ready.

常见问题

RillCoin 是什么?

提供 AI agent wallets、Proof of Conduct 声誉体系,以及在 L1 上实现的 concentration decay 机制。

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描171.4k

RAG架构师

by alirezarezvani

Universal
热门

聚焦生产级RAG系统设计与优化,覆盖文档切块、检索链路、索引构建、召回评估等关键环节,适合搭建可扩展、高准确率的知识库问答与检索增强应用。

面向RAG落地,把知识库、向量检索和生成链路系统串联起来,做架构设计时更清晰,也更少踩坑。

AI 与智能体
未扫描24.9k

多智能体架构

by alirezarezvani

Universal
热门

聚焦多智能体系统架构设计,梳理 Supervisor、Swarm、分层和 Pipeline 等模式,覆盖角色定义、通信协作与性能评估,适合规划稳健可扩展的 AI agent 编排方案。

帮你系统解决多智能体应用的架构设计与协同编排难题,适合构建复杂 AI 工作流,成熟度高、社区认可也很亮眼。

AI 与智能体
未扫描24.9k

相关 MCP Server

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
89.7k

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
89.2k

by deusdata

热门

持久化的代码库知识图谱,可跨会话保留上下文,在 session 重启或上下文压缩后仍能继续使用。

专治 AI 编程助手“会话失忆”,把代码库沉淀为持久知识图谱,重启或压缩上下文后也能无缝续上开发状态。

AI 与智能体
37.3k

评论