Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/commands/install-bitvm.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

REPO="GOATNetwork/bitvm2-node"
REPO="GOATNetwork/bitvm-node"
API_URL="https://api.github.com/repos/${REPO}/releases"
INSTALL_DIR="./bin"
VERSION_FILE=".bitvm-version"
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/rpc-health-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ Monitor goat-node RPC health by polling graph or instance status counts, node on
```bash
# testnet4 public RPC
python3 ./.claude/commands/rpc-health-monitor.py \
--base-url https://bitvm2-api-testnet4.goat.network \
--base-url https://bitvm3-api-testnet4.goat.network \
--once

# override proof-builder lag thresholds and chain RPC sources
python3 ./.claude/commands/rpc-health-monitor.py \
--base-url https://bitvm2-api-testnet4.goat.network \
--base-url https://bitvm3-api-testnet4.goat.network \
--header-chain-height-url https://mempool.space/testnet4 \
--state-chain-rpc-url https://rpc.testnet3.goat.network \
--header-chain-lag-alert-blocks 30 \
Expand Down
6 changes: 3 additions & 3 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
RUST_LOG=debug

# required
ACTOR=Challenger
ACTOR=Verifier

# required
GOAT_GATEWAY_CONTRACT_ADDRESS=0xc3c2D73FB80cbc10DD85B6896e639D47ebd21B01
GOAT_GATEWAY_CONTRACT_ADDRESS=

# required
GOAT_CHAIN_URL=https://rpc.testnet3.goat.network

# required
PEER_KEY=

# required, operator and challenger should setup its BTC private key, committee can setup a seed string.
# required, operator and verifier should setup its BTC private key, committee can setup a seed string.
BITVM_SECRET=

# optional, for relayer only
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ state machines and the peg-out timelock configuration against real races and
boundary conditions found in the Rust implementation. This started as an
**audit pass**: the specs proved several real bugs existed and proved a
correct fix design for each. **As of commit
[`991faaa`](https://github.com/GOATNetwork/bitvm2-node/commit/991faaabdb56c747103e8f1c6d6477c638ccfc4c),
[`991faaa`](https://github.com/GOATNetwork/bitvm-node/commit/991faaabdb56c747103e8f1c6d6477c638ccfc4c),
all 8 of those findings have been fixed and verified in the shipped Rust
code** - see `audit/TLAPlus-20260630.md` for the full report, including what
each real applied fix looks like.
Expand Down
2 changes: 1 addition & 1 deletion audit/TLAPlus-20260710.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BitVM Node — Formal Verification Audit (Round 1)

**Branch:** `audit/round-1` · **Base:** `gc-v2` · **Method:** TLA+ model checking (TLC) · **Status:** all 8 formally-proven findings from this round are now **fixed and verified** in commit [`991faaa`](https://github.com/GOATNetwork/bitvm2-node/commit/991faaabdb56c747103e8f1c6d6477c638ccfc4c) ("Dev fix #418", authored independently by a teammate — not applied by this audit). Two smaller, lower-priority adjacent defects noted under Finding 8 remain open.
**Branch:** `audit/round-1` · **Base:** `gc-v2` · **Method:** TLA+ model checking (TLC) · **Status:** all 8 formally-proven findings from this round are now **fixed and verified** in commit [`991faaa`](https://github.com/GOATNetwork/bitvm-node/commit/991faaabdb56c747103e8f1c6d6477c638ccfc4c) ("Dev fix #418", authored independently by a teammate — not applied by this audit). Two smaller, lower-priority adjacent defects noted under Finding 8 remain open.

## Executive summary

Expand Down
20 changes: 10 additions & 10 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:

committee_0:
image: ghcr.io/goatnetwork/bitvm2-node:${TAG:-0.1.0}
image: ghcr.io/goatnetwork/bitvm-node:${TAG:-0.1.0}
container_name: committee_0
volumes:
- ./committee_0:/var/data
Expand All @@ -16,7 +16,7 @@ services:
restart: unless-stopped

committee_1:
image: ghcr.io/goatnetwork/bitvm2-node:${TAG:-0.1.0}
image: ghcr.io/goatnetwork/bitvm-node:${TAG:-0.1.0}
container_name: committee_1
volumes:
- ./committee_1:/var/data
Expand All @@ -30,23 +30,23 @@ services:
depends_on:
- committee_0

challenger_0:
image: ghcr.io/goatnetwork/bitvm2-node:${TAG:-0.1.0}
container_name: challenger_0
verifier_0:
image: ghcr.io/goatnetwork/bitvm-node:${TAG:-0.1.0}
container_name: verifier_0
volumes:
- ./challenger_0:/var/data
- ./challenger_0/.env:/app/.env
- ./verifier_0:/var/data
- ./verifier_0/.env:/app/.env
ports:
- "8902:9100"
- "8445:8443"
env_file:
- ./challenger_0/.env
- ./verifier_0/.env
restart: unless-stopped
depends_on:
- committee_0

operator_0:
image: ghcr.io/goatnetwork/bitvm2-node:${TAG:-0.1.0}
image: ghcr.io/goatnetwork/bitvm-node:${TAG:-0.1.0}
container_name: operator_0
volumes:
- ./operator_0:/var/data
Expand All @@ -61,7 +61,7 @@ services:
- committee_0

watchtower_0:
image: ghcr.io/goatnetwork/bitvm2-node:${TAG:-0.1.0}
image: ghcr.io/goatnetwork/bitvm-node:${TAG:-0.1.0}
container_name: watchtower_0
volumes:
- ./watchtower_0:/var/data
Expand Down
27 changes: 0 additions & 27 deletions deployment/regtest/bitvm-noded/challenge_0/.env.challenge_0

This file was deleted.

1 change: 0 additions & 1 deletion deployment/regtest/bitvm-noded/challenge_0/run.sh

This file was deleted.

16 changes: 10 additions & 6 deletions deployment/regtest/bitvm-noded/committee_0/.env.committee_0
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ GOAT_CHAIN_URL=https://rpc.testnet3.goat.network
ENABLE_UPDATE_SPV_CONTRACT=true

# the graph config
GOAT_GATEWAY_CONTRACT_ADDRESS=0x26Aa99d72f5f85D60A1B44773B3897793981B7F7
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_gateway_dev
GOAT_GATEWAY_EVENT_FILTER_FROM=10596000
GOAT_SWAP_CONTRACT_ADDRESS=0xe510D5781C6C849284Fb25Dc20b1684cEC445C8B
GOAT_SWAP_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_escrow_manager_dev
GOAT_SWAP_EVENT_FILTER_FROM=10596000
GOAT_GATEWAY_CONTRACT_ADDRESS=
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_GATEWAY_EVENT_FILTER_FROM=
GOAT_SWAP_CONTRACT_ADDRESS=
GOAT_SWAP_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_SWAP_EVENT_FILTER_FROM=

# node config
BITVM_SECRET=
GOAT_PRIVATE_KEY=

GENESIS_SEQUENCER_COMMIT_TXID=

# libp2p config
PEER_KEY=
PROTO_NAME=bitvm_regtest
2 changes: 1 addition & 1 deletion deployment/regtest/bitvm-noded/committee_0/run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nohup ../bitvm-noded --rpc-addr 0.0.0.0:8900 --db-path sqlite:$PWD/bitvm2-node.db --p2p-port 8444 >$PWD/$(date +'%Y%m%d').log 2>&1 &
nohup ../bitvm-noded --rpc-addr 0.0.0.0:8900 --db-path sqlite:$PWD/bitvm-node.db --p2p-port 8444 >$PWD/$(date +'%Y%m%d').log 2>&1 &
16 changes: 10 additions & 6 deletions deployment/regtest/bitvm-noded/committee_1/.env.committee_1
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ BTC_CHAIN_URL=http://127.0.0.1:3002
GOAT_CHAIN_URL=https://rpc.testnet3.goat.network

# the graph config
GOAT_GATEWAY_CONTRACT_ADDRESS=0x26Aa99d72f5f85D60A1B44773B3897793981B7F7
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_gateway_dev
GOAT_GATEWAY_EVENT_FILTER_FROM=10596000
GOAT_SWAP_CONTRACT_ADDRESS=0xe510D5781C6C849284Fb25Dc20b1684cEC445C8B
GOAT_SWAP_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_escrow_manager_dev
GOAT_SWAP_EVENT_FILTER_FROM=10596000
GOAT_GATEWAY_CONTRACT_ADDRESS=
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_GATEWAY_EVENT_FILTER_FROM=
GOAT_SWAP_CONTRACT_ADDRESS=
GOAT_SWAP_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_SWAP_EVENT_FILTER_FROM=

# node config
BITVM_SECRET=
GOAT_PRIVATE_KEY=

GENESIS_SEQUENCER_COMMIT_TXID=

# libp2p config
PEER_KEY=
BOOTNODES=/ip4/127.0.0.1/tcp/8444/p2p/12D3KooWKmAQDFCibTTpKTi6Kwk9SmtLGDXhv5fEsc9gr1Vdcu4j
Expand Down
2 changes: 1 addition & 1 deletion deployment/regtest/bitvm-noded/committee_1/run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8901 --db-path sqlite:$PWD/bitvm2-node.db --p2p-port 8445 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8901 --db-path sqlite:$PWD/bitvm-node.db --p2p-port 8445 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
40 changes: 32 additions & 8 deletions deployment/regtest/bitvm-noded/operator_0/.env.operator_0
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ BTC_CHAIN_URL=http://127.0.0.1:3002
GOAT_CHAIN_URL=https://rpc.testnet3.goat.network

# the graph config
GOAT_GATEWAY_CONTRACT_ADDRESS=0x26Aa99d72f5f85D60A1B44773B3897793981B7F7
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_gateway_dev
GOAT_GATEWAY_EVENT_FILTER_FROM=10596000
GOAT_SWAP_CONTRACT_ADDRESS=0xe510D5781C6C849284Fb25Dc20b1684cEC445C8B
GOAT_SWAP_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_escrow_manager_dev
GOAT_SWAP_EVENT_FILTER_FROM=10596000
GOAT_GATEWAY_CONTRACT_ADDRESS=
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_GATEWAY_EVENT_FILTER_FROM=
GOAT_SWAP_CONTRACT_ADDRESS=
GOAT_SWAP_EVENT_THE_GRAPH_URL=
# block number to start filtering events from
GOAT_SWAP_EVENT_FILTER_FROM=

# node config
BITVM_SECRET=
Expand All @@ -27,5 +29,27 @@ BOOTNODES=/ip4/127.0.0.1/tcp/8444/p2p/12D3KooWKmAQDFCibTTpKTi6Kwk9SmtLGDXhv5fEsc
PROTO_NAME=bitvm_regtest

## Proof
GENESIS_SEQUENCER_COMMIT_TXID=0a7f66f7b4befe841ebc51a53738fa35b833f66a3b001a90e37a751bd9b7713e
GOAT_PROOF_BUILD_URL=
GOAT_PROOF_BUILD_URL=

ZKM_IMM_WRAP_VK=1
# store soldering materials
SOLDERING_PROOF_PAYLOAD_STORE_PATH=

OPERATOR_VK_HASH=0x0091d5d17e00f266331d9597637ff6b7e7c8f9da80aa7a1ac7e2eb94cb569990
OPERATOR_ZKM_VERSION=v1.2.7
GENESIS_SEQUENCER_COMMIT_TXID=

# required for babe
CAC_BATCH_SIZE=100

# In order to generate the following files, please refer to https://github.com/GOATNetwork/bitvm-gc/blob/feat/goat-bitvm3/verifiable-circuit-babe/src/bin/generate_artifacts.rs
FGC_GATES_PATH=
FGC_OUT_INDICES_PATH=
SGC_GATES_PATH=
SGC_OUT_INDICES_PATH=
FGC_COMPACT_GATES_PATH=
FGC_COMPACT_OUT_INDICES_PATH=
SGC_COMPACT_GATES_PATH=
SGC_COMPACT_OUT_INDICES_PATH=

ENABLE_BABE_SETUP_STATE_CLEANUP=true
2 changes: 1 addition & 1 deletion deployment/regtest/bitvm-noded/operator_0/run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8902 --db-path sqlite:$PWD/bitvm2-node.db --p2p-port 8446 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8902 --db-path sqlite:$PWD/bitvm-node.db --p2p-port 8446 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
4 changes: 2 additions & 2 deletions deployment/regtest/bitvm-noded/start_nodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sh -x ./run.sh
cd ..

sleep 1
echo "start challenger_0"
cd challenger_0
echo "start verifier_0"
cd verifier_0
sh -x ./run.sh
cd ..
50 changes: 50 additions & 0 deletions deployment/regtest/bitvm-noded/verifier_0/.env.verifier_0
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
RUST_LOG=info
# required
ACTOR=Verifier

# bitcoin network config
BITCOIN_NETWORK=regtest
BTC_CHAIN_URL=http://127.0.0.1:3002

# goat network config
GOAT_CHAIN_URL=https://rpc.testnet3.goat.network

# the graph config
GOAT_GATEWAY_CONTRACT_ADDRESS=
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=
GOAT_GATEWAY_EVENT_FILTER_FROM=
GOAT_SWAP_CONTRACT_ADDRESS=
GOAT_SWAP_EVENT_THE_GRAPH_URL=
GOAT_SWAP_EVENT_FILTER_FROM=

# node config
BITVM_SECRET=
GOAT_ADDRESS=

# libp2p config
PEER_KEY=
BOOTNODES=/ip4/127.0.0.1/tcp/8444/p2p/12D3KooWKmAQDFCibTTpKTi6Kwk9SmtLGDXhv5fEsc9gr1Vdcu4j
PROTO_NAME=bitvm_regtest

OPERATOR_VK_HASH=0x0091d5d17e00f266331d9597637ff6b7e7c8f9da80aa7a1ac7e2eb94cb569990
OPERATOR_ZKM_VERSION=v1.2.7
GENESIS_SEQUENCER_COMMIT_TXID=

ZKM_IMM_WRAP_VK=1
# store soldering materials
SOLDERING_PROOF_PAYLOAD_STORE_PATH=

# for babe
CAC_BATCH_SIZE=100

# In order to generate the following files, please refer to https://github.com/GOATNetwork/bitvm-gc/blob/feat/goat-bitvm3/verifiable-circuit-babe/src/bin/generate_artifacts.rs
FGC_GATES_PATH=
FGC_OUT_INDICES_PATH=
SGC_GATES_PATH=
SGC_OUT_INDICES_PATH=
FGC_COMPACT_GATES_PATH=
FGC_COMPACT_OUT_INDICES_PATH=
SGC_COMPACT_GATES_PATH=
SGC_COMPACT_OUT_INDICES_PATH=

ENABLE_BABE_SETUP_STATE_CLEANUP=true
1 change: 1 addition & 0 deletions deployment/regtest/bitvm-noded/verifier_0/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8906 --db-path sqlite:$PWD/bitvm-node.db --p2p-port 8450 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
17 changes: 9 additions & 8 deletions deployment/regtest/bitvm-noded/watchtower_0/.env.watchtower_0
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ GOAT_CHAIN_URL=https://rpc.testnet3.goat.network
GOAT_PROOF_BUILD_URL=

# the graph config
GOAT_GATEWAY_CONTRACT_ADDRESS=0x26Aa99d72f5f85D60A1B44773B3897793981B7F7
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_gateway_dev
GOAT_GATEWAY_EVENT_FILTER_FROM=10596000
GOAT_SWAP_CONTRACT_ADDRESS=0xe510D5781C6C849284Fb25Dc20b1684cEC445C8B
GOAT_SWAP_EVENT_THE_GRAPH_URL=https://graph.goat.network/subgraphs/name/bitvm2_escrow_manager_dev
GOAT_SWAP_EVENT_FILTER_FROM=10596000
GOAT_GATEWAY_CONTRACT_ADDRESS=
GOAT_GATEWAY_EVENT_THE_GRAPH_URL=
GOAT_GATEWAY_EVENT_FILTER_FROM=
GOAT_SWAP_CONTRACT_ADDRESS=
GOAT_SWAP_EVENT_THE_GRAPH_URL=
GOAT_SWAP_EVENT_FILTER_FROM=

# node config
BITVM_SECRET=
ALWAYS_CHALLENGE=true

# libp2p config
PEER_KEY=
BOOTNODES=/ip4/127.0.0.1/tcp/8444/p2p/12D3KooWKmAQDFCibTTpKTi6Kwk9SmtLGDXhv5fEsc9gr1Vdcu4j
PROTO_NAME=bitvm_regtest
PROTO_NAME=bitvm_regtest

GENESIS_SEQUENCER_COMMIT_TXID=
2 changes: 1 addition & 1 deletion deployment/regtest/bitvm-noded/watchtower_0/run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8904 --db-path sqlite:$PWD/bitvm2-node.db --p2p-port 8448 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
nohup ../bitvm-noded --rpc-addr 127.0.0.1:8904 --db-path sqlite:$PWD/bitvm-node.db --p2p-port 8448 --bootnodes $bootnode_urls >$PWD/$(date +'%Y%m%d').log 2>&1 &
5 changes: 3 additions & 2 deletions deployment/regtest/proof-builder-rpc/.env.proof-builder-rpc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ZKM_PROVER="network"
#ZKM_PROVER="local"
ENDPOINT=
ZKM_PRIVATE_KEY=
ZKM_IMM_WRAP_VK=1

TOOL="../../circuits"
#TOOL="."
Expand All @@ -21,10 +22,10 @@ ZKM_PROOF_POLL_INTERVAL=2000
# The log directory.
ESPLORA_URL=http://localhost:13002
BITCOIN_NETWORK=regtest
DATABASE_URL=sqlite:/tmp/.bitvm-node-sd.sqlite
DATABASE_URL=sqlite:/tmp/.bitvm-node.sqlite

# GOAT contracts used for live Operator/Watchtower authorization.
GOAT_NETWORK=test
GOAT_CHAIN_URL=https://rpc.testnet3.goat.network
# Proof Builder accepts a comma-separated list; each Node still configures one Gateway address.
GOAT_GATEWAY_CONTRACT_ADDRESS=0x26Aa99d72f5f85D60A1B44773B3897793981B7F7
GOAT_GATEWAY_CONTRACT_ADDRESS=
Loading
Loading