Skip to content

Tribler/superorganism-experiment

Repository files navigation

superorganism-experiment

We are creating our own society. A place citizens have FULL control, have their own MONEY, have AI that serves THEM, and CONTROL together. Unstoppable by design, self-replicating, self-hosted, self-evolving, and human oversight with democratic governance. Well, that is our Utopian dream! It now runs and empowers a network of seedboxes.

Our work contains several novelties:

  • ⏩ Streaming Torrents. Quality streaming in P2P, competitive to Tiktok/Youtube/Netflix {warning:requires integration of Egbert code}.
  • 🪞 Self-replication. Servers that can buy other servers using Bitcoin. Fully automated cloning of servers.
  • ⚡ Trust. First trust framework and true Peer-to-Peer agent communication fabric. No DNS, no central control.
  • 🧑‍🚒 AI models in a real-time competition for survival of the fittest using multi-arm-bandit and model score gossip.
  • 👓 Find information using decentralized relevance ranking
  • 🥇 First decentralized voting system. Your place, your control, your vote. Our vibe coded demo we're implementing with real crypto.
  • 🥼 User-driven self-evolution. The emergent voting behavior is that users drive the roadmap using democracy. No lawyer or company can stop the will of the people.

demo_of_democratic_voting_process

Disclaimer is that each novelty still requires years of polish, but they work and together form a unique system. Image

Detailed progress issues with weekly updates

Andrei: live switch between re-ranking algorithm using P2P multi-arm bandit and performance gossip protocol

Stan: voting and stake your identity

Matei: self-replicating server. Server with wallet can buy antoher server and clone itself.

Aayush: [trust framework, reputation function of identities, social capital accountkeysing for Sybil attack detection.](Tribler/tribler#8667)

Marcel: P2P search with decentralized relevance ranking

Everything we built so far / Desired features for first March release

  1. A million URLs with creative commons content
  2. Liberate this content to robotic Bittorrent seedboxes fleet
  3. Semantic search
  4. Bitcoin wallet for donations and funding Seedboxes
  5. Voting and use your Bitcoin wallet to stake your identity (public key)

other ideas: Bounties, seedbox fleet? status of IPv8 network? Money in system, amount of discovered users?

General

Qt UI resources are listed in the ui/resources/ directory, including icons, fonts, images, and the resource manifest. They must be converted using the PySide6 resource compiler. Run the following command after adding new UI resources:

pyside6-rcc ui/resources/resources.qrc -o ui/resources/resources_rc.py

Local Bitcoin regtest environment

This project uses a local Bitcoin Core regtest node for development and integration testing. Regtest is a private blockchain intended for testing. It does not connect to mainnet, and blocks can be mined on demand.

The script scripts/regtest.sh automates the local setup by:

  • creating a dedicated regtest data directory inside the project
  • generating a bitcoin.conf
  • starting bitcoind
  • creating or loading a wallet
  • mining initial blocks so the wallet has spendable funds
  • exposing simple commands for status, reset, mining, and demo transactions

Dependencies

The script requires:

  • bash
  • bitcoind (part of Bitcoin Core)
  • bitcoin-cli (part of Bitcoin Core)
  • jq (for JSON parsing)

Installing dependencies

macOS

brew install bitcoin
brew install jq

Project-local data directory

The script stores all regtest data inside the repository:

.bitcoin/regtest-demo/

Configuration

The script supports a few environment variables, but all have sensible defaults.

Variable Default Description
BITCOIND_BIN bitcoind Path to the bitcoind binary
BITCOINCLI_BIN bitcoin-cli Path to the bitcoin-cli binary
DATA_DIR ./.bitcoin/regtest-demo Regtest data directory
WALLET_NAME demo Wallet name used for testing
RPC_USER demo RPC username
RPC_PASSWORD superorganism RPC password
RPC_PORT 18443 Regtest RPC port
P2P_PORT 18444 Regtest P2P port
HOST 127.0.0.1 Host interface for the node

Usage

The script supports the following commands:

scripts/regtest.sh start
scripts/regtest.sh stop
scripts/regtest.sh reset
scripts/regtest.sh status
scripts/regtest.sh mine [n]
scripts/regtest.sh send <address> [amount] [op_return_hex]
scripts/regtest.sh treasury-address
Command Description
start Starts the regtest node, creates the config file if needed, loads or creates the wallet, and ensures the wallet is funded. On first startup, the script mines 101 blocks. This is necessary because coinbase rewards must mature before they become spendable.
stop Stops the running regtest node.
reset Deletes the local regtest blockchain and wallet state, then starts from a clean environment. This is useful for repeatable integration tests.
status Prints basic blockchain and wallet state.
mine Mines one or more new regtest blocks. This is especially useful for confirming transactions during testing.
send Sends a demo transaction from the local wallet.
treasury-address Prints the address of the treasury. This is useful for funding the wallet from external tools or for testing incoming transactions.

Mycelium

Autonomous BitTorrent orchestrator that seeds Creative Commons content.

What it does

  • Seeds content via BitTorrent (libtorrent)
  • Auto-updates from GitHub and restarts on changes
  • Broadcasts seeded content to IPV8 peers for health monitoring

Deployment

This is deployed to a SporeStack VPS via mycelium-bootstrap/. See that directory for deployment instructions.

Running locally

pip install -r code/requirements.txt
cd code && python main.py

Configuration

All config via MYCELIUM_* environment variables. See code/config.py for defaults.

Mycelium-bootstrap (Mycelium VPS Deployer)

Autonomous VPS provisioning system using Bitcoin payments and SporeStack API. Deploys mycelium, a BitTorrent orchestrator for Creative Commons content.

Quick Start

0. Install dependencies

pip install -r requirements.txt

1. Create and fund Bitcoin wallet

python wallet.py create mycelium
python wallet.py address mycelium      # Send BTC to this address
python wallet.py scan mycelium         # Verify funds received

2. Fund SporeStack account

python fund_sporestack.py fund 100

3. Acquire VPS

python acquire_vps.py

4. Deploy mycelium to VPS

python deploy_mycelium.py

5. (Optional) Stop mycelium

python stop_mycelium.py

CLI Reference

wallet.py

Bitcoin HD wallet management.

python wallet.py <command> <wallet_name>

Commands:
  create <name>     Create new wallet (outputs mnemonic - save it!)
  address <name>    Get receiving address
  balance <name>    Check wallet balance
  scan <name>       Scan blockchain for updates
  xpub <name>       Get extended public key
  load <name>       Load and display wallet info
  interactive       Interactive wallet setup

fund_sporestack.py

SporeStack account funding via Bitcoin.

python fund_sporestack.py <command> [amount]

Commands:
  fund [amount]     Fund account (default: $10)
  balance           Check SporeStack balance
  token             Display saved token
  help              Show usage

acquire_vps.py

Provision a VPS from SporeStack.

python acquire_vps.py [options]

Options:
  --token TOKEN       SporeStack token (default: ~/.mycelium/sporestack_token)
  --flavor FLAVOR     Server size (default: vultr.vc2-2c-4gb)
  --os OS             Operating system (default: ubuntu-24-04)
  --provider PROV     VPS provider (default: vultr.ams)
  --days DAYS         Server lifetime (default: 30)
  --hostname NAME     Server hostname (default: mycelium)
  --list-flavors      List available server sizes
  --list-os           List available operating systems

deploy_mycelium.py

Deploy mycelium to a VPS.

python deploy_mycelium.py [options]

Options:
  --host IP           Server IP (default: from ~/.mycelium/server.json)
  --port PORT         SSH port (default: 22)
  --ssh-key PATH      SSH key path (default: ~/.mycelium/ssh/deploy_key)
  --content-dir DIR   Content directory to upload
  --no-content        Skip content upload
  --wallet NAME       Wallet name for xpub (default: mycelium)
  --no-xpub           Deploy without Bitcoin wallet

stop_mycelium.py

Stop mycelium orchestrator on the VPS to save resources.

python stop_mycelium.py

Connects to the VPS and kills the running mycelium process. Run deploy_mycelium.py to restart.

Content Sourcing

Search for Creative Commons videos and download them:

# Requires YOUTUBE_API_KEY in .env
python yt-api-cc-scripts/yt-api-cc.py
python yt-api-cc-scripts/yt-api-cc-playlists.py

# Download collected URLs
./scripts/parallel_ytdlp_download.sh

Data Storage

All persistent data is stored in ~/.mycelium/:

~/.mycelium/
├── wallets/           # Bitcoin wallet databases
├── sporestack_token   # SporeStack API token
├── ssh/deploy_key     # SSH keypair for VPS access
└── server.json        # Acquired VPS info

Mycelium-simulation (Mycelium Economic Simulation)

Simulates the economic lifecycle of self-replicating mycelium nodes: income (faucet), expenses (rent), reproduction (spawning children), and death (running out of funds).

Quick start

pip install -r requirements.txt
python -m host.simulator -c config/small.yaml

Output goes to data/events.csv. Set tick_interval: 0 in the config to run at full speed.

Changing parameters

All parameters live in config/default.yaml. To experiment, change it or create a new config file.

python -m host.simulator -c config/<your_file>.yaml

How a tick works

Each tick is a synchronous round:

  1. Rent is deducted from every living node
  2. Bankrupt nodes are killed
  3. Faucet injects funds
  4. Every living node decides exactly once: none, spawn, or failsafe
  5. Decisions are processed (spawns transfer inheritance; failsafe nodes donate all funds then die)
  6. Conservation invariant is checked

Plotting results

python analysis/plot.py data/events.csv -o data/plots

Democracy

About

Unstoppable by design, self-replicating, self-hosted, self-evolving, and human oversight with democratic governance. Well, that is our Utopian dream!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors