2024-06-17 09:20:11 +02:00
|
|
|
from typing import List, Tuple
|
2024-02-27 17:49:27 +01:00
|
|
|
|
|
|
|
import eth2spec.eip7594.mainnet
|
|
|
|
from py_ecc.bls.typing import G1Uncompressed, G2Uncompressed
|
2024-03-05 16:53:14 +01:00
|
|
|
|
|
|
|
from da.kzg_rs.roots import compute_roots_of_unity
|
2024-02-27 17:49:27 +01:00
|
|
|
from da.kzg_rs.trusted_setup import generate_setup
|
|
|
|
|
|
|
|
G1 = G1Uncompressed
|
|
|
|
G2 = G2Uncompressed
|
|
|
|
|
|
|
|
|
|
|
|
BYTES_PER_FIELD_ELEMENT = 32
|
2024-03-05 16:53:14 +01:00
|
|
|
BLS_MODULUS = eth2spec.eip7594.mainnet.BLS_MODULUS
|
2024-06-17 09:20:11 +02:00
|
|
|
PRIMITIVE_ROOT: int = 7
|
2024-02-27 17:49:27 +01:00
|
|
|
GLOBAL_PARAMETERS: List[G1]
|
|
|
|
GLOBAL_PARAMETERS_G2: List[G2]
|
|
|
|
# secret is fixed but this should come from a different synchronization protocol
|
2024-06-17 09:20:11 +02:00
|
|
|
GLOBAL_PARAMETERS, GLOBAL_PARAMETERS_G2 = map(list, generate_setup(4096, 8, 1987))
|
|
|
|
ROOTS_OF_UNITY: Tuple[int] = compute_roots_of_unity(
|
|
|
|
PRIMITIVE_ROOT, 4096, BLS_MODULUS
|
|
|
|
)
|