[noise] secp256k1 (was Re: Notes and thoughts from RWC2017)
laolu32 at gmail.com
Tue Jan 17 14:38:49 PST 2017
I've read bits of the archive of this mailing list, but never subscribed
until now when it was brought to to my attention that y'all were discussing
the new Noise variant we're using for Lightning. My name is Laolu Osuntokun,
I'm one of the co-authors of the Lightning Network specifications and the
lead developer for lnd.
I'm very pleased to see y'all like our specification as well as the key
rotation scheme I came up with. I'm the primary author of BOLT08, so I'll be
able to answer the discussion points that Trevor brought up further in the
> I'd suggest not adding this old curve the specification...
Our choice of secp256k1 and SHA-256 are to better align ourselves with the
existing cryptographic software implementations in the Bitcoin space. There
exist some libraries highly optimized for the choice of curve parameters
such as libsecp256k1 (which is very widely used within the ecosystem)
that we're able to take advantage of by sticking with "bitcoin crypto".
> I don't know specifics about secp256k1, but I do know that the older
> NIST-era curves sometimes to dangerous things when passed points not
> strictly on the curve.
secp256k1 has a co-factor of 1, so I believe it isn't susceptible to small
sub-group attacks. We're also protected from invalid-curve attacks since we
use point compression everywhere within the protocol.
However, there may be other analogous attacks against the curve that I'm not
> so we decided that it was up to the implementer as to what to do
> in this case -- keep processing, so that the whole noise handshake
> message would receive constant time treatment, or abort early, so as
> to not waste cycles
Implicitly, we've gone with the "abort early" route. It isn't precisely
spelled out in the Lightning specification atm, but I'll remedy that with an
amendment. My implementation (brontide) along with the other
implementations  will _reject_ a point not on the secp256k1 curve
during deserialization. As implemented now, the invalid point will
essentially be rejected by the DH functions. Therefore, the spec currently
doesn't outline the usage of null points.
> So we should consider the above spec language in light of this, and
> perhaps either:
I lean towards option B myself as it defers curve specific point
handling/rejection to the DH functions themselves, maintaining
> And also discuss whether they'd want to specify a null value for
I don't think we require the specification of a null value since we use
point-compression everywhere (thereby rejecting invalid points). However,
there may be some other benefits of doing so that I haven't thought of yet.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Noise