# MSM

Multi-scalar multiplication (MSM) refers to calculating the following summation:

$$
S = \sum\_{i=1}^{n}k\_iP\_i
$$

Or in other words, MSM calculates the **sum of&#x20;*****groups elements*** $$P$$ **multiplied by&#x20;*****scalars*** $$k$$, where $$n$$ is the **total number of&#x20;*****scalar*** $$\*$$ ***element*****&#x20;multiplications**.

In terms of elliptic curve operations, we use MSM to calculate the **sum of point-scalar multiplications**. Since **point addition operations are cheap** based on [the definition of elliptic curves](/intro/primitives/abstract-algebra/elliptic-curve.md), operation on points are best reduced to a series of additions (and/or doubles since they are also additions). The most naive reduction method for this purpose is "[Double-and-add](/intro/primitives/abstract-algebra/elliptic-curve/scalar-multiplication/double-and-add.md)," though numerous additional approaches have been discovered to further reduce the total number of addition and double operations.

#### Here is a list of current optimizations done on MSM:

1. [Pippenger's Algorithm](/intro/primitives/abstract-algebra/elliptic-curve/msm/pippengers-algorithm.md) (MSM optimization)
   1. Reduces number of additions and doubles in comparison to "[Double-and-add](/intro/primitives/abstract-algebra/elliptic-curve/scalar-multiplication/double-and-add.md)"
2. [Signed Bucket Index](/intro/primitives/abstract-algebra/elliptic-curve/msm/signed-bucket-index.md) (optimization on [Pippenger's](/intro/primitives/abstract-algebra/elliptic-curve/msm/pippengers-algorithm.md) or other naive bucket methods)
   1. Using [NAF](/intro/primitives/naf-non-adjacent-form.md), the number of required buckets per window is reduced in half
3. [Batch Inversion for Batch Additions](/intro/primitives/abstract-algebra/elliptic-curve/batch-inverse-for-batch-point-additions.md) (optimization for batch elliptic curve point additions)&#x20;
   1. When calculating batches of point additions at once, batch inversion can be utilized to reduce the number of required field inverse operations to 1.&#x20;
4. Montgomery Multiplication (optimization on field multiplications)
   1. Efficiently computes modular arithmetic using [montgomery reduction](/intro/primitives/modular-arithmetic/modular-reduction/montgomery-reduction.md)
5. [GLV Decomposition](/intro/primitives/abstract-algebra/elliptic-curve/scalar-multiplication/glv-decomposition.md) (optimization for point-scalar multiplication)
   1. GLV is often used to decompose MSM multiplications before running separate MSM's on the smaller parts. GLV generally reduces the total number of doubles operations needed; however, more significantly, if GLV is used before [Signed Bucket Indexes](/intro/primitives/abstract-algebra/elliptic-curve/msm/signed-bucket-index.md), the number of buckets required is reduced to $$\frac{1}{4}$$ of the original number.&#x20;

I also recommend reading [section 1.1](https://tches.iacr.org/plugins/generic/pdfJsViewer/pdf.js/web/viewer.html?file=https%3A%2F%2Ftches.iacr.org%2Findex.php%2FTCHES%2Farticle%2Fdownload%2F10287%2F9736%2F9159#subsection.1.1) of the paper [Speeding Up Multi-Scalar Multiplication over Fixed Points Towards Efficient zkSNARKs](https://tches.iacr.org/index.php/TCHES/article/view/10287/9736). This section provides a very solid overview on lines of research for MSM optimization as of 2023.

> Written by [Ashley Jeong](mailto:undefined) of Fractalyze


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fractalyze.gitbook.io/intro/primitives/abstract-algebra/elliptic-curve/msm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
