Skip to content

Instantly share code, notes, and snippets.

@jcstein
Created April 13, 2023 02:25
Show Gist options
  • Save jcstein/ef624e7cf88d6d67f1da3e54b6a05ddc to your computer and use it in GitHub Desktop.
Save jcstein/ef624e7cf88d6d67f1da3e54b6a05ddc to your computer and use it in GitHub Desktop.
transaction-flow_prepared.jsonl
{"prompt": "What does a typical transaction on Celestia look like?", "completion": "A typical transaction on Celestia involves a user running a Celestia Light Node and a rollup Light Node. The user constructs a transaction (TX) on their local machine and sends it to a full node on the rollup network. The full nodes, which can be sequencers, sequence the transactions into rollup blocks. These rollup blocks have data commitments, which are Merkle trees containing the transaction data. The rollup sequencer then posts the block data into the Celestia network, and it gets included inside the Celestia block as a data blob."}
{"prompt": "What is the main purpose of the Celestia Light Node?", "completion": "The main purpose of the Celestia Light Node is to allow users to connect directly to the Celestia network and get information about the state of the network, like the latest blocks, without relying on a centralized service. This is important for trust minimization and making users first-class citizens of the network, which are core goals of Web3."}
{"prompt": "What is a Data Availability Sampling (DAS)?", "completion": "Data Availability Sampling (DAS) is a technique used by Celestia Light Nodes to ensure that the data in the network is available and retrievable. Light nodes connect to full nodes or storage nodes in the Celestia network to sample block headers and verify the availability of data blocks through Merkle proofs."}
{"prompt": "How are rollup blocks related to Celestia blocks?", "completion": "Rollup blocks are created within the rollup network and contain the transactions and their respective data commitments. These rollup blocks are then posted to the Celestia network by the rollup sequencer. The data from the rollup block gets included inside the Celestia block as a data blob. The data commitments in the rollup block, which are Merkle trees, become subtrees within the larger Merkle tree of the Celestia block."}
{"prompt": "What are the main components of a Celestia block?", "completion": "The main components of a Celestia block include the data root commitment (data root) and data blobs. The data root is a Merkle tree of all the data on the chain, with the data blobs as its leaves. Data blobs consist of various lengths and can include the data from rollup blocks, making rollup blocks part of the Celestia block's data structure."}
{"prompt": "What is the purpose of namespaces in Celestia?", "completion": "Namespaces in Celestia serve as an optimization to make it easier for people to download and locate data. Instead of having to search the entire block, users only need to search the namespace for the desired data. Namespaces can be thought of as similar to a Twitter hashtag or a channel on a walkie-talkie, allowing users to post data under a specific namespace and others to search for that data under that namespace."}
{"prompt": "What is the state commitment in a rollup?", "completion": "The state commitment in a rollup refers to a Merkle root that commits to the state of the chain. Instead of committing to the transactions that occurred, the state commitment commits to the overall state of the system, such as user balances in a financial context. In an optimistic rollup, the state commitment is used to verify the current state of the chain and ensure that all balances and other relevant information are accurate."}
{"prompt": "How do rollup full nodes retrieve rollup block headers from the Celestia chain?", "completion": "Rollup full nodes retrieve rollup block headers from the Celestia chain by querying for data under a specific namespace. Each rollup chooses a namespace, and the rollup full nodes call an API in the Celestia node called GetDataByNamespace. This allows the rollup full nodes to retrieve the header of the rollup block, which contains all the information about the rollup block except for the actual transaction data itself."}
{"prompt": "What does a rollup header consist of?", "completion": "A rollup header consists of the state commitment and data commitment."}
{"prompt": "How does a rollup full node prove Alice's balance to a light node?", "completion": "A rollup full node proves Alice's balance to a light node by using a Merkle proof, which shows a path from the root to the leaf and demonstrates that the commitment is committing to the fact that Alice's balance is a specific value."}
{"prompt": "What could a malicious rollup full node do?", "completion": "A malicious rollup full node could generate invalid rollup blocks by introducing transactions that break the rules of the rollup, such as printing more money or stealing someone's balance."}
{"prompt": "How do optimistic rollups deal with malicious transactions?", "completion": "Optimistic rollups deal with malicious transactions by using fraud proofs, which enable users to challenge invalid state transitions."}
{"prompt": "Why do ZK rollups still need data availability?", "completion": "ZK rollups need data availability because even though they use validity proofs to ensure the correctness of the state, users still need to know the actual state, their balances, and transaction details in order to use the chain and advance its state."}
{"prompt": "How do light nodes verify the data behind a rollup header?", "completion": "Light nodes verify the data behind a rollup header by first checking for assurance or guarantee that the data behind the rollup header is available. They do this by receiving a Merkle proof that the smaller tree (rollup data) is inside the bigger tree (Celestia block data). This proves to the rollup that the data is actually inside the Celestia block without needing to download all the transactions."}
{"prompt": "Do rollups have to use namespaced Merkle trees?", "completion": "Yes, rollups have to use namespaced Merkle trees in the example given. However, there are other ways to construct rollups that don't involve this method."}
{"prompt": "Why is trusting the Celestia validator set not scalable?", "completion": "Trusting the Celestia validator set is not scalable because the usual threat model for blockchains like Bitcoin and Ethereum requires that you don't need to trust the validator set for safety guarantees. Trust-minimized networks need to be decentralized, and relying on the validator set gives them the power to make invalid state transitions, change policies, or even steal funds."}
{"prompt": "How does data availability sampling work?", "completion": "Data availability sampling is a technique that allows light nodes to verify that 100% of the data in a block has been published by only downloading a small percentage of that block. Light nodes download random chunks from the block, and after downloading enough random chunks, they have a high probability guarantee that 100% of the data is available. This is achieved using a mathematical primitive called erasure coding."}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment