Query editor
-- Bitcoin quantum vulnerability: pre-fork address exposure (upper bound)-- 21Shares Research | Quantum Vulnerability Monitor---- The BCH fork (Aug 1, 2017, block 478558) cloned every Bitcoin UTXO.-- If someone spent their BCH fork coins, the public key was revealed-- on the BCH chain. But the Bitcoin UTXO at that same address may still-- be unspent — meaning the key is exposed cross-chain but NOT on Bitcoin mainnet.---- Our mainnet reuse query (#6936518) doesn't capture this.-- This query finds the UPPER BOUND: all unspent pre-fork P2PKH/P2WPKH-- that are NOT already in the mainnet reuse set.-- The actual fork exposure is a subset of this (only those who claimed BCH).---- NOTE: This scans pre-fork outputs only (block_height < 478558).WITH mainnet_exposed AS (-- Addresses already known to be exposed on Bitcoin mainnetSELECT DISTINCT addressFROM bitcoin.inputsWHERE type IN ('pubkeyhash', 'witness_v0_keyhash')AND address IS NOT NULLAND address != '')SELECTo.type AS script_type,COUNT(*) AS utxo_count,COUNT(DISTINCT o.address) AS address_count,ROUND(SUM(o.value), 4) AS total_btc,ROUND(SUM(o.value) * 68000, 0) AS approx_usd_at_68k,'UPPER BOUND — not all holders claimed fork coins' AS noteFROM bitcoin.outputs oLEFT JOIN mainnet_exposed me ON o.address = me.addressWHERE o.type IN ('pubkeyhash', 'witness_v0_keyhash')AND o.block_height < 478558AND me.address IS NULL -- NOT already exposed on mainnetAND NOT EXISTS (SELECT 1FROM bitcoin.inputs iWHERE i.spent_tx_id = o.tx_idAND i.spent_output_number = o.index)GROUP BY o.typeORDER BY total_btc DESC