#Custom Group generator points
5 messages · Page 1 of 1 (latest)
Yes thats possible, its also kinda the basis of how IPA works. But for this to work, the dlog of G and K has to be unknown
you mean in o1js @dusky star? there's Group.scale() and Group.add() for EC scalar muls and additions -- everything you need!
with ForeignCurve you can even do the same on any curve! (at significantly higher cost)
wow, indeed that is easy!
import { Field, Scalar, Group } from 'o1js';
// make k as a scalar where k=123 (example)
const k: Scalar = Scalar.fromField(new Field(123));
// make K = k*G
const K: Group = Group.generator.scale(k);
// let a=18 and b=19 (example)
const a: Scalar = Scalar.fromField(new Field(18));
const b: Scalar = Scalar.fromField(new Field(19));
// now we can prepare M=a*G+b*K where
const M: Group = Group.generator.scale(a).add(K.scale(b))
thanks guys!
@dusky star as an optimization, I recommend passing a Field into Group.scale() directly. this can use a more efficient code path than transforming the field to a scalar first and scaling with it