BIP362: Output Public Key Exposure Classification #2294

pull duncan0k wants to merge 37 commits into bitcoin:master from duncan0k:bip-output-pubkey-exposure-classification changing 2 files +463 −0
  1. duncan0k commented at 10:37 AM on September 18, 2026: none

    This Informational BIP defines four exposure levels for Bitcoin outputs: EXPOSED_AT_REST, EXPOSED_ON_SPEND, NOT_EXPOSED and UNDETERMINED. They assume an adversary who can compute discrete logarithms on secp256k1, for example with a cryptographically relevant quantum computer. The first two apply BIP 360's long and short exposure to single outputs. The BIP specifies what BIP 360's list of output types leaves open: what counts as revealed, which other outputs a disclosure exposes, and what to report when chain data is missing. It also has test vectors and an informative appendix of per-level actions that a wallet team asked for.

    It changes no consensus, policy or P2P rule and proposes no freezing or forced migration.

    Discussion:

    Reference implementation and test vectors (BSD-2-Clause or CC0-1.0): https://github.com/duncan0k/pubkey-exposure-classification

    The Changelog section lists the changes in each version.

  2. Add BIP draft: Output Public Key Exposure Classification f9c7b68bb4
  3. jonatack added the label New BIP on Sep 18, 2026
  4. in bip-output-pubkey-exposure-classification.md:145 in f9c7b68bb4
     140 | +vulnerability. BIP 360 notes that Bitcoin outputs are generally subject to it; that includes
     141 | +P2MR until a leaf can be satisfied without secp256k1 key material.
     142 | +
     143 | +Note that this level describes an output that is *safe at rest*: the holder still knows something
     144 | +the adversary does not. The name has been read as "already exposed" by at least one reviewer;
     145 | +`EXPOSED_WHEN_SPENT` is under consideration as a clearer label (see Rationale).
    


    murchandamus commented at 7:49 PM on September 23, 2026:

    The description of this level should cover address reuse more comprehensively. If a wallet tracks multiple UTXOs received to the same output script, the exposure window opens when a transaction spending any of the TXOs is broadcast, and closes when all UTXOs received to the output script have been spent.

    Alternative naming ideas should appear in Rationale or Footnotes, not in the Specification section.


    duncan0k commented at 1:39 AM on September 24, 2026:

    Addressed in 2183bf5: a second paragraph under EXPOSED_ON_SPEND covers outputs that share a script, and the naming note is gone from the Specification (the discussion stays in Rationale).

  5. murchandamus commented at 8:10 PM on September 23, 2026: member

    I’m on the fence whether it is necessary to document this classification, but I’m open to be convinced by reviewers stating their support for publication of this document.

    Either way, this document is needlessly wordy — it reads more like an essay than a technical proposal. Please use shorter sentences, cut unnecessary framing, prefer direct statements, and drop unnecessary narrative. Aim for a concise technical writing style assuming a technically competent audience.

  6. murchandamus added the label PR Author action required on Sep 23, 2026
  7. Condense text; cover shared-script exposure window in EXPOSED_ON_SPEND; drop naming note from Specification (v0.6.0) 2183bf543a
  8. duncan0k commented at 1:39 AM on September 24, 2026: none

    Thanks for the review. v0.6.0 is pushed (2183bf5):

    • Rewrote the text for length. The prose went from about 4,700 words to 3,000, the Motivation has no narrative left, and each Rationale entry is a few sentences.
    • EXPOSED_ON_SPEND now covers outputs that pay the same script, as you described: the window opens when a spend of any of them is broadcast and closes when the spend of the last one is confirmed. Once a confirmed spend has published the key, the rest are EXPOSED_AT_REST under the derived condition. The Appendix A floor for that level now says to spend every output on the script in one transaction.
    • Removed the naming note from the Specification; the discussion stays in Rationale.

    While tightening the text I also cleaned up a few edge cases around spend paths that need no signature. The draft no longer claims that every P2MR leaf needs a secp256k1 signature, it notes that a depth-zero P2MR tree is spendable by anyone once its leaf is revealed, and the aggregate-count floor is only lowered once every spend of the script has been seen. The Changelog lists these. Test vector outcomes are unchanged.

  9. duncan0k commented at 11:41 PM on September 30, 2026: none

    @murchandamus v0.6.0 (2183bf5) went up on the 24th with the changes from your review. The text is down to about 3,000 words, EXPOSED_ON_SPEND now covers outputs that share a script, and the naming note is out of the Specification. Could you take another look when you get a chance? If anything else needs changing, let me know. If not, could the "PR Author action required" label be removed?

  10. l0vvkey commented at 2:28 PM on October 8, 2026: none

    I work in BD and support at Gem Wallet, not as a developer, so I can't review the technical details.

    I suggested on Delving that each level should come with a simple recommended action, and I'm glad that was added. From a support point of view, if wallets start warning users about quantum risk, it would help if they all gave the same basic advice. Otherwise users get confused when two wallets say different things about the same coins. For that reason, I'd support publishing it.

  11. duncan0k commented at 4:15 PM on October 9, 2026: none

    cc @conduition, since you replied to the first post on the list. Your point about P2TR outputs without an internal key ended up in the holder-provability note. The draft has changed a fair bit since then and could use a few more eyes, if you feel like taking a look. No pressure either way.

  12. duncan0k commented at 4:09 PM on October 19, 2026: none

    @murchandamus @jonatack The changes from the Sep 23 review went in with 2183bf5 on Sep 24. If nothing else is needed from my side, could the PR Author action required label come off?

  13. in bip-output-pubkey-exposure-classification.md:112 in 2183bf543a
     154 | -applies: nothing sits on the chain to attack at rest, and nothing appears in the mempool at spend
     155 | -time. This level is a property of the output *type*, established by its consensus rules. It MUST
     156 | -NOT be inferred for a hash-committed script from the absence of evidence about the script's
     157 | -contents.
     158 | +The consensus rules of the output's type do not require secp256k1 key material to spend it, so
     159 | +neither attack applies. This level is a property of the output type. It MUST NOT be inferred for a
    


    murchandamus commented at 5:35 PM on October 19, 2026:

    Instead of requiring that an output doesn’t rely on elliptic curve key material, it would be more accurate to require a post-quantum signature scheme. For example a hybrid scheme could rely on elliptic curve cryptography but still be PQ-safe.


    duncan0k commented at 7:05 PM on October 19, 2026:

    Good point. The old test would have ruled out exactly the hybrid case. c306a91 asks for a post-quantum signature on every spending path instead. I also had to say that this level wins over the at-rest conditions, since a hybrid output could carry an EC key in its scriptPubKey.

  14. in bip-output-pubkey-exposure-classification.md:412 in 2183bf543a
     497 | +  and defined "disclosed" by the two `EXPOSED_AT_REST` conditions, so a revealed script or leaf
     498 | +  that requires no signature is not disclosure; the aggregate-count floor is now lowered only after
     499 | +  every spend of the script has been retrieved; dropped the claim that every satisfiable P2MR leaf
     500 | +  requires a secp256k1 signature; stated that a pre-activation witness version 2, 32-byte output
     501 | +  carries the P2MR level and is flagged separately; and noted that a P2MR output with a depth-zero
     502 | +  tree is spendable by anyone once its leaf script is revealed, which implementations SHOULD flag.
    


    murchandamus commented at 5:49 PM on October 19, 2026:

    The 0.6.0 Changelog entry could be more concise. It is much more verbose than the prior ones.


    duncan0k commented at 7:06 PM on October 19, 2026:

    Fair, that one read like a diff. Trimmed it to the size of the others in c306a91.

  15. murchandamus commented at 5:54 PM on October 19, 2026: member

    Sorry, I was out of the office. Thanks for the update, the new text reads much better.

  16. murchandamus removed the label PR Author action required on Oct 19, 2026
  17. Define NOT_EXPOSED by a post-quantum signature on every spending path; shorten the 0.6.0 changelog entry (v0.6.1) c306a911a4
  18. Do not say that a spend through a script needing no signature publishes no key material (v0.6.1) 20cad1bb04
  19. zeenix commented at 8:12 PM on October 19, 2026: none

    @duncan0k Hi, I’ve posted a companion proposal on wallet transaction construction for EXPOSED_ON_SPEND outputs to bitcoin-dev: https://groups.google.com/g/bitcoindev/c/LcczFuBQjsE (I took the liberty of adding you to CC there, I hope you don't mind). If it ends up as a separate document, would you be open to a cross-reference from Appendix A?

  20. duncan0k commented at 4:19 AM on October 20, 2026: none

    @zeenix Sure. Once it has its own document and a stable link, I'm happy to point to it from Appendix A. The floor there is meant to stay minimal and yours covers the full construction rule, so keeping them separate sounds right to me.

  21. cryptoquick commented at 6:37 PM on October 20, 2026: contributor

    This is cool

    We planned to do work like this before everything fell apart

    Helpful messages to users in their wallets about the state of their exposure

    I'm supportive of this work but I'm not sure how much heart I have anymore for it

  22. duncan0k commented at 4:37 PM on November 2, 2026: none

    @jonatack nice to see exposure classification come up on #2340. Is there anything else this one needs before it can get a number? Happy to do another pass if so.

  23. jonatack commented at 5:26 PM on November 2, 2026: member

    Assigned 362. Please update and add a README entry.

  24. jonatack renamed this:
    BIP Draft: Output Public Key Exposure Classification
    BIP362: Output Public Key Exposure Classification
    on Nov 2, 2026
  25. BIP362: rename file, fill in preamble, add README entry fdcc9cbeb4
  26. duncan0k commented at 4:39 AM on November 3, 2026: none

    Thanks, I'll take that over another pass. Done in fdcc9cb: the file is bip-0362.md now and the README entry is in.

  27. BIP362: update author email adfc6743e8
  28. in bip-0362.md:411 in adfc6743e8
     406 | +  scheme qualifies, and it takes precedence over `EXPOSED_AT_REST` (review by murch on the pull
     407 | +  request). Shortened the 0.6.0 entry.
     408 | +* 0.6.0 — Condensed the text; test vector outcomes are unchanged. `EXPOSED_ON_SPEND` now covers
     409 | +  outputs that pay the same script, and its Appendix A floor says to spend them in one transaction.
     410 | +  Removed the naming note from Specification. Review by murch on the pull request. Also clarified
     411 | +  disclosure, the aggregate-count floor and two cases where anyone can spend the output.
    


    murchandamus commented at 11:11 PM on November 3, 2026:

    Nit: The purpose of the Changelog section is to give readers a quick overview of changes compared to a prior version they implemented or were familiar with. It should focus on changes to the specification or other updates that implementers should be aware of. Who reviewed the document is out of place here, and phrasing improvements that didn’t change the meaning are of peripheral importance. E.g., pruning the most recent two entries, I would suggest the following:

    * 0.6.1 — `NOT_EXPOSED` now requires a post-quantum signature on every spending path. Hybrid
      schemes qualify as `NOT_EXPOSED`.
    * 0.6.0 — `EXPOSED_ON_SPEND` now covers
      outputs that pay the same script, and its Appendix A floor recommends to spend them in one transaction. Clarified
      disclosure, the aggregate-count floor, and how to report on anyone-can-spend outputs. Condensed text.
    

    The other entries could be similarly reduced, although much of the Changelog doesn’t seem useful before the document is even published in Draft status.


    duncan0k commented at 1:33 AM on November 4, 2026:

    Fair, it was starting to read like closing credits. Trimmed these and the older entries in aaf470e, keeping the precedence over EXPOSED_AT_REST in 0.6.1 since it can change the reported level.

  29. murchandamus commented at 11:33 PM on November 3, 2026: member

    Thanks for the quick turn-around. Recent changes look good to me, optional nit regarding Changelog.

  30. BIP362: prune Changelog aaf470e8eb
  31. in bip-0362.md:37 in aaf470e8eb
      32 | +  some tools report it as exposed only when next spent.
      33 | +- P2TR. The output key is a public key, but some tools treat the output as protected because the
      34 | +  internal key is hidden.
      35 | +- P2SH and P2WSH outputs whose script has not been revealed.
      36 | +- Keys disclosed off-chain, for example through an xpub or a spend on a fork.
      37 | +- P2MR. It is not exposed at rest, but spending through a leaf that requires a signature reveals
    


    conduition commented at 2:31 PM on November 4, 2026:

    Does it make sense to have P2MR in this list? P2MR is not deployed yet so it cannot affect current exposure estimates.


    duncan0k commented at 6:08 PM on November 8, 2026:

    Agreed. 772e07d removes it from the list, and the type table row now reads "where BIP 360 is active".

  32. in bip-0362.md:79 in aaf470e8eb
      74 | +
      75 | +Each output has exactly one level.
      76 | +
      77 | +#### `EXPOSED_AT_REST`
      78 | +
      79 | +An adversary can derive a private key offline and spend the output at any time, with no warning
    


    conduition commented at 2:35 PM on November 4, 2026:
    A quantum adversary can derive a private key offline and spend the output at any time, with no warning
    

    duncan0k commented at 7:01 AM on November 5, 2026:

    Went with a definition instead: "Adversary" is now in Terminology, as someone who can compute discrete logarithms on secp256k1, so every use of the word carries it.


    duncan0k commented at 8:23 AM on November 7, 2026:

    Applied as you wrote it: 52592f4.

  33. in bip-0362.md:56 in aaf470e8eb
      51 | +The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", and "MAY" in this document
      52 | +are to be interpreted as described in RFC 2119.
      53 | +
      54 | +### Terminology
      55 | +
      56 | +* **Key material**: a secp256k1 public key, compressed, uncompressed, or x-only as defined in
    


    conduition commented at 2:37 PM on November 4, 2026:

    nit: the term "key material" in cryptography typically refers to secret key bytes, i would suggest a different term here. Honestly just using "public key" would probably be fine.


    duncan0k commented at 8:33 AM on November 7, 2026:

    e0c483d changes every use to "public key" and renames the Terminology entry to Public key, same definition.

  34. in bip-0362.md:86 in aaf470e8eb
      81 | +
      82 | +An output is `EXPOSED_AT_REST` if it is disclosed, that is, if either condition holds:
      83 | +
      84 | +1. **Structural**: its `scriptPubKey` contains key material.
      85 | +2. **Derived**: earlier transactions have published key material sufficient to spend it, together
      86 | +   with any script or Merkle path needed to use that key material. For `m`-of-`n` multisig, any
    


    conduition commented at 2:48 PM on November 4, 2026:

    This definition includes cross-address edgecases under exposure as well. E.g: Consider two P2WSH 2-of-2 multisig addresses A and B. Both addresses use the same pubkeys x and y, but their scripts are slightly different, such as swapped ordering, or by using OP_CHECHMULTISIG vs OP_CHECKSIG(VERIFY).

    If address A is spent from, exposing pubkeys x and y, it is considered exposed at rest. But what about address B? Technically it should be covered under your definition. Or you could consider even more wacky edgecases, like if x and y were exposed independently in separate transactions (such as when funding the multisig if x and y were exposed in two distinct P2WPKH inputs).

    I would suggest that you tighten this definition to avoid scope creep. I might try something like

    a transaction unlocked this output's script through a spending condition that required an EC signature but no post-quantum signatures.

    Also note, removing the "earlier" qualifier clarifies that the order of transactions is not important (spending a young output still reveals the pubkeys for ancient outputs and vice-versa).


    murchandamus commented at 9:50 PM on November 4, 2026:

    This comment doesn’t make sense to me. The witness program in P2WSH output scripts contains the hash of the underlying witness script. Two witness scripts that differ in any way will produce different hashes. No third parties would be able to tell from the hashes that the outputs rely on revealed public keys (unless someone is brute-force searching combinations of known existing public keys, which seems outlandish).


    conduition commented at 11:02 PM on November 4, 2026:

    That's exactly my point - The BIP's definition for Derived exposure would cover other addresses besides the one being spent from, which induces a whole boatload of issues and questions. So i'm suggesting the BIP should not be so broad, and focus instead only on the addresses that have actively been spent from. This makes it much simpler, at the price of less conservative classification coverage (i.e. we might mislabel some addresses as EXPOSED_ON_SPEND when in practice a trivial search would expose them)

    P.s. Brute-force searching would not be so hard. With 1 billion known pubkeys, a brute force search of every possible 2-of-2 combination of known keys would be on the order of $2^{61}$ hashing work.


    duncan0k commented at 7:01 AM on November 5, 2026:

    Agreed that "sufficient to spend it" was too broad. 0.7.0 drops it, and "earlier" with it. What's left is a fixed set of hashes computed from each revealed script or published key: a revealed script against its P2SH, P2WSH and P2SH-P2WSH forms, a revealed leaf and path against the P2MR roots they produce, and a published key, in all its encodings, against its P2PKH, P2WPKH and P2SH-P2WPKH forms. Nothing is rebuilt from keys, so your B, or a multisig whose keys showed up in separate inputs, stays EXPOSED_ON_SPEND until its own script is revealed. On 2^61, agreed, that search is reachable, and the text now says the level doesn't rule out such a rebuild.

    I didn't go all the way to the spent address only, because these matches need no search at all: one witness script can be paid through both its P2WSH and P2SH-P2WSH forms, and BIP 360 describes moving P2TR script trees to P2MR, where a leaf revealed under P2TR opens the P2MR output. The Rationale now records the spent-address-only option and why I didn't take it.


    murchandamus commented at 5:19 PM on November 5, 2026:

    @conduition: My bad, I thought you were proposing exactly what you were criticizing. Good catch!


    duncan0k commented at 8:50 AM on November 7, 2026:

    44b7bdf drops "sufficient to spend it", and "earlier" with it. The derived condition is now three direct hash matches, with nothing rebuilt from keys: a revealed redeem or witness script against its P2SH, P2WSH and P2SH-P2WSH forms; a revealed leaf and Merkle path against the P2MR roots they produce; a published key against its P2PKH, P2WPKH and P2SH-P2WPKH forms. Your B stays EXPOSED_ON_SPEND until its own script is revealed, and so does a 2-of-2 whose keys showed up in two separate inputs. The text now says that the level doesn't rule out the 2^61 kind of rebuild.

    Spent-address-only is one step further than I want to go. It would call all 83,377 unspent outputs at the genesis coinbase key's P2PKH address (mempool.space address stats, 2026-11-07) EXPOSED_ON_SPEND, with the key sitting in the genesis P2PK output and its P2PKH hash one HASH160 away. The three matches above need no search, and that's where I'd draw the line. The Rationale records the spent-address-only option under "Beyond the spent output".

  35. in bip-0362.md:107 in aaf470e8eb
     102 | +
     103 | +Outputs that pay the same `scriptPubKey` share one window. It opens when a spend of any of them is
     104 | +broadcast and closes when the spend of the last remaining one is confirmed and buried. Once a
     105 | +confirmed spend has published key material that meets the derived condition, the other outputs
     106 | +paying the script, and any paid to it later, are `EXPOSED_AT_REST`. Unconfirmed spends do not
     107 | +change a level.
    


    conduition commented at 3:03 PM on November 4, 2026:

    spending it is assumed to publish key material

    The exposure window opens when a spending transaction is broadcast

    This is not necessarily the case for P2MR, even though P2MR outputs are classified as EXPOSED_ON_SPEND. It depends on the script used. Spending a P2MR output with a pure-PQ script shouldn't unequivocally label all sister outputs as exposed. You need an oracle for whether a P2MR spend is considered as an exposure event, which would require analyzing script execution traces to determine whether any PQ signatures were verified.


    duncan0k commented at 7:01 AM on November 5, 2026:

    0.7.0 doesn't need that oracle. Condition 2 now checks only whether a revealed leaf and Merkle path produce the output's root, regardless of how the script executed. BIP 360 has no post-quantum opcode yet, so every revealed leaf counts for now, and the text notes that this will over-report once a leaf can require a post-quantum signature.


    duncan0k commented at 9:00 AM on November 7, 2026:

    No oracle needed after 559deab: the P2MR match checks only that a revealed leaf and Merkle path produce the output's root, however the spend executed. BIP 360 has no post-quantum opcode, so no revealed leaf can require one today. The text says the match will over-report once one can; a later revision can narrow it by leaf version at that point.

  36. in bip-0362.md:112 in aaf470e8eb
     107 | +change a level.
     108 | +
     109 | +#### `NOT_EXPOSED`
     110 | +
     111 | +The consensus rules of the output's type require a valid post-quantum signature on every spending
     112 | +path. A hybrid scheme that also requires a secp256k1 signature qualifies; a path that can be
    


    conduition commented at 3:07 PM on November 4, 2026:

    i'm not sure if this is the right way to phrase it, because hypothetically it should always be possible to create scripts without OP_CHECKSIG, so an output type that "requires" PQ sigs on every spend is unlikely to be deployed.

    Maybe a better phrasing would be "An output type that does not admit spending paths that use only classical signatures."


    duncan0k commented at 7:01 AM on November 5, 2026:

    I kept the strict wording on purpose. A path that needs no signature counts as exposure everywhere else in the document (murch's point on line 173), so a type that admits such paths can't be NOT_EXPOSED, and the level has to be a property of the type because the leaves of an unspent tree can't be enumerated. A future type still qualifies if its consensus rules require a post-quantum signature regardless of the script, for example a key-only post-quantum type, or one that checks a post-quantum signature in addition to whatever the script does.


    duncan0k commented at 9:54 AM on November 7, 2026:

    23c56f7 keeps the requirement of a post-quantum signature on every path and spells out the no-signature case. A type can meet it without every script branch calling a post-quantum opcode: consensus can check a post-quantum signature on every spend regardless of what the script does, or the type can have no script at all. Ruling out only classical-signature paths would leave room for a path with no signature, and the document treats such a path as EXPOSED_AT_REST once revealed (the line 173 thread). Since the leaves of an unspent tree can't be enumerated, the level has to stay a property of the type.

  37. in bip-0362.md:71 in aaf470e8eb
      66 | +* **Long exposure** and **short exposure**: the two attacks defined in
      67 | +  [BIP 360](bip-0360.mediawiki), on key material that is on the chain and on key material that is
      68 | +  in the mempool while a spend is unconfirmed.
      69 | +
      70 | +Unconfirmed transactions MUST NOT be used to determine an exposure level. Mempool disclosure is
      71 | +not a property of the chain and may never become one. Implementations MAY report it separately.
    


    conduition commented at 3:14 PM on November 4, 2026:

    So if this is an informational BIP, not a consensus mechanism, why should we not also consider the mempool when classifying?

    It's clear from the "Classification with partial history" section that universal consensus on output type exposure is not possible without a full reindex of the chain. So unless you remove that section and require a reindex, implementations will compute different exposure classes than others for certain outputs. Therefore i'd suggest (since impls won't be in agreement anyway) that they also factor in unconfirmed transactions, orphaned blocks, etc, whatever info is available to them.


    duncan0k commented at 7:01 AM on November 5, 2026:

    Only confirmed transactions count, because a level built on mempool contents or stale blocks couldn't be reproduced later; 0.7.0 lists both under Disclosure Outside the Chain. And the premise no longer holds: with less data, an implementation now assigns UNDETERMINED where it can't establish a condition, and the level where it can (a positive spend count is enough for EXPOSED_AT_REST), so two implementations never disagree on a definite level.


    duncan0k commented at 5:26 PM on November 8, 2026:

    After ea6cb97 the premise no longer holds: two implementations with complete data assign the same levels, and one with less data differs only by assigning UNDETERMINED where it can't establish a condition. Mempool contents and stale blocks differ between nodes and change over time, so a level built on them couldn't be reproduced later, and the agreement would be gone. c3e8add lists both under Out-of-Band Disclosure, where implementations may report them separately, and puts the reason in the Rationale.

  38. in bip-0362.md:173 in aaf470e8eb
     168 | +NOT let it lower the level.
     169 | +
     170 | +**P2SH and P2WSH are `EXPOSED_ON_SPEND`.** The script is unknown until spent. A spend reveals it,
     171 | +together with any key material its signatures require. A script that requires no signature might
     172 | +not publish any key material when spent, but that cannot be observed before the spend and MUST NOT
     173 | +be assumed.
    


    conduition commented at 3:16 PM on November 4, 2026:

    Once such a non-standard no-signature script is published, I think you should classify any sister outputs under UNDETERMINED, yes?


    murchandamus commented at 9:57 PM on November 4, 2026:

    Given that such a script would be anyone-can-spend, shouldn’t it be also EXPOSED_ON_REST? You don’t need a quantum computer, but anyone can spend it.


    duncan0k commented at 7:01 AM on November 5, 2026:

    0.7.0 goes with murch's answer: other outputs committing to a revealed no-signature script are EXPOSED_AT_REST. That also removed the exception in what was the partial-history section.


    duncan0k commented at 9:36 AM on November 7, 2026:

    231b36d takes murch's answer, so the other outputs committing to a revealed no-signature script are EXPOSED_AT_REST. The partial-history exception existed only for this case and is gone too, and the depth-zero P2MR tree now follows the same rule.

  39. in bip-0362.md:207 in aaf470e8eb
     202 | +where available, is sufficient:
     203 | +
     204 | +> If the count is greater than zero, at least one confirmed spend has occurred. For every type in
     205 | +> the table other than `UNDETERMINED`, a spend publishes what the script commits to: the key, the
     206 | +> full script and its keys, or for P2MR the executed leaf with its Merkle path and keys. All of
     207 | +> its outputs are therefore `EXPOSED_AT_REST`. A count of zero establishes only that no output
    


    conduition commented at 3:18 PM on November 4, 2026:

    Another place here where P2MR's exposure diverges from the other EXPOSED_AT_REST output types


    duncan0k commented at 7:01 AM on November 5, 2026:

    It doesn't diverge any more: a confirmed spend of the same P2MR scriptPubKey reveals a leaf and path that produce its root, which is condition 2 whatever the leaf requires. Same trade-off as on line 107.


    duncan0k commented at 9:41 AM on November 7, 2026:

    Gone in e4c72f2. Since the condition no longer looks at what the leaf requires, a spend count on a P2MR script works the same way as on P2SH or P2WSH. Once a spend reveals the leaf and path, every output with that root is EXPOSED_AT_REST.

  40. in bip-0362.md:208 in aaf470e8eb
     203 | +
     204 | +> If the count is greater than zero, at least one confirmed spend has occurred. For every type in
     205 | +> the table other than `UNDETERMINED`, a spend publishes what the script commits to: the key, the
     206 | +> full script and its keys, or for P2MR the executed leaf with its Merkle path and keys. All of
     207 | +> its outputs are therefore `EXPOSED_AT_REST`. A count of zero establishes only that no output
     208 | +> paying this `scriptPubKey` has a confirmed spend.
    


    conduition commented at 3:19 PM on November 4, 2026:

    Why is this block styled as a quote?


    duncan0k commented at 6:10 PM on November 8, 2026:

    A formatting slip; the text is normative. 44987e4 unquotes it.

  41. in bip-0362.md:210 in aaf470e8eb
     205 | +> the table other than `UNDETERMINED`, a spend publishes what the script commits to: the key, the
     206 | +> full script and its keys, or for P2MR the executed leaf with its Merkle path and keys. All of
     207 | +> its outputs are therefore `EXPOSED_AT_REST`. A count of zero establishes only that no output
     208 | +> paying this `scriptPubKey` has a confirmed spend.
     209 | +
     210 | +Implementations SHOULD use this inference as a floor that retrieved transactions do not lower, with
    


    conduition commented at 3:20 PM on November 4, 2026:

    What do you mean by a "floor" here?


    duncan0k commented at 6:49 PM on November 8, 2026:

    I meant a level that the transactions you do retrieve can't lower. 9d6b208 says that in words and drops the term from the Specification and the reference implementation note; the Rationale paragraph (line 347 thread) and the Appendix column (line 363 thread) get their own commits.

  42. in bip-0362.md:226 in aaf470e8eb
     221 | +Address-indexed data sources index outputs by the address encoded in their `scriptPubKey`. P2PK
     222 | +and bare P2MS outputs have no address and are often missing from the history of the P2PKH address
     223 | +for the same key. An implementation that relies on such a source can miss a P2PK disclosure and
     224 | +report `EXPOSED_ON_SPEND` for a key that has been on the chain since 2009. Implementations SHOULD
     225 | +also query by script hash where the source allows it, and MUST document the limitation where it
     226 | +does not.
    


    conduition commented at 3:35 PM on November 4, 2026:

    How common is this in the chain history? (reusing a pubkey between P2PK and P2PKH)

    If you're considering this in-scope, should you not also consider pubkeys reused between P2PKH/P2WPKH, or other address types?

    What about compressed vs uncompressed ECDSA pubkeys?

    It may be simpler just to remove this from scope.


    duncan0k commented at 7:01 AM on November 5, 2026:

    It stays in scope, limited to P2PKH, P2WPKH and P2SH-P2WPKH. A published key is matched in all six encodings of the two points with its x-coordinate, so a key seen uncompressed matches the P2PKH of its compressed form and the other way round, and an x-only key matches both points. I don't have a chain-wide count. The genesis coinbase is one case: it pays P2PK, and the P2PKH address of that key has about 83,000 outputs today, none spent, which matching per script would call EXPOSED_ON_SPEND.


    duncan0k commented at 4:36 PM on November 8, 2026:

    154a922 keeps it in scope and puts the encoding rule in the text: a published key matches through all six encodings of the two points with its x-coordinate, so an uncompressed key matches the P2PKH of its compressed form and the other way round, and an x-only key matches both points. P2WPKH and P2SH-P2WPKH are covered alongside P2PKH. The P2PK case already needs the index of published keys, and the other forms are a few more hashes per key.

    I've run a full-chain count for these cases and will post it in this thread together with the code and tables. The genesis key alone (public since block 0) has 83,377 unspent P2PKH outputs as of 2026-11-07. Between P2PKH and the SegWit forms, wallets did this on purpose for years: Bitcoin Core's addwitnessaddress (0.13.0 to 0.17, deprecated from 0.16) took an existing P2PKH address and returned a P2SH-P2WPKH address for the same key, and from 0.16 a legacy wallet treats every compressed key as P2PKH, P2SH-P2WPKH and P2WPKH at once, which combo() later spelled out. Electrum imports one WIF under p2pkh:, p2wpkh-p2sh: or p2wpkh:. A 2026 measurement of key reuse across script types (arXiv:2601.19500) finds it still going on, mostly between P2PKH and P2WPKH.


    duncan0k commented at 3:39 AM on November 18, 2026:

    By block 975,019, 40,385 of the 217,086 P2PK keys were also paid to as P2PKH. Across P2PK, P2PKH, P2WPKH and P2SH-P2WPKH, 264,361 of 1,279,844,406 keys were paid to under two or more forms (both denominators counted before curve validation). The largest pair is P2PKH and P2WPKH at 189,857 keys in any encoding on either side, not checked for the same hash. 5,011 keys were paid to as P2PKH or P2WPKH both compressed and uncompressed, 4,570 as P2PKH under both encodings.

    All counts cover keys the scan found on chain, one per x-coordinate, matched in all six encodings, ever paid to, spent or not. The counts are in https://github.com/duncan0k/btc-exposure-index/blob/2a0f4b053cad2ae3dc101a4e4c154ac2b4706f25/results/975019/btc-indexer-stats.json, and the write-up is at https://delvingbitcoin.org/t/how-much-btc-sits-behind-keys-or-scripts-already-on-chain-block-975-019/3088.

  43. in bip-0362.md:240 in aaf470e8eb
     235 | +  including keys of outputs never spent;
     236 | +* reuse of the key on sidechains, bridges or other protocols;
     237 | +* compromise or publication by anyone holding the key.
     238 | +
     239 | +The levels describe only what the chain shows. Implementations MUST NOT present
     240 | +`EXPOSED_ON_SPEND` or `NOT_EXPOSED` as evidence that no disclosure has occurred. Implementations
    


    conduition commented at 3:37 PM on November 4, 2026:

    what does it mean to "present" an exposure class?


    duncan0k commented at 6:56 PM on November 8, 2026:

    It meant reporting the level to a user or a caller, and "present" was the wrong word for it. 1bc1462 rewrites the sentence: a level of EXPOSED_ON_SPEND or NOT_EXPOSED is not evidence that no disclosure has occurred, and implementations must not report it as such.

  44. in bip-0362.md:305 in aaf470e8eb
     300 | +
     301 | +| Condition | Required level |
     302 | +| --- | --- |
     303 | +| P2PKH script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
     304 | +| P2WSH script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
     305 | +| P2PKH script, no confirmed spend, retrieved history truncated | `EXPOSED_ON_SPEND` |
    


    conduition commented at 3:41 PM on November 4, 2026:

    truncated history + P2PKH should be UNDETERMINED, as per your earlier rule:

    If neither complete history nor an aggregate count is available, the implementation MUST assign UNDETERMINED.


    duncan0k commented at 7:01 AM on November 5, 2026:

    Fixed. That case is now UNDETERMINED, and each row of the new history table says what data is available.


    duncan0k commented at 4:51 PM on November 8, 2026:

    Right, that row belongs under UNDETERMINED. ea6cb97 changes it and spells the rule out: a level other than UNDETERMINED needs its condition established; a positive spend count establishes EXPOSED_AT_REST; EXPOSED_ON_SPEND needs the derived condition checked against every confirmed transaction and not met, since another script may have published the key; a count of zero establishes no level. The fail-closed rule, the UNDETERMINED definition and the Indexer Blind Spots section are adjusted to that, so an address-indexed source ends up with EXPOSED_AT_REST on a positive count or UNDETERMINED.

  45. in bip-0362.md:309 in aaf470e8eb
     304 | +| P2WSH script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
     305 | +| P2PKH script, no confirmed spend, retrieved history truncated | `EXPOSED_ON_SPEND` |
     306 | +| P2PKH script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     307 | +| P2TR script, no transactions at all | `EXPOSED_AT_REST` |
     308 | +| P2MR script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     309 | +| P2MR script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
    


    conduition commented at 3:45 PM on November 4, 2026:

    This conflicts with your earlier description of P2MR, and the resulting exposure level should depend on the nature of the spend.


    duncan0k commented at 7:01 AM on November 5, 2026:

    Same answer as on line 107: the level doesn't depend on how the spend executed. The old rows are gone. In the new history table, a leaf revealed by a P2TR spend that produces the output's root gives EXPOSED_AT_REST, and a published leaf key alone gives EXPOSED_ON_SPEND.


    duncan0k commented at 4:59 PM on November 8, 2026:

    0c2ce53 rewrites the row around what the spend revealed: a leaf and Merkle path giving the output's root. Since 559deab that is all the level depends on; what the leaf requires and how the spend executed don't enter. A second row covers a leaf revealed by a P2TR spend of the same tree, the migration case BIP 360 describes.

  46. in bip-0362.md:310 in aaf470e8eb
     305 | +| P2PKH script, no confirmed spend, retrieved history truncated | `EXPOSED_ON_SPEND` |
     306 | +| P2PKH script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     307 | +| P2TR script, no transactions at all | `EXPOSED_AT_REST` |
     308 | +| P2MR script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     309 | +| P2MR script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
     310 | +| P2MR script, script-path spend occurred, revealed leaf key reused elsewhere | revealed key's other outputs become `EXPOSED_AT_REST` |
    


    conduition commented at 3:47 PM on November 4, 2026:

    This vector is unclear. You're saying a P2MR output was spent from, presumably revealing an EC key, and the revealed leaf contained an EC pubkey which was also "reused" elsewhere. What does "reused" mean in this situation? What happens to the P2MR output in question? The 2nd column refers only to "revealed key's other outputs" and says nothing about the P2MR output in the vector.


    duncan0k commented at 5:17 PM on November 8, 2026:

    "Reused" meant that a key in the revealed leaf also appeared in another output, and the row never said which output it was classifying. The P2MR script that was spent from is EXPOSED_AT_REST under the row above, since the spend revealed its leaf and path. 1b50792 replaces this row with two: an unspent P2MR script with a published key in one of its leaves and no leaf revealed is EXPOSED_ON_SPEND, since spending it still needs the leaf and path; an unspent P2PKH script whose key was revealed in a leaf by a confirmed P2MR spend is EXPOSED_AT_REST by the published-key match.

  47. in bip-0362.md:311 in aaf470e8eb
     306 | +| P2PKH script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     307 | +| P2TR script, no transactions at all | `EXPOSED_AT_REST` |
     308 | +| P2MR script, no confirmed spend, complete history available | `EXPOSED_ON_SPEND` |
     309 | +| P2MR script, one or more confirmed spends, balance remains | `EXPOSED_AT_REST` |
     310 | +| P2MR script, script-path spend occurred, revealed leaf key reused elsewhere | revealed key's other outputs become `EXPOSED_AT_REST` |
     311 | +| Hash-committed script (e.g. P2PKH), aggregate statistics unavailable, history incomplete | `UNDETERMINED` |
    


    conduition commented at 3:48 PM on November 4, 2026:

    Typo?

    | Hash-committed script (e.g. P2SH), aggregate statistics unavailable, history incomplete | `UNDETERMINED` |
    

    duncan0k commented at 8:28 AM on November 7, 2026:

    Yes, a typo. P2SH now, in 5d9d833.

  48. in bip-0362.md:317 in aaf470e8eb
     312 | +
     313 | +## Rationale
     314 | +
     315 | +**Four levels.** A single exposed/not-exposed split would merge a standing threat with a
     316 | +spend-time race. The first calls for migration; the second for sweeping the script when it is
     317 | +spent. `UNDETERMINED` is required by the fail-closed rule, not by a difference in risk.
    


    conduition commented at 3:57 PM on November 4, 2026:

    Suggested rewrite, to be a little less AI-sounding:

    Four exposure levels. A binary exposed/not-exposed flag would lump long-exposure and short-exposure targets together into one bucket, and leaves no correct bucket for scripts that don't use any signature schemes at all (e.g. hash puzzle scripts). EXPOSED_AT_REST outputs are a more urgent target for migration, as they are more likely to be viable targets sooner than EXPOSED_ON_SPEND outputs, and any exposure classification system ought to specify the distinction between them.


    duncan0k commented at 7:01 AM on November 5, 2026:

    Took this, except the hash-puzzle part: a revealed script that needs no signature now counts as exposed (murch's answer on line 173), so those scripts have a bucket.


    duncan0k commented at 8:07 AM on November 9, 2026:

    Now in 8ddac12 as described above. The old closing sentence on UNDETERMINED stays at the end, since your paragraph covers only EXPOSED_AT_REST and EXPOSED_ON_SPEND.

  49. in bip-0362.md:332 in aaf470e8eb
     327 | +
     328 | +**The name `EXPOSED_ON_SPEND`.** The level describes an output that is safe at rest: the holder
     329 | +still knows something the adversary does not. Reviewers have read the name as "already exposed by
     330 | +a spend". `EXPOSED_WHEN_SPENT` is the leading alternative. The name is kept stable while this is
     331 | +discussed; implementations tracking this draft should treat the two spellings as synonyms until
     332 | +the name is settled.
    


    conduition commented at 3:59 PM on November 4, 2026:

    What is the sentence about "reviewers" doing in here?

    Why bother discuss alternative names for classes in the BIP itself?

    This paragraph should probably just be removed.


    duncan0k commented at 8:12 AM on November 9, 2026:

    The BIP doesn't need it, and 1b51106 deletes it. It asked implementers to accept both spellings while the name was under discussion.

  50. in bip-0362.md:339 in aaf470e8eb
     334 | +**Attacker-spendability, not holder-provability.** The classification describes what an adversary
     335 | +can do under current consensus rules, which is observable. Whether the holder retains a secret the
     336 | +adversary lacks, such as a P2TR internal key, is not: a tweaked `Q` cannot be distinguished
     337 | +on-chain from a bare key. A classification based on it could not be deterministic, and a recovery
     338 | +mechanism based on it would fail for an unknown fraction of P2TR outputs. Holder-provability
     339 | +belongs in a rescue protocol specification.
    


    conduition commented at 4:04 PM on November 4, 2026:

    AI-ism cleanup:

    Focus on attacker capability. The classification describes what an adversary can do under current consensus rules, according to a deterministic rule set about chain history. Whether the holder retains a secret the adversary lacks, such as a P2TR internal key, is not relevant to this question. A tweaked taproot output key cannot be distinguished on-chain from an untweaked output key. Classification based on this is impossible, and recovery protocols are out-of-scope for this BIP.


    duncan0k commented at 8:17 AM on November 9, 2026:

    Word for word in 6662bab, title included.

  51. in bip-0362.md:343 in aaf470e8eb
     338 | +mechanism based on it would fail for an unknown fraction of P2TR outputs. Holder-provability
     339 | +belongs in a rescue protocol specification.
     340 | +
     341 | +**No scoring.** A risk score depends on balance, dormancy and CRQC timelines, which are contested
     342 | +and not observable on-chain. Standardizing only the observable makes independent results
     343 | +comparable.
    


    conduition commented at 4:14 PM on November 4, 2026:

    Balance and dormancy are observable on-chain.

    What does it mean for results to be "comparable" here, since they are clearly different depending on how much of the chain you've indexed?

    I do agree that a score system is probably the wrong way to go, but only because a score is a value judgment, and this BIP aims to be informational, not prescriptive.

    Suggested rewrite:

    No scoring. A risk score would require a subjective scoring formula that factors in various quantities like coin value and dormancy, and weighs their relative importance to an unidentified coin holder. Rather than assessing risk with arbitrary formulas on behalf of users, this BIP aims purely to inform users about well-defined properties of the coin supply. Users are free to make their own judgments and act accordingly.


    duncan0k commented at 8:44 AM on November 9, 2026:

    Balance and dormancy are on-chain, yes, and 833acaf uses your rewrite unchanged. By "comparable" I meant that two tools reading the same chain data agree; one with less of the chain indexed returns UNDETERMINED on more outputs instead, so the claim went with the old paragraph.

  52. in bip-0362.md:347 in aaf470e8eb
     342 | +and not observable on-chain. Standardizing only the observable makes independent results
     343 | +comparable.
     344 | +
     345 | +**The aggregate-count floor.** A full history scan is unbounded for heavily used scripts and
     346 | +unavailable to many light clients. The floor needs one counter and prevents a truncated scan from
     347 | +under-reporting.
    


    conduition commented at 4:17 PM on November 4, 2026:

    Use of the term "unbounded" seems inappropriate here. A full history scan is of course bounded in terms of computational complexity - it is bounded by the length of the chain.

    What do you mean by "the floor"?

    Why does it prevent a truncated scan (by which I assume you mean "a scan without a complete address index") from under reporting?


    duncan0k commented at 7:00 PM on November 8, 2026:

    All three are in 6617341. "Unbounded" is out; the paragraph now says that the full history of a heavily used script is long and many light clients can't retrieve it. The floor was the level that the transactions you do retrieve can't lower; that word went with it, here and in the line 210 thread. By a truncated scan I meant an indexed query that stops before the end of the history, by pagination or a scan limit, while the spend count is still available. A positive count establishes EXPOSED_AT_REST by itself, even if the scan stopped before the first spend, and a count of zero with an incomplete scan gives UNDETERMINED under ea6cb97.

  53. in bip-0362.md:354 in aaf470e8eb
     349 | +**Relationship to BIP 361.** BIP 361 defines its phases over output types, which consensus can
     350 | +evaluate. This document answers a per-output question that consensus does not: whether the key of
     351 | +a given output has already been published. Neither depends on the other.
     352 | +
     353 | +**Relationship to BIP 360.** BIP 360 defines the two attacks and lists which output types are
     354 | +vulnerable to long exposure; the table above starts from that list. BIP 360 also defines P2MR,
    


    conduition commented at 4:19 PM on November 4, 2026:

    nit: "the table above" should be a link or explicit section reference (there are several tables above, which one?)


    duncan0k commented at 7:10 AM on November 9, 2026:

    Classification by Output Type, the first of them. 598c5d0 now links to that section.

  54. in bip-0362.md:362 in aaf470e8eb
     357 | +BIP 360 is not activated.
     358 | +
     359 | +## Appendix A: Holder Implications (Informative)
     360 | +
     361 | +For each level, the table gives the minimum action a holder should be advised to take and a fixed
     362 | +action key. Implementations MAY expose the key alongside the level so that wallets present the
    


    conduition commented at 4:21 PM on November 4, 2026:

    Confusing word choice here: "expose the key" means something contextually very different here, but collides with other usage of the terms "expose" and "key" elsewhere in this document.

    Maybe just use the term "recommendation" or "action" instead.


    duncan0k commented at 7:20 AM on November 9, 2026:

    "Action key" is the table's name for the column, so 903614006b uses that term and drops "expose": "Implementations MAY report the action key alongside the level so that wallets give the same baseline advice."

  55. in bip-0362.md:363 in aaf470e8eb
     358 | +
     359 | +## Appendix A: Holder Implications (Informative)
     360 | +
     361 | +For each level, the table gives the minimum action a holder should be advised to take and a fixed
     362 | +action key. Implementations MAY expose the key alongside the level so that wallets present the
     363 | +same baseline. Implementations SHOULD NOT give advice that contradicts the floor. Wording,
    


    conduition commented at 4:22 PM on November 4, 2026:

    The word "floor" is confusing here. In the table below, the "floor" column seems like a description of the recommended action for users to take.

    I would change this to "Description" or "Explanation"


    duncan0k commented at 7:27 AM on November 9, 2026:

    Renamed to "Minimum advice" in a4dac2d, which also takes "floor" out of the rest of the Appendix. I preferred it to "Description" because the column gives the least a wallet should advise, and wallets can say more.

  56. in bip-0362.md:369 in aaf470e8eb
     364 | +reasons and urgency are left to them.
     365 | +
     366 | +| Level | Action key | Floor |
     367 | +| --- | --- | --- |
     368 | +| `EXPOSED_AT_REST` | `MIGRATE` | Move the funds to an output type that is not exposed at rest as soon as one the holder trusts is available. Until then, do not add funds to the output. |
     369 | +| `EXPOSED_ON_SPEND` | `SWEEP_WHEN_SPENDING` | No action while unspent. When spending, spend every output paying the same script in one transaction, and do not send change or new funds back to that script. |
    


    conduition commented at 4:26 PM on November 4, 2026:

    For wallets, in more practical terms, this means "Discourage the user from distributing this address for receiving payments."


    duncan0k commented at 7:36 AM on November 9, 2026:

    The row now opens with it, in 6b4d259: "Stop giving out the address for new payments; no other action while unspent."

  57. in bip-0362.md:371 in aaf470e8eb
     366 | +| Level | Action key | Floor |
     367 | +| --- | --- | --- |
     368 | +| `EXPOSED_AT_REST` | `MIGRATE` | Move the funds to an output type that is not exposed at rest as soon as one the holder trusts is available. Until then, do not add funds to the output. |
     369 | +| `EXPOSED_ON_SPEND` | `SWEEP_WHEN_SPENDING` | No action while unspent. When spending, spend every output paying the same script in one transaction, and do not send change or new funds back to that script. |
     370 | +| `NOT_EXPOSED` | `NONE` | No action. |
     371 | +| `UNDETERMINED` | `TREAT_AS_MIGRATE` | Until the implementation can classify the output, advise as for `EXPOSED_AT_REST`. |
    


    conduition commented at 4:26 PM on November 4, 2026:

    Why not use the same action key for UNDETERMINED as with EXPOSED_AT_REST then?


    duncan0k commented at 6:03 PM on November 8, 2026:

    Two keys for one action made no sense. 7aa43f1 maps UNDETERMINED to MIGRATE and removes TREAT_AS_MIGRATE; the 0.7.0 changelog entry will record the key change.

  58. in bip-0362.md:376 in aaf470e8eb
     371 | +| `UNDETERMINED` | `TREAT_AS_MIGRATE` | Until the implementation can classify the output, advise as for `EXPOSED_AT_REST`. |
     372 | +
     373 | +The `EXPOSED_AT_REST` floor names a property, not an output type. Hash-committed outputs with no
     374 | +prior disclosure, including P2MR ([BIP 360](bip-0360.mediawiki)) once available, are not exposed at
     375 | +rest. They are `EXPOSED_ON_SPEND`, and that floor then applies. Implementations SHOULD state which
     376 | +destinations they consider available, and SHOULD NOT describe any of them as `NOT_EXPOSED`.
    


    conduition commented at 4:30 PM on November 4, 2026:

    AI text cleanup:

    Coins under the EXPOSED_AT_REST SHOULD move to NOT_EXPOSED output types if possible, or else to EXPOSED_ON_SPEND output types. Implementations SHOULD state which destinations they consider available.


    duncan0k commented at 8:51 AM on November 9, 2026:

    Your text is in b5885cd without the stray "the". It keeps the old SHOULD NOT on calling any destination NOT_EXPOSED, because no deployed type is, and adds "while no deployed type qualifies" so that the rule lapses once one does.

  59. in bip-0362.md:388 in aaf470e8eb
     383 | +
     384 | +* reused scripts whose earlier spends published their keys, and that retain a balance, move to
     385 | +  `EXPOSED_AT_REST`;
     386 | +* unrecognized output types move to `UNDETERMINED`;
     387 | +* for software that followed versions of this document before 0.5.0, P2MR outputs move from
     388 | +  `NOT_EXPOSED` to `EXPOSED_ON_SPEND`.
    


    conduition commented at 4:34 PM on November 4, 2026:

    Software that reports exposure under another taxonomy changes in three ways on adoption, all in the conservative direction

    Unclear how you can make this claim without scoping to specific examples. There are surely much more conservative classification systems out there than this: BIP362 doesn't account for off-chain/cross-chain/mempool exposure.


    duncan0k commented at 8:58 AM on November 9, 2026:

    That claim needed a taxonomy to compare against, and the text never named one, so f965286 removes it with the three cases. The section keeps the other two sentences: no consensus, policy or peer-to-peer change, and implementations SHOULD version their reports.

  60. conduition commented at 4:41 PM on November 4, 2026: contributor

    Apologies for late reply, just finally got around to a thorough review. I think this BIP is conceptually quite important, as it would establish a common metric by which to judge the success of a PQ migration efforts.

    However, i think the author could do well to review their AI-generated text more closely before submitting for public review. There were a number of false claims, leftover prompt residues, and vague/meaningless statements which needed to be cleaned up, especially in the Rationale section. Protip if using LLMs for translation: Pass the output back into your native language using Google Translate. If the result doesn't make sense to you, it probably doesn't make sense to english speakers either.

  61. duncan0k referenced this in commit 6c36e7e9d6 on Nov 5, 2026
  62. duncan0k referenced this in commit f34a4e0810 on Nov 5, 2026
  63. duncan0k commented at 7:01 AM on November 5, 2026: none

    Thanks for reading it this closely. The earlier text, the Rationale most of all, had too much LLM output that I hadn't edited properly. 0.7.0 rewrites most of the document and changes a few rules:

    • EXPOSED_AT_REST now has three explicit conditions: a key in the output, a revealed script (matched across P2SH, P2WSH and P2SH-P2WSH, and for P2MR through a revealed leaf and Merkle path), or a published key for P2PKH, P2WPKH and P2SH-P2WPKH.
    • A revealed script that needs no signature counts like any other, so other outputs committing to it are EXPOSED_AT_REST, as murch suggested.
    • Missing data gives UNDETERMINED. A positive spend count for an output's own scriptPubKey still gives EXPOSED_AT_REST, but a zero count alone is no longer enough for EXPOSED_ON_SPEND, since the key or script may have been published elsewhere; that level needs complete data and no condition holding.
    • UNDETERMINED maps to MIGRATE in Appendix A.

    The Rationale draws on your rewrites for the four levels, attacker capability and scoring, and the reference implementation and vectors match the new text. The rest is fixed as you suggested, except where I've replied in the thread. @murchandamus the rules are now MUSTs with test vectors, so Specification may fit better than Informational. I've left the type unchanged; if you'd rather see Specification, I'll change it.

  64. murchandamus commented at 7:44 PM on November 6, 2026: member

    While this update could have been more reviewable, if changes had been separated into focused commits, this update appears to have either moved or changed almost every line of this document.

    One thing that is frustrating about reviewing documents that are being authored with AI-assistance is that such authors often don’t understand or don’t care how that work-style affects reviewers. Instead of directly addressing feedback, they routinely rewrite the entire document in each iteration. This makes it infeasible to efficiently evaluate whether feedback was incorporated and forces reviewers to either perform costly three-way comparisons or to start reviewing from scratch on each iteration. Trying to discern which changes pair with what feedback is especially arduous when all of the changes are grouped in a single commit.

    It looks like Conduition spent over two hours on reviewing your document, but presumably the update and obviously the responses to the feedback appear to have been instantly generated with AI. This lack of engagement and lack of regard for reviewers makes me entirely uninterested in further review: if you don’t think it’s worth engaging personally with the feedback and at least reviewing the document yourself, it’s not clear to me why any of us should spend any time on it.

  65. duncan0k commented at 3:35 AM on November 7, 2026: none

    I'm resetting the branch to aaf470e (0.6.1). I bundled a batch of changes I'd been holding back into 0.7.0 along with the review fixes, thinking one update would be less noise than several. That made the review a pain. I'll redo the review changes one commit per comment, each diff limited to that item and linked from its thread. conduition's suggestion blocks go in as he wrote them. The other changes can wait for a separate PR once this one settles. I'll comment here once all the threads are done before asking for another look.

  66. duncan0k force-pushed on Nov 7, 2026
  67. duncan0k referenced this in commit aa07edb14c on Nov 7, 2026
  68. BIP362: say 'quantum adversary' under EXPOSED_AT_REST
    Suggested in review: https://github.com/bitcoin/bips/pull/2294#discussion_r4468874863
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    52592f46fd
  69. BIP362: fix the example type in the partial-history vector
    Suggested in review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469774838
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    5d9d83388d
  70. BIP362: say 'public key' instead of 'key material'
    'Key material' usually means secret key bytes. Every use here meant a public key.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4468893211
    e0c483d49b
  71. BIP362: derive exposure from hash matches only
    The derived condition no longer asks whether published keys are 'sufficient to spend' an
    output. It matches the hashes an output commits to against the scripts and keys that
    confirmed spends revealed. Nothing is rebuilt from keys, so a script that was never
    revealed does not match even when all of its keys are published. 'Earlier' is gone: the
    order of transactions does not matter. The unused term 'spending key set' is removed, and
    the Rationale records the spent-address-only alternative.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469020761
    44b7bdfa86
  72. BIP362: match a published key in every encoding
    A published key is matched through the six encodings of the two points with its
    x-coordinate, so a key seen uncompressed matches the P2PKH of its compressed form and an
    x-only key matches both points. P2WPKH and P2SH-P2WPKH stay in scope alongside P2PKH.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469613254
    154a922cdf
  73. BIP362: P2MR match does not depend on what the revealed leaf requires
    No execution trace is needed: a revealed leaf and Merkle path that produce the root match,
    whatever the leaf requires. BIP 360 defines no post-quantum opcode, so this cannot
    over-report today; the text says it will once a leaf can require one.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469222816
    559deabf94
  74. BIP362: a revealed script that needs no signature gives EXPOSED_AT_REST
    Such a script is anyone-can-spend once revealed, as murch noted in the thread. The
    partial-history exception for it is removed, and the depth-zero P2MR case follows the
    same rule.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469375498
    231b36d75d
  75. BIP362: P2MR is no special case under a positive spend count
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469407174
    e4c72f2805
  76. BIP362: NOT_EXPOSED excludes types that admit a path needing no signature
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469267031
    23c56f7bcb
  77. BIP362: a zero spend count does not establish EXPOSED_ON_SPEND
    Truncated history with no confirmed spend is UNDETERMINED, as the partial-history rule
    already implied. The rule is now stated once: a level other than UNDETERMINED needs its
    condition established; a positive count of confirmed spends establishes EXPOSED_AT_REST;
    EXPOSED_ON_SPEND needs the derived condition checked against every confirmed transaction,
    since the key or script may be published under another scriptPubKey. An address-indexed
    source can therefore establish EXPOSED_AT_REST but not EXPOSED_ON_SPEND. The Abstract,
    the fail-closed rule, the UNDETERMINED definition and the history vectors follow.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469696235
    ea6cb971e1
  78. BIP362: P2MR history vectors name what the spend revealed
    The level follows from the leaf and Merkle path a confirmed spend revealed, whatever the
    leaf requires and however the spend executed. A second row covers a leaf revealed by a
    P2TR spend of the same tree.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469734860
    0c2ce53f0c
  79. BIP362: split the unclear P2MR vector into one row per classified output
    Each row gives the level of the output in its first column. A published leaf key does not
    disclose the P2MR output, since spending it also needs the leaf and path; a key revealed
    in a leaf discloses the P2PKH output paying its hash.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469767929
    1b5079262e
  80. BIP362: say why mempool and stale blocks stay out of the level
    Both are listed under Out-of-Band Disclosure, where implementations may report them
    separately. The Rationale records the reason: a level built on them could not be
    reproduced later, and an implementation with less data assigns UNDETERMINED rather than
    a different definite level.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469355060
    c3e8add325
  81. BIP362: UNDETERMINED uses the MIGRATE action key
    The advice was already that of EXPOSED_AT_REST; a separate key gained nothing.
    TREAT_AS_MIGRATE is removed.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470217102
    7aa43f134a
  82. BIP362: drop P2MR from the Motivation list
    P2MR is not deployed and does not affect current estimates. The type table now says that
    its row applies where BIP 360 is active.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4468822240
    772e07d63b
  83. BIP362: unquote the aggregate-count paragraph
    It is normative text, not a quotation.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469417279
    44987e485d
  84. BIP362: say what the aggregate count establishes instead of 'floor'
    The word meant a level that retrieved transactions cannot lower. The text now says that
    directly, in the EXPOSED_AT_REST definition, the partial-history section and the
    reference implementation note.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469429125
    9d6b2083da
  85. BIP362: replace 'present' in the out-of-band section
    A level of EXPOSED_ON_SPEND or NOT_EXPOSED is not evidence that no disclosure has
    occurred, and implementations must not report it as such.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469647353
    1bc1462b94
  86. BIP362: rewrite the aggregate-count paragraph in the Rationale
    Drops 'unbounded' and 'floor', and says how the count keeps a truncated scan from
    under-reporting: a positive count establishes EXPOSED_AT_REST by itself.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470113434
    6617341c87
  87. BIP362: link the table the BIP 360 paragraph refers to
    "The table above" did not say which table. The paragraph now links to Classification by
    Output Type, which starts from the list in BIP 360.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470131026
    598c5d0186
  88. BIP362: say 'report the action key' in Appendix A
    'Expose the key' collided with the document's own use of both words. The sentence now uses
    the table's term, action key, and says that wallets give the same baseline advice.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470151892
    903614006b
  89. BIP362: rename the Appendix A column and drop 'floor'
    The column gives the minimum advice for each level and is now named for it. The sentences
    that referred to the floor now refer to the table or to the advice.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470167495
    a4dac2de8b
  90. BIP362: advise against giving out an EXPOSED_ON_SPEND address
    Outputs paid to the script after its first confirmed spend are EXPOSED_AT_REST, so a wallet
    should stop handing out the address. The row now says so before the advice for spending.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470211919
    6b4d259c80
  91. BIP362: rewrite the Rationale paragraph on the four levels
    Uses the wording suggested in review, without the clause on hash puzzle scripts: outputs
    committing to a revealed script that needs no signature are EXPOSED_AT_REST, so those
    scripts have a level. The closing sentence on UNDETERMINED is kept.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469879409
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    8ddac125c9
  92. BIP362: remove the Rationale paragraph on the name EXPOSED_ON_SPEND
    It discussed alternative names and how reviewers had read this one. Review threads are the
    place for that discussion.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469907139
    1b511061c1
  93. BIP362: rewrite the Rationale paragraph on attacker capability
    Uses the wording suggested in review, unchanged. The paragraph is now titled 'Focus on
    attacker capability' and leaves recovery protocols out of scope.
    
    Suggested in review: https://github.com/bitcoin/bips/pull/2294#discussion_r4469963053
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    6662babb6b
  94. BIP362: rewrite the Rationale paragraph on scoring
    Uses the wording suggested in review, unchanged. It drops the claims that balance and
    dormancy are not observable on-chain and that standardizing makes results comparable.
    
    Suggested in review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470073974
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    833acaf7de
  95. BIP362: rewrite the closing paragraph of Appendix A
    Uses the wording suggested in review, without its stray 'the'. It keeps the SHOULD NOT on
    describing a destination as NOT_EXPOSED, since no deployed type qualifies.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470263207
    
    Co-authored-by: conduition <130806907+conduition@users.noreply.github.com>
    b5885cd51f
  96. BIP362: shorten Backward Compatibility
    The claim that adopting software changes only in the conservative direction needed a named
    taxonomy to compare against. The claim and its three cases are removed.
    
    Review: https://github.com/bitcoin/bips/pull/2294#discussion_r4470307710
    f965286d9d
  97. BIP362: version 0.7.0
    Each comment from the review of 2026-11-04 now has its own commit. One Changelog entry
    summarizes the changes since 0.6.1.
    9a9def264c
  98. duncan0k commented at 9:08 AM on November 9, 2026: none

    Each thread from the 2026-11-04 review now has its own commit, and the reply in the thread names it. 9a9def2 sets the version to 0.7.0, replacing the version withdrawn on 2026-11-07, with one Changelog entry covering the changes since 0.6.1. The branch is 30 commits on top of 0.6.1 (aaf470e8). I'll update the reference implementation once the text settles.

  99. duncan0k requested review from conduition on Nov 18, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-23 21:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me