Public key recovery for EC leaves in P2MR (BIP-360)

Nice work @starius, very glad to see more eyes on this clever idea.

Once you start thinking about xpubs post-Q-day things will start getting complicated. Nothing about Boris’ idea here has changed that: The security status-quo around related keys and quantum adversaries remains just as complex as it would’ve been without recoverable EC leaves.

We’re going to have to completely rethink the concept of xpubs when it comes to hash-based signature schemes anyway, since we can’t derive secure child keys from a hash-based pubkey. I have posted about this before here and I have a rough sketch for what future xpubs may someday look like here. But maybe it’d be better to discard the idea of xpubs and just provide batches of addresses to senders instead. This would be far safer because CRQC adversaries cannot crack open an individual address unless they learn the internal EC/HB pubkeys and scripts involved. This way receivers could generate unique hash-based keys for every address, making the quantum-fallback leaf more efficient (they can use unbalanced XMSS trees).

In any case, today’s BIP32 standard should probably not be applied to EC keys in the context P2MR because of how risky/complex it is.

Technically it could be possible under the current version of BIP360 for a recoverable EC leaf to compete with taproot’s witness size using a depth-zero P2MR tree. If the P2MR root hash is just a hash of the recoverable EC pubkey, then you just need a 1-byte control block, plus the 64 byte signature as the witness. This is only a byte or two larger than P2TR’s witness in that case, but you don’t get any secondary spending paths (e.g. for a PQ leaf). Then the signature weight numbers you quoted might not match up so well.

If we banned depth-zero P2MR trees as I’ve suggested recently, this would prevent the mismatch.

Very true. We could’ve designed a version of P2TR which commits q = H(P) on-chain in the witness program, and the spender reveals either (1) a signature that allows the verifier to recover P and thus H(P), or (2) an internal key \hat P and script S s.t. P = \hat P + H(\hat P\ \|\ S) \cdot G.

Originally Boris suggested a variant of this idea as a way to hybridize Schnorr and SHRINCS:

It is a very flexible idea but you also have to be very careful about how you use it.

For example, Boris’ construction currently defines the new leaf version using just the hash of a single compressed pubkey. But if we allowed a leaf to contain multiple EC pubkeys, this would allow related-key attacks: If two related EC keys are used inside the same leaf, then the challenge hash e = H(R\ \|\ q\ \|\ \mathsf{ctrl\_block}\ \|\ m) would be the same for both keys and permit forgeries as @starius showed earlier.

There will clearly be some new security notions needed to formally prove this technique secure. Intuitively, it seems like to avoid related-key attacks we must require e to commit to a hash of the pubkey q = H(P\ \|\ ...), but also e must commit to the other commitment hash inputs (the ... part), or else the signature can be rebound to other constituent inputs of q.

1 Like