← Back to Docs

Enforcer Wallet Guide

The BIP300301 enforcer has its own wallet, separate from Bitcoin Core. Here's what it does and when you need it.

What the Enforcer Wallet Does

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.

Do You Need Funds?

For Mining: No

Mining doesn't require funds. The coinbase transaction has no inputs — it is the reward. The wallet just needs to:

  1. Exist (be created)
  2. Be unlocked
  3. Have an address to receive rewards (generated automatically)

For Other Operations: Yes

The enforcer wallet needs UTXOs for:

Workflow

1. Create the Wallet

# 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

2. Unlock the Wallet

./scripts/regtest/unlock_enforcer_wallet.sh ""
# or
./scripts/regtest/unlock_enforcer_wallet.sh "mypassword"

3. Get Wallet Address

grpcurl -plaintext 127.0.0.1:50051 \
  cusf.mainchain.v1.WalletService/CreateNewAddress

4. Fund the Wallet (If Needed)

# 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

5. Check Balance

grpcurl -plaintext 127.0.0.1:50051 \
  cusf.mainchain.v1.WalletService/GetBalance

6. Mine Blocks

./scripts/regtest/mine_with_enforcer.sh 5

Important Notes