Aere Network public source. Everything here can be checked against the live chain (chain id 2800, https://rpc.aere.network). Scope note, stated up front rather than buried: consensus on chain 2800 is classical secp256k1 ECDSA QBFT. The post-quantum work in this repository is at the signature, precompile, account and transport layers. Nothing here makes the consensus post-quantum, and no document in it should be read as claiming so.
36 lines
1.6 KiB
Solidity
36 lines
1.6 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.23;
|
|
|
|
/// @title MockSP1VerifierAlwaysAccepts — TEST-ONLY. NEVER DEPLOY.
|
|
/// @notice Stands in for the SP1 gateway so a test can isolate a verifier
|
|
/// contract's GATE LOGIC (public-value binding, anchor bind, replay,
|
|
/// commitment re-derivation) from the Groth16 check itself.
|
|
///
|
|
/// @dev Using this is only legitimate when the real verifier's verdict on the
|
|
/// real proof has been established SEPARATELY. In the
|
|
/// AereOutboundVerifierV2 fix, that separate leg is a live `eth_call`
|
|
/// against the REAL SP1VerifierGateway 0x9ca479C8…70628 showing it accepts
|
|
/// the attack proof for the V1-design vkey. This mock then shows what the
|
|
/// V1 contract does once that check has passed. It is NOT a claim that the
|
|
/// cryptography was verified here.
|
|
///
|
|
/// The canonical SP1 `verifyProof` returns nothing and reverts on failure,
|
|
/// so "accept" is simply "do not revert". That asymmetry is exactly why the
|
|
/// constructor of the real contract rejects a code-less verifier: an EOA
|
|
/// would "accept" every proof.
|
|
contract MockSP1VerifierAlwaysAccepts {
|
|
function verifyProof(bytes32, bytes calldata, bytes calldata) external view {
|
|
// no-op: accepts everything
|
|
}
|
|
}
|
|
|
|
/// @title MockSP1VerifierAlwaysReverts — TEST-ONLY. NEVER DEPLOY.
|
|
/// @notice The opposite stand-in: models an invalid/tampered proof.
|
|
contract MockSP1VerifierAlwaysReverts {
|
|
error MockProofRejected();
|
|
|
|
function verifyProof(bytes32, bytes calldata, bytes calldata) external pure {
|
|
revert MockProofRejected();
|
|
}
|
|
}
|