Aptos deep dive: Move, AptosBFT, Narwhal and Block-STM parallel execution
Thread1,022 words
Giga research thread on Aptos covering the Move language, AptosBFT, Narwhal and Tusk mempool consensus, Block-STM parallel execution, security, tokenomics, governance, team and ecosystem.
Key claims
Claims 160,000 TPS and sub-1 second time to finality
Narwhal-HotStuff reaches 130k tx/s under 2s latency, Tusk 160k tx/s at about 3s
Parallelism via Block-STM overcomes sequential EVM execution
0/ being able to process 160'000 TPS & <1s TTF, @Aptos_Network might be the fastest L1 out there 🚀
born out of @Meta's #Diem project, well funded and with a fast growing ecosystem, $APT is one of the alts to watch in 2023 📈👀
ALPHA-packed GIGA research 🧵 on #Aptos (0/62) 👇
1/ contents:
🖥️ Move Language (2-5)
⚖️ Consensus: Proof of Stake (6-16)
🔀 Consensus: Narwhal and Tusk (17-25)
⛓ Parallel Execution (26-33)
🔒 Security Features (34-39)
🪙 Tokenomics (40-46)
🗳 Governance (47)
💼 Team & Funding (48-53)
🌐 Ecosystem (54-59)
🔍 Conclusion (60-62)
2/ 🖥️ Move Language
#Aptos inherits the core features of #Move, an open-source programming language developed by @Meta's Diem Association team. It's designed to create customizable transaction logic & smart contracts and is based on #Rust
3/ #Move Language boasts a high level of security & expressivity, using resources drawn from the mathematical idea of linear logic. It allows devs to avoid mistakes that could lead to exploits, while minimizing gas fees compared to other smart contract chains like #Ethereum
4/ #Move's executable format is “bytecode that is higher-level than assembly yet lower-level than a source language. The bytecode is checked on-chain for resource, type & memory safety by a bytecode verifier & then executed directly by a bytecode interpreter” (source: whitepaper)
5/ @Aptos_Network retains the core features of #Move, with special designs based on its own project characteristics. leveraging the full functionality of #MoveVM, including parallelism, massive storage in accounts & decoupled fine-grained storage
6/ ⚖️ Consensus: Proof of Stake
@Aptos_Network leverages a high-performance Byzantine fault-tolerant quorum-based dPoS consensus called AptosBFT, that separates tx dissemination from tx ordering & is powered by a network of validators which process transactions & update state
7/ in the #Aptos dPoS system, consensus voting power is proportional to the amount of tokens staked within each validator
validators that act maliciously or suffer downtime can be slashed, incentivizing token holders to stake their tokens in honest & performant validators
8/ the protocol implements rapid, stake-weight rotation to optimize validator performance and facilitate organic decentralization of the network
on-chain reputation tracking promotes performant validators and demotes non-performant ones, improving incentive structures
9/ @Aptos_Network’s consensus process and content differ from general blockchains
transaction communication & consensus phases are separate, with verifiers only needing to reach consensus on tx metadata, resulting in blocks containing only tx metadata instead of actual tx data
10/ after transaction metadata is collected and verified, a batch of transactions is created & transmitted repeatedly in the verifiers’ network
the verifier cannot tamper with the batch after distributing it and other verifiers accept & store the batch while signing the summary
11/ #AptosBFT is a leader-centric consensus mechanism and differentiates itself from other leader-based protocols with improved communication efficiency
12/ instead of sending messages to the leader and every other ‘general’, each node communicates only with the leader. The leader broadcasts the message (a suggested block) to be voted on; each node sends its vote to the leader, who collects the messages
13/ the leader needs to get what is called a Quorum Certificate (QC) of n-f votes, where n is the total number of nodes and f is the maximum number of malicious nodes the system can tolerate with that n
14/ when the QC has been reached and verifiers (validators) have signed the batch summary, the system generates a proof of availability (PoAv), guaranteeing that at least f+1 weighted honest verifiers have stored the batch of txs
15/ this means nodes proposing blocks only need to sort/pack a few batches of metadata along with PoAv to produce a block, while the approach also drastically reduces the total # of messages that go through the system, enabling high tx throughput, fast finality & minimal latency
16/ it is especially noteworthy that @Aptos_Network achieves a very fast finality, with TTF of <1 second
this is an especially important metric, as outlined in the thread by @MessariCrypto linked below
x.com/MessariCrypto/status/1631678346722529282
17/ 🔀 Consensus: Narwhal and Tusk
#Narwhal (yes like the animal) is a mempool protocol specializing in high-throughput reliable dissemination and storage of causal histories of transactions. It tolerates an asynchronous network and maintains high performance despite failures...
18/ ...and guarantees data availability to consensus
19/ #Narwhal is a mempool module based on a scaled primary-worker architecture, separating roles and requirements of the mempool across different players
⚙️ cryptographic proofs of data availability at a primary
⚙️ disk I/O and networking requirements across several worker
20/ #Narwhal is designed to scale-out using multiple workers at each validator, demonstrating no foreseeable limit to the throughput it can achieve (see tweet
21/ additionally, the Narwhal mempool uses a structured graph data structure (DAG) for traversing data. This scaled, role-based #DAG architecture offers zero-message networking overhead design on the consensus
22/ after Narwhal, the validated certificates get ordered through the consensus among the validator nodes, a process called Tusk in the #Aptos consensus engine
23/ in performance testing, Narwhal-HotStuff achieves over 130,000 tx/sec at less than 2-sec latency. Additional workers can increase throughput linearly, reaching up to 600,000 tx/sec without any increase in latency
24/ in contrast, #Tusk achieves 160,000 tx/sec with about 3 seconds of latency
25/ to avoid any confusion here, HotStuff is the BFT consensus algorithm that gave rise to #AptosBFT, which I outlined above
26/ 🔄Parallel Execution
parallel execution in @Aptos_Network disrupts the paradigm of sequential transaction processing (core EVM limitation)
it simplifies the connection of operations & dependencies of txs to execute unrelated txs simultaneously, enhancing network throughput
27/ @Aptos_Network achieves parallel execution through 3 primary methods:
✅ Simultaneous execution of transactions in different threads that do not overlap in data and accounts
28/
✅ Processing transactions in parallel, then handling potential conflicts in settlement order (delta writes)
✅ Reordering transactions across one or more blocks to optimize concurrency
29/ these methods are enabled by Block-STM, a parallel execution engine for smart contracts built around Software Transactional Memory principles that enables parallel execution in the #MoveVM
30/ while I won't explain Block-STM in detail, txs are grouped in blocks & every block execution must yield the same deterministic outcome

7 more images on X
What came next · since 14 Apr 2023
Show how the covered asset moved
This breakdown analyzes the project without making a call on the token, so price moves since publication are shown as market context.
Covered, no call
Since then
Zero has written 22 more pieces on Aptos and $APT since this one.
Daily closes in USD from DefiLlama and Yahoo Finance. Only a bullish or bearish call in a thesis or market take is tracked; explainers, lists, maps and mentions are neutral context. Not financial advice.