You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validatorsAccumulator: A Merkle tree accumulator of validator public keys and Eth1 deposit indexes. Eth1 deposit index is need to validate if the validator is already part of the beacon chain.
stateRoot: The current beacon state root against which the proof is made.
balanceSum: The sum of all active validator balances.
The workflow of the circuit is as follows:
Epoch Calculation: The currentEpoch is calculated from the provided slot. This calculation is then constrained. A Merkle proof verifies that the slot aligns with the provided stateRoot.
Index and Root Validations: The circuit checks if the currentEth1DepositIndex aligns with the stateRoot. It also validates whether the provided validatorsRoot and balancesRoot are part of the stateRoot.
Validator Verification: The circuit validates all validators within validatorsRoot. It uses the RangeCheck circuit to confirm that the currentEpoch falls between the validator's activation and exit epochs. If a validator is inactive or their Eth1 deposit index precedes the validator's Eth1 deposit index, the bitmask for that validator is set to 0. Validators whose Eth1 deposit index is larger than the current Eth1 deposit index aren't constrained to have valid Merkle proof because they aren't yet part of the tree.
Balance Index Check: The circuit checks that provided balancesProofIndexes correspond to the validatorIndex divided by 4 plus balancesProofIndexesRemainders. This is because balances are stored in a 256-bit array, with each balance occupying a separate 64 bits of the 256-bit segment.
Balance Validations: It validates that all the passed balances are valid with respect to the balancesRoot.
Validator Accumulator Validation: The circuit verifies that the hash tree root of all passed validators and their Eth1 deposit indexes matches the passed validatorAccumulator.
Balance Sum Calculation: The circuit sums all the balances according to the bitmask calculated for the validators.
Hashing and Output Generation: The public values are hashed. The circuit outputs the first 253 bits of the SHA-256 hash of the public inputs to make circuit verification more cost-effective.
The public inputs to the circuit are:
validatorsAccumulator
: A Merkle tree accumulator of validator public keys and Eth1 deposit indexes. Eth1 deposit index is need to validate if the validator is already part of the beacon chain.stateRoot
: The current beacon state root against which the proof is made.balanceSum
: The sum of all active validator balances.The workflow of the circuit is as follows:
Epoch Calculation: The
currentEpoch
is calculated from the providedslot
. This calculation is then constrained. A Merkle proof verifies that theslot
aligns with the providedstateRoot
.Index and Root Validations: The circuit checks if the
currentEth1DepositIndex
aligns with thestateRoot
. It also validates whether the providedvalidatorsRoot
andbalancesRoot
are part of thestateRoot
.Validator Verification: The circuit validates all validators within
validatorsRoot
. It uses theRangeCheck
circuit to confirm that thecurrentEpoch
falls between the validator's activation and exit epochs. If a validator is inactive or their Eth1 deposit index precedes the validator's Eth1 deposit index, the bitmask for that validator is set to 0. Validators whose Eth1 deposit index is larger than the current Eth1 deposit index aren't constrained to have valid Merkle proof because they aren't yet part of the tree.Balance Index Check: The circuit checks that provided
balancesProofIndexes
correspond to thevalidatorIndex
divided by 4 plusbalancesProofIndexesRemainders
. This is because balances are stored in a 256-bit array, with each balance occupying a separate 64 bits of the 256-bit segment.Balance Validations: It validates that all the passed balances are valid with respect to the
balancesRoot
.Validator Accumulator Validation: The circuit verifies that the hash tree root of all passed validators and their Eth1 deposit indexes matches the passed
validatorAccumulator
.Balance Sum Calculation: The circuit sums all the balances according to the bitmask calculated for the validators.
Hashing and Output Generation: The public values are hashed. The circuit outputs the first 253 bits of the SHA-256 hash of the public inputs to make circuit verification more cost-effective.
The circuit is implemented in #153
The text was updated successfully, but these errors were encountered: