# Can the precompiles in Byzantium for pairings be used for implementation of BLS verification?

I am looking into implementing some operations for the BLS signature scheme in Solidity, using the new precompiled contracts for pairing operations released with Byzantium.

In BLS verification, to check the validity of a signature `s` in `F_q` corresponding to public key `V` in `G_2` and message `M`:

1. Find `y` in `F_q` with `sigma = (s, y)`.
2. Compute `R <- MapToGroup(M)` in `G_1`.
3. Test if either `e(sigma, Q) = e(R, V)` or `e(sigma, Q)^-1 = e(R, V)`.

(see page 310 in the BLS paper for more details)

Supposing we have `R` and `sigma`, is step 3 possible with the precompiled contracts: addition (0x6), scalar multiplication (0x7), and pairing check (0x8)? I am not sure I can find a formulation since there is no implementation for evaluating the pairing function `e` itself.

Also, how would steps 1 and 2 be accomplished in Solidity?

Edit: asked a similar question on the crypto StackExchange

• – eth
Sep 24 '18 at 5:09