Aptos Core Documentation

repository·main·Indexed 27 days ago

https://github.com/aptos-labs/aptos-core

Foundational layer 1 blockchain implementation using the Move programming language. Includes documentation for the Aptos REST API, API fuzzing with RESTler, gas calibration and profiling tools, and the framework release process using the aptos-release-builder CLI.

Tokens
239.4K
Snippets
490
Records
1.5K
Agent score
92%

What's inside aptos-core

  1. Overview of Quorum Store (QS)

    main

    Quorum Store (QS) is a data dissemination layer based on Narwhal that separates transaction dissemination from consensus ordering. Instead of a single leader broadcasting transactions, every validator continuously creates batches of transactions and broadcasts them to all peers.

    When 2f+1 validators sign a batch, a Proof of Store (PoS) is formed, certifying the batch is available. The consensus leader then proposes blocks containing only batch references (PoS) rather than raw transactions, maximizing network bandwidth and reducing proposal size.

  2. Overview of AptosBFT Consensus Protocol

    main

    AptosBFT is a BFT state machine replication protocol designed for $n = 3f+1$ validators, capable of tolerating up to $f$ Byzantine faults. It operates under a partial synchrony model, providing safety at all times and liveness during periods of synchrony.

    The protocol optimizes performance through:

    • Optimistic Proposals: Leaders can propose blocks extending a parent before the parent's Quorum Certificate (QC) arrives, reducing block time to a single network hop.
    • Order Votes: A 3-hop ordering mechanism that uses order votes to achieve theoretical minimum latency for BFT ordering.
    • 2-chain Commit: A fallback mechanism where a block $B(r)$ is committed if it has a QC and its direct child $B(r+1)$ also has a QC.
  3. Overview of State Synchronization (State Sync)

    main
    State sync is a component running within each Aptos node that synchronizes the node to the latest blockchain state. It is a requirement for both validators and fullnodes to prevent them from falling behind the network. The process involves identifying and fetching new blockchain data from peers, validating that data, and persisting it to local storage.
  4. Overview of the Move Prover

    main
    The Move Prover is a tool for the formal specification and verification of Move smart contracts. It automatically proves logical properties of code, offering a user experience similar to a type checker or linter. It is designed to increase contract trustworthiness by protecting assets from bugs and adversaries, assisting with regulatory compliance, and allowing domain experts to understand contract behavior through mathematical specifications.
  5. Overview of AptosNet Protocol

    main

    AptosNet is the primary communication protocol for the Aptos ecosystem, designed to facilitate consensus, shared mempool, and state sync protocols. It maintains at-most one connection per remote peer and multiplexes application protocols over that single connection.

    Key technical characteristics:

    • Transport: TCP for reliable delivery.
    • Security: [NoiseIK] for authentication and full end-to-end encryption.
    • Discovery: Uses on-chain NetworkAddress sets for discovery, with optional seed peers in NetworkConfig as a fallback.
    • Interfaces: Provides DirectSend (fire-and-forget) and RPC (unary Remote Procedure Calls).
  6. Overview of Testsuites

    main

    The testsuite directory provides a collection of testing utilities written in Python and Rust for orchestrating and managing Aptos workloads. The suite includes:

    • Forge: A unified cluster-testing framework for orchestrating local swarm and large-scale Kubernetes-based Aptos workloads.
    • Forge Wrapper: Python utilities for scheduling and managing Forge jobs on supported Kubernetes clusters.
    • Testcases: Specific Forge test cases.
    • Verify: Python utilities for invoking replay-verify and module-verify workflows.
  7. Overview of the Move Unit Testing Framework

    main

    The Move unit testing framework consists of two primary components: a test runner and a test reporter.

    Unit tests can be executed using the stackless bytecode interpreter. When using this interpreter, the framework compares the result of the test executed with the Move VM against the result from the interpreter; if they are not equal, an error is raised.

    For detailed user-level instructions on writing and running tests, refer to the official Move unit testing documentation.

  8. Overview of cryptographic primitives in aptos-crypto

    main

    The aptos-crypto crate provides implementations for all cryptographic primitives used in Aptos, including hashing, signatures, multisignatures, aggregate signatures, and key derivation/generation.

    Key algorithms used include:

    • SHA-3: The primary hash function (based on tiny_keccak).
    • HKDF: HMAC-based Extract-and-Expand Key Derivation Function (RFC 5869) for generating keys from salt, seed, and application-info.
    • Ed25519: Signatures and (naive) multisignatures (based on ed25519-dalek) with additional security checks for malleability.
    • BLS (Boneh-Shacham-Lynn): Multisignatures and aggregate signatures using the blst crate on Barreto-Lynn-Scott BLS12-381 elliptic curves.
    • Noise Protocol Framework: Used for authenticated and encrypted communication channels between validators.
    • X25519: Key exchange used within the Noise Protocol implementation (based on x25519-dalek).