Repository navigation
Conversation
| Particularly, it solves the Computational Diffie-Hellman (CDH) problem, so the protocols that use Elliptic Curve Diffie-Hellman (ECDH) key agreement are vulnerable. | ||
| The retroactive CRQC attacks typically affect the privacy of users in such protocols. | ||
| This document specifies '''HKE''', a hybrid key encapsulation built on top of the QSF framework from [https://eprint.iacr.org/2024/039 X-Wing] that derives a 32-byte secret <code>K</code> from two parts: an ECDH on <code>secp256k1</code> and a post-quantum key-encapsulation mechanism [https://csrc.nist.gov/pubs/fips/203/final <code>ML-KEM-768</code>], combined so that <code>K</code> remains pseudorandom even if either component is compromised. | ||
| Compared to <code>ML-KEM-768</code> deployment in isolation, HKE provides a classic ECDH fallback if some advances in lattice-based cryptography become available. |
There was a problem hiding this comment.
there is already a similar sentence, so just removed
|
|
||
| <code>KeyGen</code> draws <code>msk</code> uniformly at random to keep the description self-contained. | ||
| In practice, wallets derive <code>msk</code> deterministically under the key derivation rules of the application, so that a wallet restored from its backup recomputes <code>msk</code> and recovers its outputs. | ||
| This document does not fix that derivation: any derivation is acceptable if <code>msk</code> is indistinguishable from a uniformly random 32-byte string to anyone who does not hold the wallet's secret, and the [[#security|Security]] argument is then unchanged. |
There was a problem hiding this comment.
I think the requirements for msk derivation should be slightly different.
We need to protect msk from an adversary who can calculate discrete logs of every known (published) secp256k1 pubkey.
Because if msk derived from the key whose pubkey has ever appeared somewhere public (legacy CT address for the same script, or a non-hardened xpub path, etc) -- CRQC recovers msk and all derivatives.
My proposal is to change it to something like: "derive msk only via hash, HMAC, or hardened derivation from secrets whose public keys are never published, under its own domain separation, ..."
There was a problem hiding this comment.
refactored that, gave a good and a bad example of msk derivation
| ===KEM interface=== | ||
|
|
||
| For the <code>ML-KEM-768</code> parameter set of [https://csrc.nist.gov/pubs/fips/203/final FIPS 203], the KEM interface is as follows: | ||
|
|
There was a problem hiding this comment.
I propose to give a definition for all parameters, it would be clearer for the reader, and some of them do not match with ones from the standard (like K_q is K from FIPS)
| The vendored copy of secp256k1lab keeps its own MIT License. | ||
|
|
||
| ===Motivation=== | ||
|
|
…n the ROM Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RuvTE3pn1NGH8WzhwUfMkC
| # '''The strong Diffie–Hellman problem on <code>secp256k1</code> is hard.''' This protects <code>K</code> against classical adversaries if <code>ML-KEM-768</code> is broken: computing <code>K_c</code> requires <code>e*B</code> from <code>B</code> and <code>E</code>, and, as in X-Wing, the proof answers decapsulation queries with a strong Diffie–Hellman oracle. | ||
|
|
||
| HKE additionally hashes <code>c</code> and <code>ek</code>, which X-Wing omits. | ||
| Because <code>c</code> is hashed, condition 1 needs only that <code>ML-KEM-768</code> is IND-CCA secure; X-Wing omits <code>c</code> and therefore relies on further properties of <code>ML-KEM-768</code>. |
There was a problem hiding this comment.
I'm being told that this isn't quite right. condition 1 needs only ML-KEM IND-CCA whether or not c is hashed (X-Wing's Theorem 2 proves this for a combiner without c). What hashing c buys is condition 2: if ML-KEM is broken and c is omitted, an attacker who finds c' != c* with the same K_q can query Decaps(E*, c') and get the challenge key, which is why X-Wing's classical proof (Theorem 1) needs ML-KEM to be ciphertext collision resistant.
| Replacing <code>ECDH(e, B)</code> with HKE and using its shared secret <code>K</code> as the range-proof seed requires the recipient's address to carry the ML-KEM encapsulation key <code>ek</code> alongside <code>B</code>, and each confidential output to carry the ciphertext <code>c</code> alongside <code>E</code>. | ||
| The range-proof code is unchanged, since it takes a 32-byte seed either way. | ||
|
|
||
| ===BIP47 reusable payment codes=== |
There was a problem hiding this comment.
It seems like the new payment-code version only protects the notification. Per-payment addresses would still come from ECDH between the payment codes' points, which are meant to be public.
There was a problem hiding this comment.
yeah, the previous description of a new payment-code version was too vague; fixed that a bit
|
|
||
| ==Description== | ||
|
|
||
| ''HKE'' proposed in this ELIP is a slightly modified instantiation of '''QSF''' (''Quantum Superiority Fighter'') — the generic hybrid-KEM combiner framework the [https://eprint.iacr.org/2024/039 X-Wing paper] specifies. |
There was a problem hiding this comment.
Is QSF really the closest cousin to this ELIP? Because it hashes c and ek, it may be more closely related to the generic combiner of Giacon–Heuer–Poettering (PKC 2018). This is specified in a CFRG draft as "UG": https://datatracker.ietf.org/doc/draft-irtf-cfrg-hybrid-kems/. Either way, I think we should cite (or even increase compatibility with) the CFRG draft because it validates our approach. Similar to NIST SP 800-227, "Recommendations for Key-Encapsulation Mechanisms", which recommends the combiner shape.
There was a problem hiding this comment.
Agree, it's better move to a GHP instantiation. For the moment this was written I was unaware of UG framework so this draft was heavily inspired by X-Wing design, but adding missing terms to the transcript was merely an intuitive decision rather then the deliberate framework choice. I think we should aslo reorder the arguments order in the combiner to match the UG interface, it's not the big deal though (have to adjust the test vectors).
|
Thank you @juja256 - let's assign ELIP number 222 |
[https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hybrid-kems-12] instad of X-Wing’s QSF; - elaborate on BIP47 application a bit - adjust the test vectors - assign the ELIP number 222
- removed label - reworked description - expand rationale with combiner choice and other details - other minor refinements
This ELIP specifies a new cryptographic primitive, Hybrid Key Encapsulation (HKE), for
secp256k1. Built on the UG combiner of Hybrid PQ/T Key Encapsulation Mechanisms, it augments Elliptic Curve Diffie-Hellman (ECDH) key exchange onsecp256k1with the post-quantum key encapsulation mechanismML-KEM-768from FIPS203. HKE aims to protect the confidentiality of protocols that rely on ECDH onsecp256k1(e.g. Confidential Assets, BIP47 reusable payment codes and NIP-44 Nostr encrypted messages) against attackers with a cryptographically relevant quantum computer (CRQC).