Query editor
-- Bitcoin quantum vulnerability: unspent supply by script type-- 21Shares Research | Quantum Vulnerability Monitor-- Context: Google Quantum AI whitepaper (Mar 31, 2026) estimates 6.9M BTC-- with exposed public keys are vulnerable to future quantum attacks.-- This query provides the on-chain ground truth by script type.---- Script types and quantum exposure:-- P2PK: Public key IN the locking script. Always exposed. ~Satoshi-era coins.-- P2MS: Multiple public keys in locking script. Always exposed.-- P2TR: Tweaked public key visible by default (Taproot). Exposed.-- P2PKH: Public key hashed. Protected UNLESS address was reused (see Query 2).-- P2WPKH: SegWit version of P2PKH. Same hash protection.-- P2SH: Script hashed. Protected until script is revealed on spend.-- P2WSH: SegWit script hash. Protected.WITH unspent AS (SELECTo.type,o.valueFROM bitcoin.outputs oWHERE NOT EXISTS (SELECT 1FROM bitcoin.inputs iWHERE i.spent_tx_id = o.tx_idAND i.spent_output_number = o.index))SELECTtype AS script_type,COUNT(*) AS utxo_count,ROUND(SUM(value), 8) AS total_btc,ROUND(SUM(value) * 100.0 / SUM(SUM(value)) OVER (), 2) AS pct_of_supply,CASEWHEN type IN ('pubkey') THEN 'PERMANENTLY EXPOSED — public key in locking script'WHEN type IN ('multisig') THEN 'PERMANENTLY EXPOSED — public keys in multisig script'WHEN type IN ('witness_v1_taproot') THEN 'EXPOSED BY DESIGN — tweaked pubkey visible (Taproot)'WHEN type IN ('pubkeyhash', 'witness_v0_keyhash') THEN 'HASH-PROTECTED — but vulnerable if address reused'WHEN type IN ('scripthash', 'witness_v0_scripthash') THEN 'SCRIPT-HASH PROTECTED'ELSE 'OTHER / NON-STANDARD'END AS quantum_risk_tierFROM unspentGROUP BY typeORDER BY total_btc DESC