DA Signers
The DASigners
contract is an interface through which solidity contracts can interact with 0G chain module DASigners. It is registered as a precompiled contract just like other precompiled EVM extensions.
Address
0x0000000000000000000000000000000000001000
Contract Params
Testnet:
Terminology
Signer
Signer is address with enough delegations(at least TokensPerVote
A0GI) registered in DASigners
module. Each signer should run a DA node to verify DA blob encoding and generate BLS signature for signed blob. The BLS curve used is BN254 and the public keys of signer is registered in the contract.
Please note that for accounts with delegations to more than 10 validators, only 10 of these delegations are counted and accumulated.
Epoch
The consecutive blocks in 0g chain is divided into groups of EpochBlocks
and each group is an epoch.
Quorum
In an epoch, there can be up to MaxQuorums
quorums, each quorum is a list of signer addresses with size EncodedSlices
. The i-th signer in the quorum is responsible for validating, signing and storing the i-th row of the encoded blob data assigned to this quorum.
Vote
Signers can submit their signatures on a registration message to request joining the quorums in the next epoch. At the start of each epoch, the DASigners module calculates the voting power for registered signers based on their delegated token amounts. Each delegated TokensPerVote A0GI counts as one vote, and each signer can have up to MaxVotesPerSigner votes. All votes are then randomly ordered and distributed into quorums.
Interface
Find the solidity interface in 0g-da-contract repo.
ABI
Find the ABI in 0g-chain repo.
Transactions
registerSigner
Register signer's information, including signer address, da node service socket address, signer BLS public key on G1 and G2 group, and a signature signed by the BLS private key of following message:
Keccak256(signerAddress, chainID, "0G_BN254_Pubkey_Registration")
Here chainID
is left padded to 32 bytes by zeros.
updateSocket
Update signer's socket address.
registerNextEpoch
Register to join the quorums in next epoch. The signer need to submit a signature signed by their BLS private key:
Keccak256(signerAddress, epoch, chainID)
Here chainID
is left padded to 32 bytes by zeros and epoch
is an unsigned 64 bit number in big endian format.
Queries
epochNumber
Get current epoch number.
quorumCount
Get the number of quorums of given epoch.
isSigner
Check if given address is a registered signer.
getSigner
Get the information of given signers.
getQuorum
Get the signer list of a given epoch and quorum id.
getQuorumRow
Get the signer of a specific row in a given epoch and quorum id.
registeredEpoch
Check if given address is registered to join the given epoch.
getAggPkG1
Get the aggregated G1 public key for a given signers set. The signers set is specified by the epoch, quorum id and a bitmap. The bitmap has EncodedSlices
bits and each bit denotes the row is chosen or not.
Last updated