Try   HackMD

Batch Addition for Multi-Scalar Multiplication (MSM)

Problem

Given two sets of EC points

{Pi} and
{Qi}
,
i{1,...,n}
, calculate
{Ri=Pi+Qi}

Native Approach

If

P=(xP,yP),
Q=(xQ,yQ)
, and
R=P+Q=(xR,yR)
, an addition operation on an elliptic curve in short Weierstrass form
y2=x3+ax+b
is defined as below [1],
k={yQyPxQxPif P±Q3xP2+a2yPif P=QxR=k2xPxQyR=k(xPxR)yP

We observe that each addition requires an inversion operation that is way more expensive than muliplication and addition [2].

Therefore, we want to reduce the number of inversions needed to caculate

{Ri}.

Batch Addition

Consider n pair of points,

Pi=(xPi,yPi),Q1=(xQi,yQi),i{1,...,n} We want to calculate
Ri=Pi+Qi=(xRi,yRi)
Denote
λi=xQixPi
The product of all
λ
s left to
λi
yields
Li=j=1i1λj
Then, the product of all
λ
s right to
λi
is
Ri=j=i+1nλj
With the results above, we can calculate inversion as the following
1xQixPi=1λi=LiRiiλi

Since

iλi does not change with
i
and can be precomputed, the same inversion result can be shared across
Ri=Pi+Qi
.

Therefore, we reduced the number of inversions required to calculate

N additions from
N
to
1
.

References

[1] https://crypto.stanford.edu/~dabo/cs255/lectures/ECC.pdf [2] https://www.notion.so/Known-Optimizations-for-MSM-13042f29196544938d98e83a19934305#9d8b79321f584477ac945a738042c396 [3]https://hackmd.io/@tazAymRSQCGXTUKkbh1BAg/Sk27liTW9#Optimization-1-Batch-Affine-for-Point-Addition

tags: msm zkp public