BSV
$53.59
Vol 31.45m
-6.15%
BTC
$96011
Vol 48249.05m
-3.04%
BCH
$438.41
Vol 226.92m
-4.89%
LTC
$102.5
Vol 602.11m
-6.11%
DOGE
$0.31
Vol 2626.63m
-5.79%
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

SK Telecom ends metaverse offering; Meta launches AI model
South Korea's SK Telecom will end its metaverse platform ifland and focus on AI instead; meanwhile, Meta released "Meta Motivo"...
December 26, 2024
Google unveils ‘Willow’; Bernstein downplays quantum threat to Bitcoin
Google claims that Willow can eliminate common errors associated with quantum computing, while Bernstein analysts noted that Willow’s 105 qubits...
December 18, 2024
Advertisement
Advertisement
Advertisement