As far as I understand secp256k1 is defined over the group p with
p = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F
I don't really understand how out of bounds values are handled in particular with homomorphism of the commitments.
Assume I commit to the value 5
which would be $G + G + G + G + G$ and then commit to the value p + 5
which would be $(p+5)G$ will those be the same commitment?
Based on this assumption I have implemented the following javascript code (using elliptic library ):
it('Test mult property of commitments', () => {
const T1 = ec.g.mul(secp256k1.p + 5n);
const T2 = ec.g.mul(Maths.mod(secp256k1.p + 5n, secp256k1.p));
const T3 = ec.g.mul(5n);
assert(T1.eq(T2));
assert(T2.eq(T3));
});
In this example, T2
and T3
are the same, but T1
is different, so it seems like my assumption is incorrect, does this mean I can commit to values greater than p?