Search

Search for projects by name

ZKFair logoZKFair

Badges

About

ZKFair is a Validium based on Polygon CDK and Celestia DA.


Value secured
$8.68 M20.1%
Canonically Bridged
$6.04 M
Externally Bridged
$0.00
Natively Minted
$2.64 M

  • Tokens
  • Daily UOPS
    0.580.19%
  • 30D ops count
    1.51 M

  • Type
    Validium
  • Purpose
    Universal
  • Sequencer failureState validationData availabilityExit windowProposer failure

    Badges

    About

    ZKFair is a Validium based on Polygon CDK and Celestia DA.

    Recategorisation

    144d
    19h
    15m
    41s

    The project will be classified as "Other" due to its specific risks that set it apart from the standard classifications.

    The project will move to Others because:

    The proof system isn't fully functional

    Consequence: projects without a proper proof system fully rely on single entities to safely update the state. A malicious proposer can finalize an invalid state, which can cause loss of funds.

    There is no data availability bridge

    Consequence: projects without a data availability bridge fully rely on single entities (the sequencer) to honestly rely available data roots on Ethereum. A malicious sequencer can collude with the proposer to finalize an unavailable state, which can cause loss of funds.

    Learn more about the recategorisation here.

    Value Secured
    Canonical
    External
    Native
    Activity
    ZKFair
    Ethereum
    Milestones & Incidents

    ZKFair Mainnet is Live

    2023 Dec 20th

    ZKFair launched.

    Learn more
    Risk summary
    The forced transaction mechanism is currently disabled. The project claims to use CelestiaDA but smart contracts on L1 use DAC. Arbitrary messaging passing is removed from the bridge.
    Risk analysis
    The forced transaction mechanism is currently disabled. The project claims to use CelestiaDA but smart contracts on L1 use DAC. Arbitrary messaging passing is removed from the bridge.
    Sequencer failureState validationData availabilityExit windowProposer failure

    Sequencer failure

    No mechanism

    There is no mechanism to have transactions be included if the sequencer is down or censoring. Although the functionality exists in the code, it is currently disabled.

    State validation

    ZK proofs (SN)

    SNARKs are zero knowledge proofs that ensure state correctness, but require trusted setup.

    Data availability

    External (DAC)

    Proof construction relies fully on data that is NOT published onchain. There exists a Data Availability Committee (DAC) with a threshold of 3/5 that is tasked with protecting and supplying the data.

    Exit window

    None
    The ZkFair Owner can upgrade with no delay.

    Even though there is a 1d Timelock for upgrades, forced transactions are disabled. Even if they were to be enabled, user withdrawals can be censored up to 15d.

    Proposer failure

    Self propose

    If the Proposer fails, users can leverage the source available prover to submit proofs to the L1 bridge. There is a 5d delay for proving and a 5d delay for finalizing state proven in this way. These delays can only be lowered except during the emergency state.

    Technology

    Validity proofs ensure state correctness

    Each update to the system state must be accompanied by a ZK proof that ensures that the new state was derived by correctly applying a series of valid user transactions to the previous state. These proofs are then verified on Ethereum by a smart contract.

    1. ZKFairValidium.sol#L758 - Etherscan source code, _verifyAndRewardBatches function

    Data is not stored on chain

    The transaction data is not recorded on the Ethereum main chain.

    • Funds can be lost if the external data becomes unavailable (CRITICAL).

    1. ZKFairValidium.sol#L494 - Etherscan source code, sequencedBatches mapping
    Data availability

    Set of parties responsible for signing and attesting to the availability of data.

    Risk analysis
    Economic security
    None

    There are no onchain assets at risk of being slashed in case of a data withholding attack, and the committee members are not publicly known.

    Fraud detection
    None

    There is no fraud detection mechanism in place. A data withholding attack can only be detected by nodes downloading the full data from the DA layer.

    Committee security
    3/5

    The committee does not meet basic security standards, either due to insufficient size, lack of member diversity, or poorly defined threshold parameters. The system lacks an effective DA bridge and it is reliant on the assumption of an honest sequencer, creating significant risks to data integrity and availability.

    Upgradeability
    No delay

    There is no delay in the upgradeability of the bridge. Users have no time to exit the system before the bridge implementation update is completed.

    Relayer failure
    No mechanism

    The relayer role is permissioned, and the DA bridge does not have a Security Council or a governance mechanism to propose new relayers. In case of relayer failure, the DA bridge will halt and be unable to recover without the intervention of a centralized entity.

    Technology

    Architecture

    polygoncdk architecture Polygon CDK validiums utilize a data availability solution that relies on a Data Availability Committee (DAC) to ensure data integrity and manage off-chain transaction data. This architecture comprises the following components:

    • Operator: A trusted entity that collects transactions, computes hash values for the transaction batch, and then requests and collects signatures from Committee members.
    • Data Availability Committee (DAC): A group of nodes responsible for validating batch data against the hash values provided by the operator (sequencer), ensuring the data accurately represents the transactions.
    • PolygonCommittee Contract: Contract responsible for managing the data committee members list. Each DAC node independently validates the batch data, ensuring it matches the received hash values. Upon successful validation, DAC members store the hash values locally and generate signatures endorsing the batch’s integrity. The sequencer collects these signatures and submits the transactions batch hash together with the aggregated signature on Ethereum. The PolygonCommittee contract is used during batch sequencing to verify that the signature posted by the sequencer was signed off by the DAC members stored in the contract.

    DA Bridge Architecture

    polygoncdk bridge architecture

    The DA commitments are posted to the destination chain through the sequencer inbox, using the inbox as a DA bridge. The DA commitment consists of a data availability message provided as transaction input, made up of a byte array containing the signatures and all the addresses of the committee in ascending order. The sequencer distributes the data and collects signatures from Committee members offchain. Only the DA message is posted by the sequencer to the destination chain inbox (the DA bridge). A separate contract, the PolygonCommittee contract, is used to manage the committee members list and verify the signatures before accepting the DA commitment.

    1. Polygon CDK Validium Documentation
    Operator

    The system has a centralized sequencer

    Only a trusted sequencer is allowed to submit transaction batches. A mechanism for users to submit their own batches is currently disabled.

    • MEV can be extracted if the operator exploits their centralized position and frontruns user transactions.

    • Funds can be frozen if the sequencer refuses to include an exit transaction (CRITICAL).

    1. ZKFairValidium.sol#L61 - Etherscan source code, onlyTrustedSequencer modifier

    Users can't force any transaction

    The mechanism for allowing users to submit their own transactions is currently disabled.

    • Users can be censored if the operator refuses to include their transactions.

    1. ZKFairValidium.sol#L475 - Etherscan source code, isForceBatchAllowed modifier
    Withdrawals

    Regular exit

    The user initiates the withdrawal by submitting a regular transaction on this chain. When the block containing that transaction is proven the funds become available for withdrawal on L1. Finally the user submits an L1 transaction to claim the funds. This transaction requires a merkle proof.

    1. PolygonZkEvmBridge.sol#L311 - Etherscan source code, claimAsset function
    Permissions

    The system uses the following set of permissioned addresses:

    Sequencer 0x9eed…Db6c

    Its sole purpose and ability is to submit transaction batches. In case they are unavailable users cannot rely on the force batch mechanism because it is currently disabled.

    Proposer 0xd688…A027

    The trusted proposer (called Aggregator) provides the ZKFairValidium contract with ZK proofs of the new system state. In case they are unavailable a mechanism for users to submit proofs on their own exists, but is behind a 5d delay for proving and a 5d delay for finalizing state proven in this way. These delays can only be lowered except during the emergency state.

    ZKFairAdmin 0x0110…B725

    A Gnosis Safe with 3 / 4 threshold. Admin of the ZKFairValidium, can set core system parameters like timeouts, sequencer and aggregator as well as deactivate emergency state.

    ZKFairOwner 0x8933…3A88

    A Gnosis Safe with 3 / 4 threshold. The ZkFair Owner is a multisig that can be used to trigger the emergency state which pauses bridge functionality, restricts advancing system state and removes the upgradeability delay.

    BridgeAdminMultiSig 0xcd14…F25F

    A Gnosis Safe with 3 / 4 threshold. The Bridge Admin is a multisig that can be used to set bridge fees and an address into which fees are transferred.

    Members of the Data Availability Committee. The setup is equivalent to a 3/5 multisig.

    DAC Owner 0xa57c…0c70

    The owner of the Data Availability Committee, can update the member set at any time.

    TimelockExecutor 0x7557…C527

    Controls the upgrades to the ZKFairValidiumDAC and ZKFairValidium contracts through the Timelock.

    Smart contracts
    A diagram of the smart contract architecture
    A diagram of the smart contract architecture

    The system consists of the following smart contracts on the host chain (Ethereum):

    The main contract of the Polygon CDK Validium. It defines the rules of the system including core system parameters, permissioned actors as well as emergency procedures. The emergency state can be activated either by the ZkFair Owner, by proving a soundness error or by presenting a sequenced batch that has not been aggregated before a 7d timeout. This contract receives transaction roots, L2 state roots as well as ZK proofs. It also holds the address of ZKFairValidiumDAC.

    Can be upgraded by:

    Upgrade delay: None

    The escrow contract for user funds. It is mirrored on the L2 side and can be used to transfer ERC20 assets. To transfer funds a user initiated transaction on both sides is required. This contract can store any token.

    Can be upgraded by:

    Upgrade delay: None

    Synchronizes deposit and withdraw merkle trees across L1 and L2. The global root from this contract is injected into the L2 contract.

    Can be upgraded by:

    Upgrade delay: None

    FflonkVerifier 0x769E…F46d

    An autogenerated contract that verifies ZK proofs in the ZKFairValidium system.

    Committee attesting that data for a given dataRoot has been published. The DAC Owner can update the member set at any time.

    Can be upgraded by:

    Upgrade delay: None

    Timelock 0x5288…9c17

    Contract upgrades have to go through a 1d timelock unless the Emergency State is activated. It is controlled by the TimelockExecutor.

    Value Secured is calculated based on these smart contracts and tokens:

    The current deployment carries some associated risks:

    • Funds can be stolen if a contract receives a malicious code upgrade. There is a 1d delay on code upgrades.

    1. State injections - stateRoot and exitRoot are part of the validity proof input.