Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch-only Bitcoin Core wallet to track OFAC sanctioned transactions #20

Open
0xB10C opened this issue Jan 13, 2025 · 1 comment
Open

Comments

@0xB10C
Copy link
Owner

0xB10C commented Jan 13, 2025

I've used the following steps to create a Bitcoin Core descriptor wallet tracking transactions on the OFAC sanctioned addresses:

  1. Create a new wallet
bitcoin-cli -named createwallet \
  wallet_name=ofac-sanctioned-watch-only \
  disable_private_keys=true \
  blank=true
  1. (optionally) Load the wallet again
bitcoin-cli loadwallet ofac-sanctioned-watch-only
  1. Get the descriptor checksums from the addresses and construct a JSON array with all descriptors
descriptors=()
while read addr; do
    if [ "$addr" != "TUCsTq7TofTCJRRoHk6RvhMoS2mJLm5Yzq" ]; then
      descriptor=$(bitcoin-cli getdescriptorinfo "addr($addr)" | jq -r '.descriptor')
      descriptors+=( $descriptor )
    fi
done <sanctioned_addresses_XBT.txt

# https://ofac.treasury.gov/faqs/562
# released on March 19, 2018
timestamp=1521441000

json_array="["

for desc in "${descriptors[@]}"; do
  json_array+="{\"desc\": \"$desc\", \"timestamp\": $timestamp, \"label\": \"OFAC sanctioned $desc\"},"
done

json_array=${json_array%,}
json_array+="]"

echo $json_array
  1. Import the descriptors
bitcoin-cli -rpcclienttimeout=0 -rpcwallet=ofac-sanctioned-watch-only importdescriptors "$json_array"

The rescan might take a while (possibly multiple hours)

@0xB10C
Copy link
Owner Author

0xB10C commented Jan 13, 2025

Warning

Bitcoin Core will attempt to rebroadcast all unconfirmed transactions it has in a wallet. This means, you're node (with your IP) will rebroadcast sanctioned transactions. Rebroadcasts are detectable on the network and it's assumed that spynodes/chainanalysis companies do this. You're IP might end up on a list if you run the above commands.

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

No branches or pull requests

1 participant