Skip to content

Add Blacklist Pre-flight Checking

In this tutorial, we will add blacklist pre-flight checking to a TypeScript application. By the end, we will have code that:

  1. Fetches the live blacklist registry from CKB testnet
  2. Checks a list of outputs and blocks any that match a blacklisted address
  3. Recovers gracefully when the registry cell moves after a governance update

Here is what the final output looks like:

✓ Registry loaded: 2 active entries
✓ Output 0x331cdd72... → clean
✗ Output 0xababababab... → BlacklistedLockArgs (code 11)
✓ Registry refresh after stale outpoint → 2 active entries

Prerequisites: Node.js 20 or later, an internet connection to reach https://testnet.ckb.dev.

What you do not need: a CKB private key, testnet funds, or any on-chain account. All checks in this tutorial are read-only.

  1. Install the SDK
  2. Fetch the live registry
  3. Check transaction outputs
  4. Handle a stale registry cell
  5. Where to go next