For any curve over any field, algebraic geometers are interested in an associated group called the Picard group. It is a certain quotient of the free abelian group on points of the curve. It consists of formal sums of points on the curve modulo those formal sums that come from looking at the zeroes and poles of rational functions. It is a very important tool in the study of algebraic curves.
Why is an elliptic curve a group?
The smaller p2pkh addresses in Bitcoin are derived from a larger public key. This key is made from a scalar private key, the public key is basically an x and y coordinate on the secp256k1 elliptic curve derived from the scalar private key. If the private key is not within the curve group you cannot derive a valid x and y coordinate aka public key from it.
In the case you presented s
, the scalar shared secret, needs to be within the elliptic curve group because they are deriving a public key that someone could claim funds with from s
.
Deeper explanation: What is the math behind Bitcoin's elliptic curve?
Edit: The scalar and the curve order are integers, their elements are points.
mod n
in case the integers
happens to be greater thann
? (n
being the order of the group) – Merri Feb 07 '23 at 16:340...(2^256-N)
; the authors may have taken this from BIP32 which has a similar rule (which I'm the author of). In retrospect, this is dumb, because the number is so close to 2^256 that hitting a number in that range at all (much less resulting in an observable bias) only has a negligible probability. – Pieter Wuille Feb 07 '23 at 16:46s
to the bitlength ofn
(instead of comparing the numerical value). Do you have any comments on that?Impl 1 and, Impl 2
– Merri Feb 08 '23 at 05:13