Skip to content

[WIP] - build: point at testnet4-aware bitcoinj / bitcoinj-thin - #632

Closed
jeremy-then wants to merge 2 commits into
masterfrom
rsk-testnet2-bitcoin-testnet4-setup
Closed

[WIP] - build: point at testnet4-aware bitcoinj / bitcoinj-thin#632
jeremy-then wants to merge 2 commits into
masterfrom
rsk-testnet2-bitcoin-testnet4-setup

Conversation

@jeremy-then

@jeremy-then jeremy-then commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Dependency-only change: bump bitcoinj-core to 0.15.6-rsk-6 and bitcoinj-thin to 0.14.4-rsk-19
(plus the matching verification-metadata.xml entries). Those versions add the Bitcoin testnet4
network parameters, which the federator needs on both sides:

  • the federator's full-bitcoinj SPV wallet (its own peer connection to the Bitcoin network), and
  • the embedded rskj bridge (bitcoinj-thin) that validates the headers/txs the federator relays.

No powpeg code change is required for testnet4, the federator already builds its federation as a
segwit P2SH-P2WSH-ERP federation, which is exactly what the testnet2 genesis federation uses.

Motivation and Context

RSK is introducing a testnet2 network whose peg is backed by Bitcoin testnet4 (BIP-94, the successor
to testnet3). For a federator to operate that peg it must understand testnet4 (network magic, genesis,
BIP-94 difficulty rules) on both its SPV wallet and the embedded bridge. This PR pulls in that support via
the dependency bump. Companion PRs:

  • rskj (testnet2 network + bridge/federation constants): rsksmart/rskj
  • bitcoinj (full): rsksmart/bitcoinj0.15.6-rsk-6
  • bitcoinj-thin: rsksmart/bitcoinj-thin0.14.4-rsk-19

How Has This Been Tested?

Built the full stack locally (composite build: powpeg-node + rskj + the testnet4-aware bitcoinj/bitcoinj-thin)
and ran a single self-mined federator on testnet2 against a real, fully-synced Bitcoin testnet4 node
(bitcoind v31). Exercised the federator-specific paths end-to-end:

  • SPV wallet — the federator's full-bitcoinj wallet connected to a testnet4 peer and validated the
    testnet4 header chain (BIP-94) with no verification errors.
  • Peg-inBtcToRskClient detected a deposit to the federation, built the SPV proof, and relayed it via
    registerBtcTransaction; the bridge credited RBTC 1:1.
  • Peg-outBtcReleaseClient signed the segwit (P2SH-P2WSH-ERP) release with the BIP-143 sighash and
    broadcast it to testnet4; the confirmed release's change output was re-registered to the federation.
  • Header relay — relayed the bridge's BTC header chain from testnet4 genesis to the tip
    (~143,800 headers) with zero verification failures.

Note: this is a dependency bump with no powpeg code change, so no new unit tests were added; validation was
end-to-end/integration as above.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

    🚧 WIP / Draft — blocked on dependency releases. This branch references bitcoinj 0.15.6-rsk-6 and
    bitcoinj-thin 0.14.4-rsk-19, which are not published yet (pending review + security review + tagged
    release of the companion PRs). Until they are published, CI will fail to resolve the dependencies —
    expected. Once released, this branch builds as-is.

    • gradle/verification-metadata.xml uses trust rules for the two unpublished artifacts; they should be
      tightened to checksummed <component> entries once the artifacts are published.
    • Federator configuration (keyfiles/signers, the testnet2 overlay, BTC peers, bootnodes) is out of
      scope here and handled by ops — powpeg needs no code change for testnet4.

Bump bitcoinj-core to 0.15.6-rsk-6 and bitcoinj-thin to 0.14.4-rsk-19 so the
federator's SPV wallet and the embedded bridge understand Bitcoin testnet4.
powpeg needs no code change for testnet4 — the federation is already built as
segwit P2SH-P2WSH-ERP.
@jeremy-then jeremy-then self-assigned this Jul 13, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@marcos-iov

Copy link
Copy Markdown
Collaborator

Replaced by #654

@marcos-iov marcos-iov closed this Jul 27, 2026
@marcos-iov
marcos-iov deleted the rsk-testnet2-bitcoin-testnet4-setup branch July 27, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants