Earth Nodes

Earth Nodes

There are two ways to participate in Social Network, by staking Bitcoin, or running an Earth Node. This section will overview the section option which ensures, a fair, open, and decentralized network for everyone on Earth.

How to Run an Earth Node

The high-level requirements to join the Social Network protocol are to run the following:

  1. Bitcoin Node
  2. Ethereum Light Client (and validators will operate execution/consensus clients)
  3. Earth Relayer

All three of these components make up a single Earth Node, a reference implementation is provided here. This section will overview how to run an Earth Node for the Social Network, and begin earning rewards.

Bitcoin Node Setup

The Bitcoin Core daemon (bitcoind) is a program that implements the Bitcoin protocol and enables remote procedure calls (RPC) for accessing the distributed ledger. An additional indexer is used to easily parse additional Bitcoin chainstate through bitcoind’s ZeroMQ interface, its embedded networking library, passing raw blockchain data to be evaluated for events related to the the Social Network and Social Network.

The Bitcoin node must run in full archive mode, with —txdetails=1 and ensure it remains up to date for the Relayer to be valid. The latest Bitcoin core software can be obtained at bitcoin.org, and requires ~200GB data with 2GB RAM and a CPU. This requirement is to ensure there is no centralized censorship ability of Social Network’s incentive layer, and also helps to decentralize the Bitcoin monetary system.

This guide works with the latest Bitcoin Core software version here. See these two guides for more details on how to run a node.

Linux Requirements:

sudo apt-get update
sudo apt-get install libboost-all-dev libzmq3-dev libminiupnpc-dev 
sudo apt-get install curl git build-essential libtool autotools-dev
sudo apt-get install automake pkg-config bsdmainutils python3
sudo apt-get install redis-server postgresql postgresql-contrib
sudo apt-get install libclang-dev software-properties-common libssl-dev libevent-dev

Install the latest Bitcoin Core (26.x) with:

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin && git checkout 26.x
./autogen.sh
./configure
make
cd src
sudo install -sv bitcoind bitcoin-cli /usr/local/bin/

Create a new Bitcoin configuration file:

mkdir ~/.bitcoin
vim $HOME/.bitcoin/bitcoin.conf

Set the following configuration to be compatible with the Bitcoin indexer:

# Bitcoin Core Testnet Configuration

testnet=1
datadir=/home/earthean/.bitcoin/ # Path to Bitcoin directory
server=1
rpcuser=earth
rpcpassword=relay
rpcport=8332
rpcallowip=0.0.0.0/0
rpcallowip=::/0
txindex=1
listen=1
discover=0
dns=0
dnsseed=0
listenonion=0
rpcserialversion=1
disablewallet=0
fallbackfee=0.00001
rpcthreads=8
blocksonly=1
dbcache=4096

# Start zeromq
zmqpubhashblock=tcp://0.0.0.0:18543

Now you can start your Bitcoin node with:

bitcoind --daemon

Ensure the port is open for peer discovery:

sudo ufw allow 8333/tcp

It may take some time for the syncronization to sync, a systemd script is provided for convience here.

Configuring the Bitcoin indexer

Once your node is running and fully synced (this may take a few days), the next step is to setup the Bitcoin indexer which will be used to determine events for the Earth Relayers to keep track of and share. Indexing satoshis is done using the Ordinals protocol, using the indexer. To run this you will need to install Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"

And next, install the indexer with:

git clone https://github.com/social-network/indexer.git
cd indexer && cargo indexer-install

Now create a indexer config file called ‘indexer-settings.json’

{
  "chain": "bitcoin",
  "uuid": "1",
  "name": "Earth Node",
  "version": 1,
  "networks": {
    "testnet": {
      "start_block": 801500,
      "if_this": {
         "scope": "ordinals_protocol",
         "operation": "inscription_feed"
      },
      "then_that": {
        "http_post": {
          "url": "http://localhost:7777/bitcoin",
          "authorization_header": "12345"
        }
      }
    }
  }
}

Bitcoin setup complete! At the end of this setup, we will start our listener that streams any new events to the Earth Node in NIP-77 format, but for now, onto Ethereum.

Ethereum Node Setup

The Ethereum network is made up of an execution client, consensus client, and additional ZK rollup chains, including the Social Network, which is used to scale the speed and transaction throughput of Bitcoin, while reducing the fees to under 0.001 cents. Using Ethereum as a Layer 2 network for Bitcoin, avoids the requirement of bootstrapping another Proof-of-Stake (PoS) validator network, which will likely never surpass the PoS validator network of Ethereum.

Run the Ethereum Lodestar PoS light client:

git clone -b stable https://github.com/chainsafe/lodestar.git
cd lodestar && yarn install
yarn run build
lodestar lightclient \
    --network mainnet \
    --beacon-api-url https://localhost:3693 \
    --checkpoint-root "0xccaff4b99986a7b05e06738f1828a32e40799b277fd9f9ff069be55341fe0229"

This is all that is required to sync with the latest blocks on Ethereum as an Earth Relayer. Additionally, if you are interested in running Ethereum validators to help further secure the Social Network and Ethereum network, please apply here.

Ethereum Validators

Earth Validators is an additional feature which is scheduled to go live in Q2 2024, to ensure the Social Network is also able to provide security to the Ethereum network which it depends on. Ethereum validate earn PoS block rewards through the Social Network Controller, a liquid staking contract on Ethereum. To upgrade your Earth Node to an Earth Validator, you will need to stake 1 ETH per validator, and 31 ETH from the liquid stake will be deployed to begin validating blocks.

Social Network aims to provide a sustainable revenue stream based on the adoption of the largest Decentralized Financial system in the world, without additional dependancies. By connecting Ethereum staking yields, it enables direct connection to a new Regenerative Finance market, and creates additional ways to align incentives for Social Networks of the future with the benefit of all life on Earth.

Nostr Relayer Setup

The final step of setting up your Earth Relay, is running the NIP-77 compatible Nostr Relay. Nostr is a decentralized social networking protocol, which enables permissionless verification of information at lower costs than storing everything on-chain. We will use the Social Network Node.js Relay implementation of Nostr.

Setup node version manager

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm install 18.8

Close the Repo and start databases:

git clone git@github.com:social-network/earth-node.git
cd relay

Start your relay:

npm run start

You will also need to enable relay connections with port 7777, and setup a reverse proxy as required:

sudo ufw allow 7777/tcp

Start Relaying for Earth

Lastly, we can start our Indexer event listener to post real time Bitcoin inscriptions to your Earth Relay:

indexer service start --predicate-path=indexer-settings.json --config-path=Indexer.toml

That’s all! You are now helping decentralize the Social Network network, and enabling scalable, low fee, Bitcoin transactions for the Social Network.

Staked Bitcoin Rewards

Health checks will be made every 15 seconds, so be sure to keep your Relay live to be eligible for the official airdrop! More announcements regarding the role Earth Nodes will be made at Social Network

If you have any questions or are interested in helping partner or build the future of Decentralized Social Networks with us, please contact nodes@social.network via email or on Nostr.

Additional Configurations

Nostr relays, expose a websocket endpoint to interact with the Social Network a decentralized Layer 2 for Bitcoin and Ethereum. Transactions on Social Network are bundled into ZK rollups and sequenced into Ethereum, while the data availability is stored on the Nostr relay and timestamped on Bitcoin every 7 days via NIP03. Additionally, Nostr relays can extend or limit the number of connections from specific IP/client/etc, or add additional features for heart (see NIP22 for more details), with sub cent fees and decentralized bridging between Bitcoin & Ethereum.

The requirements for Nostr Relays will be defined by NIP11 as follows:

{
  "name": <string identifying relay>,
  "description": <string with detailed information>,
  "pubkey": <administrative contact pubkey>,
  "contact": <administrative alternate contact>,
  "supported_nips": <a list of NIP numbers supported by the relay>,
  "software": <string identifying relay software URL>,
  "version": <string version identifier>,
  "limitation": {
    "max_message_length": 16384,
    "max_subscriptions": 20,
    "max_filters": 100,
    "max_limit": 5000,
    "max_subid_length": 100,
    "max_event_tags": 100,
    "max_content_length": 8196,
    "min_pow_difficulty": 30,
    "auth_required": true,
    "payment_required": true,
    "restricted_writes": true,
    "created_at_lower_limit": 31536000,
    "created_at_upper_limit": 3
  }
  "retention": [
    {"kinds": [0, 1, [5, 7], [40, 49]], "heart": 3600},
    {"kinds": [[40000, 49999]], "heart": 100},
  ]
  "relay_countries": [ "BR", "CO", "PA", "CR" ],
  "language_tags": ["en", "en-419"],
  "tags": ["sfw-only", "bitcoin-only", "anime"],
  "posting_policy": "https://example.com/posting-policy.html",
  "payments_url": "https://my-relay/payments",
  "fees": {
    "admission": [{ "amount": 777, "unit": "sats" }],
    "subscription": [{ "amount": 7777, "unit": "sats", "period": 2592000 }],
    "publication": [{ "kinds": [4], "amount": 100, "unit": "sats" }],
  },
  "icon": "https://social.network/logo.jpg",
}

Settings are configurable by each Nostr Relay, unlocking the potential of decentralized finance on Bitcoin to drive new sustainable and efficient markets for the Earth ecosystem.