Overview

  • Applications:
    • Replace BN254 in Zcash Sapling upgrade (subsequently replaced by Pasta curves in halo2)
    • Ethereum 2.0 by validators to verify transactions
  • BLS curve family introduced by Paulo Barreto, Ben Lynn and Michael Scott in 2002
  • pairing-friendly elliptic curve
  • proposed by Sean Bowe in 2017 with BLS12-381: New zk-SNARK Elliptic Curve Construction
  • Security: 117-120 bits

Properties

Basic Form

The curve E is: over for a 381-bit prime q

Sextic Twist

The sextic twist E2 of E is the curve over

Implementations in halo2curves, FTROU, zkcrypto

ParamterNoteshalo2curves Symbolhalo2curves ModuleSymbol (FTROU)Symbol (zkcrypto)EquationValue (dec)Value (hex)
Basic Equation (Weierstrass form)
Weierstrass: aa00x0
Weierstrass: bb40x4
Embedding Degreealso degree of field extensionk12
Parameterz-15132376222941642752-0xd201000000010000
Size of Subgroups, Order255 bits, prime, # of points in subgroup, gives the curve ~128 bit of security1rfr.rsr, Subgroup sizeq, Scalar Field (scalar.rs)524358751751261904794477405081859658376905525005276378226036586999385811845130x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001
Field Modulusnumber of bits needed to represent coordinates on the curve, 381 bit, prime, private key sizeqfq.rsqp40024095552216673934177898257359041565568828199390078853320581361240316504908378644426876291290156640378942725597870x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab
generator2(3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507, 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569)(0x17F1D3A73197D7942695638C4FA9AC0FC3688C4F9774B905A14E3A3F171BAC586C55E83FF97A1AEFFB3AF00ADB22C6BB, 0x8B3F481E3AAA0F1A09E30ED741D8AE4FCF5E095D5D00AF600DB18CB2C04B3EDD03CC744A2888AE40CAA232946C5E7E1)
generator2(3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758*u + 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160, 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582*u + 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905)(13E02B6052719F607DACD3A088274F65596BD0D09920B61AB5DA61BBDC7F5049334CF11213945D57E5AC7D055D042B7E*u + 24AA2B2F08F0A91260805272DC51051C6E47AD4FA403B02B4510B647AE3D1770BAC0326A805BBEFD48056C8C121BDB8, 606C4A02EA734CC32ACD2B02BC28B99CB3E287E85A763AF267492AB572E99AB3F370D275CEC1DA1AAA9075FF05F79BE*u + CE5D527727D6E118CC9CDC6DA2E351AADFD9BAA8CBDD3A76D429A695160D12C923AC9CC3BACA289E193548608B82801)
cofactor0x396c8c005555e1568c00aaab0000aaab
cofactor0x5d543a95414e7f1091d50792876a202cd91de4547085abaa68a205b2e5a7ddfa628f1cb4d9e82ef21537e293a6691ae1616ec6e786f0c70cf1c38e31c7238e5
generator point(0x04, 0x0a989badd40d6212b33cffc3f3763e9bc760f988c9926b26da9dd85e928483446346b8ed00e1de5d5ea93e354abe706c)
generator point([0x02, 0x00],[0x013a59858b6809fca4d9a3b6539246a70051a3c88899964a42bc9a69cf9acdd9dd387cfa9086b894185b9a46a402be73,0x02d27e0ec3356299a346a09ad7dc4ef68a483c3aed53f9139d2f929a3eecebf72082e5e58c6da24ee32e03040c406d4f])
  1. subgroup order r = 255 bits is needed to give ~128 bits of security due to of Pollard’s 𝜌 attack (the fastest known algorithm to find discrete logs on elliptic curves)
  2. The generators of and are computed by finding the lexicographically smallest valid x-coordinate, and its lexicographically smallest y-coordinate and scaling it by the cofactor such that the result is not the point at infinity

PF = Prime Field

TypeMacro / ModuleNotesPrimeStructsize() usizePF ReprPF BitsPF CapacityPF SFROBENIUS_COEFF_FQ_C1 Size
Frfield_commonr - 255 bits[u64; 4]256b = 32B[u8; 32] = 256b = 32B255b254bu32: 5
Fqfield_common_fqp - 381 bits[u64; 6]384b = 48BFqBytes = [u8; 48] = 384b = 48B381b380bu32: 1
Fq2field_common_fq{c0: Fq, c1: Fq}768b = 96BFq2Bytes = [u8; 96] = 768b = 96B381b380bu32: 0[Fq; 2] = 768b = 96B
Fq6field_common_fq{c0: Fq2, c1: Fq2, c2: Fq2}2304b = 288B[Fq2; 6] = 4608b = 576B
Fq12field_common_fq{c0: Fq6, c1: Fq6}4608b = 576B[Fq2: 12] = 9216b = 1152B
G1new_curve_impl_bls12381{x: Fq, y: Fq, z: Fq}
G2new_curve_impl_bls12381{x: Fq2, y: Fq2, z: Fq2}
G1Affinenew_curve_impl_bls12381{x: Fq, y: Fq, infinity: Choice}
G2Affinenew_curve_impl_bls12381{x: Fq2, y: Fq2, infinity: Choice}
G1Compressednew_curve_impl_bls12381[u8; Fq::size()]
G2Compressednew_curve_impl_bls12381[u8; Fq2::size()]
G2Preparedengine.rs- used for converting G2Affine in pairing(){coeffs: Vec<(Fq2, Fq2, Fq2)>, infinity: bool}
Gtengine.rsFq12

Reference