You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/understanding-elliptic-curves-pairings-bls-signatures.md
+46-13
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,9 @@ Now that we have our group members, we need an operation to combine them. Ellipt
74
74
75
75
Recall that the equation for an elliptic curve is a cubic curve (polynomial order 3), so a line (order 1) will intersect it at $3 \times 1 = 3$ points.[^columbia-ums] We use this fact to define the addition of two points along the curve.
76
76
77
-
Let the two points we wish to add be $\mathcal{P}$ and $\mathcal{Q}$. We draw a line from $\mathcal{P}$ to $\mathcal{Q}$, and $\mathcal{R}$ is the third point that the line intersects. We set up the equation $\mathcal{P} + \mathcal{Q} + \mathcal{R} = \mathcal{O}$, where $\mathcal{O}$ is the point at infinity (and also happens to be the additive identity ≠ the origin). Solving for $\mathcal{P} + \mathcal{Q}$ gives us $\mathcal{P} + \mathcal{Q} = -\mathcal{R}$. "Negating" a point on the curve means flipping it across the x-axis. ([Here is an illustration](https://www.researchgate.net/figure/The-group-law-for-an-elliptic-curve-P-Q-R-The-points-P-and-Q-sum-to-the-point-R_fig1_23552588) of what this operation looks like in the affine plane.)
77
+
Let the two points we wish to add be $\mathcal{P}$ and $\mathcal{Q}$. We draw a line from $\mathcal{P}$ to $\mathcal{Q}$, and $\mathcal{R}$ is the third point that the line intersects. We set up the equation $\mathcal{P} + \mathcal{Q} + \mathcal{R} = \mathcal{O}$, where $\mathcal{O}$ is the point at infinity (and also happens to be the additive identity ≠ the origin). Solving for $\mathcal{P} + \mathcal{Q}$ gives us $\mathcal{P} + \mathcal{Q} = -\mathcal{R}$. "Negating" a point on the curve means flipping it across the x-axis.[^negation-illustration]
78
+
79
+
[^negation-illustration]: [Here is an illustration](https://www.researchgate.net/figure/The-group-law-for-an-elliptic-curve-P-Q-R-The-points-P-and-Q-sum-to-the-point-R_fig1_23552588) of what this operation looks like in the affine plane.
78
80
79
81
[^columbia-ums]: Block, Adam. "Introduction to Elliptic Curves." Columbia Undergraduate Math Society, 2017. <https://www.math.columbia.edu/~ums/pdf/UMS%20Talk%203.pdf>.
80
82
@@ -86,27 +88,42 @@ When repeatedly _adding_ an elliptic curve point to itself, there is a problem a
86
88
87
89
## Pairings are bilinear maps
88
90
89
-
A bilinear map is a function $e: \mathbf{G}_1 \times \mathbf{G}_2 \rightarrow \mathbf{G}_T$[^typenot]with the following properties:
91
+
A bilinear map is a function $e: \mathbf{G}_1 \times \mathbf{G}_2 \rightarrow \mathbf{G}_T$[^typenot]that satisfies the following constraints:
90
92
91
93
[^typenot]: This notation indicates the type of the function. In this case, it means: the function $e$ takes two arguments, the first an element from group $\mathbf{G}_1$, and the second an element from group $\mathbf{G}_2$, and returns an element from group $\mathbf{G}_T$.
92
94
95
+
$$
96
+
\begin{align*}
97
+
X, X^\prime &\in \mathbf{G}_1 \\\\
98
+
Y, Y^\prime &\in \mathbf{G}_2 \\\\
99
+
a &\in \mathbb{Z}
100
+
\end{align*}
101
+
$$
102
+
[^howtoread-vars]
103
+
104
+
[^howtoread-vars]: This means: "The variables $X$ and $X^\prime$ are elements of group $\mathbf{G}_1$. The variables $Y$ and $Y^\prime$ are elements of group $\mathbf{G}_2$. The variable $a$ is any integer, including zero and negatives."
[^notation]: Note that [some sources](https://ocw.mit.edu/courses/res-18-011-algebra-i-student-notes-fall-2021/mit18_701f21_lect24.pdf) may use a different set of operations: $+$ instead of $\times$, and $\times$ instead of $ \char`\^ $. This is merely a difference in notation. I have opted to use the notation that seems to be most common in existing practical cryptography materials pertaining to ECC pairings.
117
+
118
+
[^degenerate]: Line (5) is a "non-degeneracy" requirement. Without it, $e(x,y) = 1$ would be a valid pairing. Since it's a useless one, we exclude it and others like it.
102
119
103
-
[^notation]: Note that [some sources](https://ocw.mit.edu/courses/res-18-011-algebra-i-student-notes-fall-2021/mit18_701f21_lect24.pdf) may use a different set of operations: $+$ instead of $\times$, and $\times$ instead of $ \\^{\text{ }}$. This is merely a difference in notation. I have opted to use the notation that seems to be most common in existing practical cryptography materials pertaining to ECC pairings.
120
+
Lines (3) and (4) are the most interesting for our purposes.[^derivable] Simply put, **we are allowed to freely swap scalar factors between the two parameters of $e$**.
104
121
105
-
As it turns out, lines (3) and (4) can be derived from lines (1) and (2), but it is helpful to state them outright. For our purposes, $\mathbf{G}_1 = \mathbf{G}_2$, so we'll just call the input group $\mathbf{G}$.
122
+
[^derivable]: As it turns out, lines (3) and (4) can be derived from lines (1) and (2), but it is helpful to state them outright.
106
123
107
124
One common example of a simple bilinear map on the integers is the function $e(x,y)=2^{xy}$.
108
125
109
-
An elliptic curve pairing is a bilinear map where $\mathbf{G}$ is an elliptic curve.[^pairing-def] Two such pairings are the Weil pairing and the Tate pairing.[^specific-pairings]
126
+
For the remainder of this post, $\mathbf{G}_1 = \mathbf{G}_2$, so we'll just call the input group $\mathbf{G}$. An elliptic curve pairing is a bilinear map where $\mathbf{G}$ is an elliptic curve.[^pairing-def] Two such pairings are the Weil pairing and the Tate pairing.[^specific-pairings]
110
127
111
128
[^pairing-def]: This statement is more of an introduction of terminology than a definition. It is _far_ from complete or rigorous.
112
129
@@ -118,25 +135,35 @@ The BLS signature scheme uses elliptic curve pairings[^bls-weil] to describe a s
118
135
119
136
[^bls-weil]: The BLS paper uses the Weil pairing.
120
137
138
+
A signature scheme is a means of proving that an actor is the originator (or creator, generator, approver, etc.) of a message. This involves the actor using a secret value (a "private key" or "secret key") to generate a "signature" to distribute with the message. The actor also distributes a "public key" (or "verification key") which others can use to verify that the signature was generated using the private key, which implies that the signature could only have been generated by the actor.
139
+
121
140
### Setup
122
141
142
+
Usually predetermined as part of the protocol design.
143
+
123
144
1. Choose elliptic curve $\mathbf{E}$ with generator $g$.
124
145
2. Choose pairing function $e: \mathbf{E} \times \mathbf{E} \rightarrow \mathbf{G}_T$.
125
146
126
147
### Key generation
127
148
149
+
Performed once by the actor who plans to generate signatures.
150
+
128
151
1. Choose a private key, scalar $\alpha$.
129
152
2. Calculate and distribute public key $p = \alpha g$.
130
153
131
154
### Signing
132
155
156
+
Performed every time the actor signs a message.
157
+
133
158
1. Choose message $m \in \mathbf{E}$.[^hashing]
134
159
2. Calculate and distribute signature $\sigma = \alpha m$.
135
160
136
161
[^hashing]: If your message is not already a point on the curve (it probably isn't) then you can use a hash function to convert it.
137
162
138
163
### Verification
139
164
165
+
Performed by anyone wishing to verify the signature for a message.
166
+
140
167
1. Check whether $e(p, m) = e(g, \sigma)$:
141
168
142
169
$$
@@ -173,7 +200,13 @@ Threshold signatures (distribute $n$ keyshares, any $t < n$ of them can generate
- [What Are Elliptic Curve Pairings? (Zellic)](https://www.zellic.io/blog/what-are-elliptic-curve-pairings/) ([archive.org](https://web.archive.org/web/20240207013708/https://www.zellic.io/blog/what-are-elliptic-curve-pairings/))
205
+
206
+
### Books
207
+
208
+
- [Pairings for beginners (Craig Costello)](https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf) ([archive.org](https://web.archive.org/web/20240119065123/https://static1.squarespace.com/static/5fdbb09f31d71c1227082339/t/5ff394720493bd28278889c6/1609798774687/PairingsForBeginners.pdf))[^thanks-porter]
209
+
210
+
[^thanks-porter]: Thanks to [Porter Adams](https://www.linkedin.com/feed/update/urn:li:activity:7171725082224963584?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A7171725082224963584%2C7171754572875517952%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287171754572875517952%2Curn%3Ali%3Aactivity%3A7171725082224963584%29) for this suggestion!
0 commit comments