The BIP300301 enforcer has its own wallet, separate from Bitcoin Core. Here's what it does and when you need it.
The enforcer wallet is used for:
Two separate wallets exist: The mainchain wallet (Bitcoin Core) is for general Bitcoin operations. The enforcer wallet is for BIP-300/301 operations.
Mining doesn't require funds. The coinbase transaction has no inputs — it is the reward. The wallet just needs to:
The enforcer wallet needs UTXOs for:
# With generated mnemonic, no password
./scripts/regtest/create_enforcer_wallet.sh ""
# With password
./scripts/regtest/create_enforcer_wallet.sh "mypassword"
# With existing mnemonic
./scripts/regtest/create_enforcer_wallet.sh "mypassword" /path/to/mnemonic.txt
./scripts/regtest/unlock_enforcer_wallet.sh ""
# or
./scripts/regtest/unlock_enforcer_wallet.sh "mypassword"
grpcurl -plaintext 127.0.0.1:50051 \
cusf.mainchain.v1.WalletService/CreateNewAddress
# Get enforcer address
ENFORCER_ADDR=$(grpcurl -plaintext 127.0.0.1:50051 \
cusf.mainchain.v1.WalletService/CreateNewAddress | \
grep -o '"address":"[^"]*"' | cut -d'"' -f4)
# Send from mainchain wallet
$BITCOIN_CLI -regtest \
-rpcuser=user -rpcpassword=passwordDC \
-rpcport=18443 -datadir=$MAINCHAIN_DATADIR \
-rpcwallet=mainchainwallet \
sendtoaddress "$ENFORCER_ADDR" 1.0
grpcurl -plaintext 127.0.0.1:50051 \
cusf.mainchain.v1.WalletService/GetBalance
./scripts/regtest/mine_with_enforcer.sh 5
~/.local/share/bip300301_enforcer)--wallet-auto-create, manual creation can be skipped