This branch adds initial BasicSwap support for BitcoinII / BC2 as a Bitcoin Core-like SHA-256 PoW chain.
BasicSwap's published coin integration guidance says each coin is case-by-case, but the readily integrated path requires:
- UTXO scripts.
- CLTV or CSV.
- Segwit enabled.
- Watch-only address support.
- Comparison against similar existing BasicSwap coin integrations.
Source: Particl Academy, "Integrate a Coin", https://academy.particl.io/en/latest/basicswap-guides/basicswapguides_apply.html.
The Academy page notes this requirement list was current for BasicSwap v0.13.4. This branch is based on BasicSwap v0.16.5, so the checklist is treated as the official baseline while the implementation is verified against the current repository patterns.
BitcoinII / BC2 is a Bitcoin Core-derived chain, so this branch follows the existing BTC-like integration pattern used by coins such as Dogecoin and Namecoin: add chain parameters, add a small BTCInterface subclass, wire interface creation and wallet seed checks, add prepare/download/config support, and then validate with daemon and swap tests.
Coins.BC2chain parameters for mainnet, testnet4, and regtest.BitcoinIIInterface, derived fromBTCInterface.- BasicSwap interface selection, seed ID handling, wallet creation, and daemon argument wiring for BC2.
basicswap-preparesupport for--withcoins=bitcoinii.- BitcoinII v29.1.0 release download and extraction support.
- Test coverage for BC2 chain parameter lookup and interface coin type.
- Extended BC2 regtest harness patterned after the existing BTC-like Namecoin tests.
- Coin name:
bitcoinii - Ticker:
BC2 - Display name:
BitcoinII - Daemon:
bitcoinIId - CLI:
bitcoinII-cli - Mainnet RPC port:
8337 - Mainnet P2P port:
8338 - Testnet name:
testnet4 - Testnet RPC port:
48337 - Regtest RPC port:
18447 - Message magic:
BitcoinII Signed Message:\n
- Python syntax checks for changed modules.
- BC2 chain parameter/interface unit test.
basicswap-preparedry-runs for regtest and testnet with--nocores.- BitcoinII v29.1.0 Windows CLI archive download and extraction.
bitcoinIIdregtest RPC smoke test.- Watch-only descriptor import against a private-key-disabled
bitcoinIIdregtest wallet. - Manual requirement probe against
bitcoinIIdv29.1.0:- descriptor RPCs
getdescriptorinfoandimportdescriptorsare available. getdeploymentinfolistscsv,segwit, andtaproot.- the daemon reports
/Satoshi:29.1.0/.
- descriptor RPCs
- Patched BitcoinII Core regtest build from
patches/bitcoinii-core-regtest-mining-fix.patch:- built
bitcoinIId.exeandbitcoinII-cli.exewith wallet support and without GUI/tests/ZMQ. - mined three consecutive regtest blocks with
generatetoaddress. - passed the descriptor/watch-only/mining probe with
repeat_mining_ok: true. - mined 100 additional blocks and verified the watch wallet saw
150.00000000trusted mature BC2.
- built
- Managed regtest setup with Particl plus BC2:
- downloaded and extracted Particl Core v27.2.3.0.
- prepared a wallet-initialized
--regtestBasicSwap datadir withparticlandbitcoinii. - created BC2
bsx_walletand descriptor watch walletbsx_watch. - started full
basicswap-runand confirmed the UI returned HTTP 200. - confirmed BasicSwap detected
BitcoinII Core version 290100. - confirmed the BC2 wallet seed check passed without the "not derived from swap seed" warning.
- Syntax validation for
tests/basicswap/extended/test_bitcoinii.py. - BC2/PART daemon-backed smoke swap:
- started local Particl, Bitcoin Core, and patched BitcoinII Core regtest daemons.
- disabled Monero startup for the smoke run because Windows security blocked
monero-wallet-rpc.exe. - ran
TestBC2.test_02_sh_part_coin. - completed the seller-first PART to BC2 swap path successfully.
- observed both swap clients reach
SWAP_COMPLETED.
- Reverse BC2/PART daemon-backed smoke swap:
- ran
TestBC2.test_03_sh_coin_part. - completed the seller-first BC2 to PART swap path successfully.
- observed both swap clients reach
SWAP_COMPLETED.
- ran
- Confirmed the BasicSwap requirement set and matched BC2 against the BTC-like integration path.
- Added BC2 chain parameters and interface code.
- Added
basicswap-preparesupport for BitcoinII v29.1.0 binaries and config generation. - Added runtime wiring for daemon arguments, wallet creation, descriptor wallets, and seed checks.
- Verified project naming uses
bitcoinii,BitcoinII, andBC2consistently. - Verified BitcoinII descriptor import into a private-key-disabled watch wallet:
createwallet watch disable_private_keys=true blank=true descriptors=trueimportdescriptorsreturned success.getaddressinfoon the imported address returned solvable descriptor data.
- Ran a manual equivalent of the old requirements script as far as the current repo/release allows:
- UTXO/script behavior follows the Bitcoin Core-derived code path and BTC-like interface.
- CSV and Segwit are present in
getdeploymentinfo. - descriptor watch-only wallet RPCs are available and import succeeds.
- Prepared an initial BitcoinII Core regtest mining patch at
patches/bitcoinii-core-regtest-mining-fix.patch. - Built the patched BitcoinII Core daemon/CLI locally and verified repeat regtest mining works.
- Verified funded watch-only balance tracking against the patched regtest daemon.
- Verified managed Particl plus BC2 regtest startup through BasicSwap's runner.
- Added
tests/basicswap/extended/test_bitcoinii.py, an extended daemon-backed harness for:- descriptor spend/watch wallet creation.
- BC2 wallet initialization from BasicSwap seed material.
- repeat regtest mining with patched BitcoinII Core.
- inherited BTC-like script checks for Segwit, CLTV, CSV, watch-only behavior, and related wallet RPCs.
- seller-first PART/BC2 swap success and refund/error-path coverage through the existing shared BTC-like test helpers.
- Verified live seller-first PART to BC2 and BC2 to PART smoke swaps with Monero disabled.
- Run more BC2/PART paths from
tests/basicswap/extended/test_bitcoinii.py, especially refund/error paths. - Run
tests/basicswap/extended/test_bitcoinii.pyend-to-end with patched BitcoinII Core binaries and the standard BasicSwap extended-test daemon set available. On this Windows PC the full inherited suite is currently blocked by Windows security blockingmonero-wallet-rpc.exe. - If the full inherited extended suite is too slow for upstream CI, split out a smaller BC2 smoke test that runs only PART/BC2 seller-first success plus the watch-only/script requirement checks.
- Find or request a signed checksum source for BitcoinII releases. Current prepare support logs the release SHA256 but cannot fully verify it against a signed upstream checksum file.
- Check whether upstream BasicSwap wants BC2 release downloads from
Bitcoin-II/BitcoinII-Coreor a separate binary-release repository. - Confirm whether upstream BasicSwap wants BC2 covered like Namecoin/Dogecoin in the extended test suite, or whether they prefer a smaller opt-in BC2 smoke test.
- Decide whether upstream BasicSwap wants BitcoinII as a built-in coin or maintained as a downstream fork.
- The local Particl binary download hash matched the downloaded Particl assert file. Signature verification was skipped for that one local download because Git for Windows
gpg.exewas available but failed under the Python/GPG path handling in this environment. - The local managed tests use patched BC2 binaries built from
patches/bitcoinii-core-regtest-mining-fix.patch; the stock BC2 v29.1.0 release binary still cannot repeatedly mine regtest blocks.