sigma0-dev / zkbitcoin

zkBitcoin: zero-knowledge proofs on Bitcoin!
MIT License
163 stars 32 forks source link

Add Sanction List #30

Closed ppoliani closed 8 months ago

ppoliani commented 9 months ago

Add sanction list based to the discussion here https://github.com/sigma0-xyz/zkbitcoin/issues/5.

The logic goes like this:

  1. Start a thread that periodically fetches the latest list of sanctioned BTC addresses from here
  2. If the list is fresh it will extract all BTC addresses from that XML file and store in-memory
  3. Exposes a is_sanctioned method that returns true if the address is in the sanction list.
ppoliani commented 9 months ago

It takes around 35s to update fetch the latest OFAC list and extract all addresses from XML to the in memory hashmap. The logic runs in a separate non-blocking thread so it should not cause any issues. Also, they update the list every few days so it's gonna run that often

ppoliani commented 9 months ago

I believe we should start this thread when we run the orchestrator. It should wait for the fist sync of the OFAC list before it starts

mimoo commented 9 months ago

BTW let me know when this is ready for review (looks like CI doesn't pass atm)

ppoliani commented 9 months ago

BTW let me know when this is ready for review (looks like CI doesn't pass atm)

Fixed the lint issues. You can review this :)

ppoliani commented 8 months ago

Sanction ist

I've added a comment regarding this.

https://github.com/sigma0-xyz/zkbitcoin/pull/30#issuecomment-1915156179

It's an XML file and is 92MB big.