BSV
$68.95
Vol 141.87m
2.83%
BTC
$97827
Vol 52350.59m
-1.45%
BCH
$500.04
Vol 1827.35m
1.77%
LTC
$98.52
Vol 2790.8m
8.5%
DOGE
$0.42
Vol 24941.1m
5.84%
Getting your Trinity Audio player ready...

This post was first published on Medium.

Pairing-based cryptography is a variant of elliptic curve cryptography, which Bitcoin ECDSA signatures are based on. Thanks to the characteristics of pairing, new cryptographic algorithms and protocols can achieve functions or efficiency which cannot be realized otherwise, such as identity-based encryption (IBE), attribute-based encryption (ABE), authenticated key exchange (AKE), and short signatures.

<span style="font-size: 10pt;">Bilinear Pairing
Bilinear Pairing

Several applications of Pairing-based cryptography have been in practical use in many blockchains.

  1. Zcash implements a zero-knowledge proof algorithm named zk-SNARKs (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge)
  2. Ethereum supports pairing check to perform zkSNARK verification
  3. DFINITY (now called The Internet Computer) constructed a BLS signature-based scheme, shorter than ECDSA signatures.

We demonstrate pairings can be implemented directly on Bitcoin and thus enable all kinds of pairing-based cryptography applications previously thought impossible on Bitcoin.

Bilinear pairings

A pairing e is simply a function that takes two inputs¹ and returns one output as below.

Pairing

Pairing

A bilinear pairing has the following property:

: Bilinear map equations
Bilinear map equations

That is, it is linear in each of its inputs separately. It is easy to see the following holds.linear equation

Intuitively, one can swap the scalar n between its inputs and take it out as an exponent.

A Toy Example

Let us look at the following pairing function.

pairing function

It is bilinear because it satisfies the two equations above. For instance,

linear equations

Bilinear pairings on elliptic curves

In practice, the pairing above is not secure for cryptographic use. Instead, we use pairings over elliptic curves. The inputs are points on an elliptic curve and the output is a number². There are multiple ways to construct pairings over elliptic curves, such as WeilTate, and Ate pairings.

Miller’s Algorithm

Miller’s algorithm is used to efficiently compute pairings. It consists of two parts:

  1. main loop: Line 3 to 10. It is structurally akin to the double-and-add algorithm when calculating scalar point multiplication.
  2. final exponentiation at Line 11.

p, k, and r are parameters of the elliptic curve used³.

Miller’s algorithm to compute the Tate pairing e(P, Q)

Miller’s algorithm to compute the Tate pairing e(P, Q)

Implementation

We have implemented the Miller’s algorithm to compute Tate pairings below, based on our elliptic curve arithmetic library.

Implementing Tate pairing e(P, Q)

linefunc(P, Q, R) is a line function that passes through P and Q and is evaluated at R.

***

NOTES:

[1] Thus the name pairing.

[2] Strictly speaking, it is an element in a multiplicative group. Since this serves as an introduction on pairings, we choose readability over mathematical rigor throughout the article.

[3] Not all elliptic curves can be used for pairings. Only ones where pairings are efficiently computable are used in practice. They are called pairing-friendly curves, of which Barreto-Naehrig (BN) or Boneh–Lynn–Shacham (BLS) curves are notable examples.

Watch: Dr. Craig Wright’s Keynote speech: Cloud Security, Overlays & Blockchain at the BSV Global Blockchain Convention

https://www.youtube.com/watch?v=RzSCrXf1Ywc&t=30032s

Recommended for you

David Case gets technical with Bitcoin masterclass coding sessions
Whether you're a coding pro or a novice, David Case's livestream sessions on the X platform are not to be...
November 21, 2024
NY Supreme Court’s ruling saves BTC miner Greenidge from closing
However, the judge also ruled that Greenidge must reapply for the permit and that the Department of Environmental Conservation has...
November 20, 2024
Advertisement
Advertisement
Advertisement