Automata Docs
  • Understanding Automata
    • What is Automata?
      • TEE Coprocessor
      • Proof of Machinehood
        • Optimistic Attestation
        • Zero Knowledge Proof
        • Modular Trust
    • Key terms
  • TEE Overview
    • TEE Prover
    • Multi-Prover AVS (EigenLayer)
      • Operator guide
        • Installation
        • Deposit strategies
        • Opt in to run AVS
        • FAQ
    • TEE Compile
      • Getting Started
      • Vendorizing
      • Attestation Report
    • TEE Builder
      • Block Builder Architecture
      • Stateless Executor
    • Verifiable Random Function
      • Why Automata VRF
      • How does Automata VRF work
      • Attestation
  • Build with PoM
    • Introduction
      • Smart contract libraries
      • Attestations on Verax
      • Frequently asked questions
    • Attestation module
      • Machine Attestation
        • Intel SGX
        • AWS Nitro Enclaves
        • Miscellaneous
      • Device Attestation
        • Yubikey
        • Andriod
        • Apple
        • Windows
        • FIDO U2F Authenticator
      • WebAuthn Attestation
        • WebAuthn Attestation Types
        • Attestation Statements & Privacy Impacts
  • Backed by PoM
    • 1RPC
    • L2Faucet
      • Frequently asked questions
  • Protocol
    • App-Specific Rollup
    • Mainnet
    • Testnet
    • Bridge
      • Bridging Native Tokens from L1 to L2
      • Bridging Native Tokens from L2 to L1
    • Explorer
    • Specification
      • Attestation
      • Attestor
      • Smart Contract
  • Research
    • Account Abstraction
    • Decentralized Randomness
    • Maximal Extractable Value
    • Reproducible Build
    • Lightpaper
Powered by GitBook
On this page
  • Overview
  • Attestation
  • SingleStepOptimisticAttestation
  • MultiStepOptimisticAttestation
  • ConsensusBasedAttestation

Was this helpful?

  1. Protocol
  2. Specification

Smart Contract

PreviousAttestorNextAccount Abstraction

Last updated 1 year ago

Was this helpful?

Overview

All Attestation contracts must inherit the Attestation base contract.

The base contract is ERC721 compliant, which defines the data structure of an Attestation report, and function methods that allow adding and revoking an Attestation.

Once an attestor has successfully submitted an Attestation report, the Attestation contract mints an ERC721 NFT to the attestor's wallet.

Automata 2.0 has currently built various attestation contracts for the various attestation types, namely:

  • SingleStepOptimisticAttestation.sol

  • MultiStepOptimisticAttestation.sol

  • ConsensusBasedAttestation.sol

Full details about the various attestation types can be found in the section.

Attestation

The Attestation contract itself is considered to be abstract, it is not intended to be deployed as an independent contract. Instead, it is served as a base contract with built-in methods and virtual methods that need to be implemented in the derived contract.

The object structures are defined here.

SingleStepOptimisticAttestation

of the SingleStepOptimisticAttestation.

If you're looking to build upon the SingleStepOptimisticAttestation, there are 3 pivotal methods awaiting your implementation:

  1. _needVerify - To decide whether the attestation should be verified instantly.

function _needVerify() internal pure returns (bool)
  1. _verify - To validate the correctness and authenticity of the submitted attestation.

function _verify(bytes calldata data) 
    internal view returns (bool verified, bytes memory dataHash)
  1. _generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.

function _generateSVG(uint256 tokenId) internal view returns (string memory)

MultiStepOptimisticAttestation

If you're looking to build upon the MultiStepOptimisticAttestation, there are 5 pivotal methods awaiting your implementation:

  1. _startChallenge - To handle the logic of starting a challenge.

function _startChallenge(bytes32 hash) internal virtual
  1. _handleEvidence - The challenger and the defender post their evidence on-chain.

function _handleEvidence(bytes32 hash, bytes memory data) internal virtual
  1. _resolveChallenge - To judge the winner of this challenge.

function _resolveChallenge(bytes32 hash) internal virtual returns (bool challengeSuccess)
  1. _cancelChallenge - To handle the logic of cancelling a challenge.

function _cancelChallenge(bytes32 hash) internal virtual
  1. _generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.

function _generateSVG(uint256 tokenId) internal view returns (string memory)

ConsensusBasedAttestation

If you're looking to build upon the ConsensusBasedAttestation, there are 3 pivotal methods awaiting your implementation:

  1. _verifyAndUpdateChallenge - To verify whether the signature is valid and from your off-chain consensus party.

function _verifyAndUpdateSignature(
        bytes32 hash, 
        bool agree, 
        bytes calldata signatures
) internal virtual returns (bool valid)
  1. _judgeAttestationStatus - To judge the attestation status according to your consensus mechanism.

function _judgeAttestataionStatus(bytes32 hash) 
    internal virtual returns (AttestationStatus status)
  1. _generateSVG - To produce a visual representation (SVG image) for the corresponding NFT.

function _generateSVG(uint256 tokenId) internal view returns (string memory)

of the MultiStepOptimisticAttestation.

of the ConsensusBasedAttestation.

Attestation
Attestation Report
Introduction
Introduction
Introduction