Irys 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 4쪽 중 2쪽

tability for miners such that they can be punished for malicious behavior ● Must reliably sample all data stored once per day A hybrid consensus enables us to adopt PoW economics with security mechanisms like slashing to provide maximally reliable onchain data with performant execution. 5.1 Consensus algorithm Irys uses a process known as efficient sampling, where the chain guarantees every partition is sampled entirely once per day. 13 Figure 11: Efficient Recall Range Sampling The algorithm can be summarized as so: 1. There is a VDF running “ticks” every 1 second, generating a seed 2. For every partition a miner stores, use the seed in a deterministic random function to generate the start position of a range 3. Read 200MiB worth of chunks (800) 4. For each chunk, calculate a solution a. Convert into a number 5. If the solution is greater than the current network difficulty, then publish the block. If it’s below the difficulty then go back to step 1 14 The idea here being that miners are continuously sampling data to participate in consensus creating a strong guarantee around data being sampled. If miners lose data then they can be challenged and ultimately slashed if proven malicious. 5.2 VDF to synchronize read speed One key requirement for Irys was to force people to use HDDs, or in other words, don’t allow people to outcompete by using SSDs. A VDF is used to achieve this by only allowing 200MB to be read every second per partition a miner stores, essentially limiting the read speed of each partition at 200MB (approximately the max read speed of an HDD). Figure 12: Read Speed per Partition If the difficulty is greater than the network difficulty and the miner has sufficient stake, the block is accepted. 6 Data transaction lifecycle Each data transaction specifies a ledger the data should be stored in, and each ledger represents a duration the data should be stored for; for example, a transaction could represent “I want to store this 1 GB of data in ledger 0, which stores data for 2 weeks”. Once a user has posted a transaction and all ingress proofs have been verified, the data is XOR’d into a partition where it can be used in consensus proofs. The only special case is when the transaction specifies the permanent ledger. In this case, the transaction enters the submit ledger and then migrates to the permanent ledger once 10 miners have proved they’re storing the data. 6.1 Ingress proofs An ingress proof is a Merkle root that can only be generated by accessing the chunks of a transaction's data. Ingress proofs are used to prove a miner has some data. This is a required step before miners can store data, providing evidence that they store a unique replica of the data. The data chunks are hashed together with the miner's address to create a proof unique to that mining address. This process makes the proofs easy to generate and validate by someone with the data. To prevent false claims, these proofs must also be signed by the miner's private key. Without this signature, 15 any miner with access to the data could generate proofs for another mining address, falsely claiming that they had downloaded the data. Figure 13: Ingress Proofs Identify recently added transactions in the submit ledger that are waiting to be promoted to the publish ledger. Obtain the data associated with these transactions, either directly from a user or through gossip with other miners. Once all the data chunks are collected, create an ingress proof as follows: 1. Split the data into chunks and hash each chunk together with the miner's address. (note: chunk 5 is split into 5a and 5b to build a more balanced Merkle tree.) 2. Continue hashing these hashes to build the branches of a Merkle tree. 3. Compute the root hash of the Merkle tree. 4. Sign the root hash with the private key associated with the mining address used in step 1. 7 IrysVM and programmable data Irys introduces IrysVM, an EVM++ implementation, which adds new opcodes. The main upgrade made is to enable programmable data: the use of stored data within smart contracts. Essentially this means you could store 1EB of data and use portions of the data within a secure environment. To fully implement programmable data, we must integrate the feature across multiple layers in the tech stack. Starting with transactions that allow the caller to specify the range of chunks they wish to access with their PD SmartContract call. Next, gossip the transaction and request the range of chunks to verify their availability. Finally, include the transaction in a block and execute the state transition. 16 Figure 14: Execution of State Transaction 7.1 Posting Transactions To post a PD transaction the transaction must specify the range of chunks it wishes to have available during the SmartContract invocation. To maintain compatibility with EVM toolchains this is done by including the range of chunks to reference as elements using EIP-2930 access lists, where the address is the address of the PD precompile, and the data is one or more range specifications. 7.2 Range Specification Chunk range specification follows a simple format. partition_index : The partition index in the publish ledger of the partition containing the first chunk. offset : The chunk offset in the partition to begin reading chunks chunk_count : The number of sequential chunks to read after offset partition_index : 26 bytes - 0 to a lot offset : 4 bytes - 0 to ~80,000 (num chunks in a partition) chunk_count : 2 bytes - 0 to 65,535 (PD is constrained to about 7,000 chunks per block, so this is safe by an order of magnitude) Total Binary Bytes to represent a range : 26+4+2= 32 bytes Constraining the range to 32 bytes makes it easily storable in the EVM smart contract state. 17 Note : Ranges are always 32 bytes, and the values are unpacked by slicing the bytes at the correct offsets for each value. 7.3 Irys Client SDK The default way of referencing data on Irys is by using the transaction ID, putting the burden on the developer to locate the partition and chunk offset of the data they are interested in for PD is high friction and requires a lot of knowledge of the internal data model of the chain. To simplify the process of posting PD transactions, the client SDK implements some utility methods to abstract away the complexity of specifying chunk ranges. The implementation of this function is provided by the gateway the client is using. 1. It looks up the bundle_txid if the txid is actually a DataItem ID 2. It verifies the txid is in the Publish Ledger 3. It looks up the chunk_offset in the Publish Ledger 4. It looks up the partition_index in the Publish ledger. 5. It uses 3 & 4 to compute the partition_offset. 6. It uses the Publish Ledger txid to look up the size of the transaction data. 7. It computes the number of chunks required to read the transaction. 8. It builds a Range Specification and returns it to the caller. 7.4 Estimating Transaction Price The price of PD is determined by the same transaction simulation that estimates gas prices for posting transactions to the EVM. Because the chunk range is included in the call data of the transaction, when the simulation is run the simulation mechanism includes the pricing for the number of chunks needed to be retrieved along with the computational budget of the transaction. In order to properly determine the cost of Programmable Data in Irys, key parameters that impact network performance must be defined: Propagation Delay (D) : The maximum time allowed for data to travel across the network. Choosing an upper bound allows us to extrapolate blocktimes and probability of forks in the network. 18 Minimum Connection Speed : With a propagation delay established, we can identify a minimum connection speed to describe the expected data throughput of the network. Peer Connections in a Gossip Network : Each peer connects to a limited number of other peers (e.g. 20). The number of these connections allows us to maximize utilization of an individual peer's network connection while minimizing the number of “hops” between any two peers on the network. 7.4.1 Gossip Networks Calculating how long it takes to propagate data across the network requires some understanding of the underlying gossip protocol. Gossip protocols exist because they scale better and have higher throughput than connecting every peer with every other peer. In a network of 1000 peers, each peer maintains 999 connections, consuming memory and CPU. When a peer produces a block, it sends a copy to each peer. With a 1 Gbps connection (125 MBps) and a 500 KB block, the peer can broadcast to 250 peers/second. It would take 4 seconds to reach all peers, fully using the connection. In the same 1000-peer network, each peer connects to only 20 "closest" peers based on ping time. A block is broadcast to 20 peers, who then forward it to their 20 closest peers. With a 1 Gbps connection, broadcasting to 20 peers happens in a small fraction of a second. The block reaches the entire network in a few hops, modeled by: log number_of_peer_connections (total_network_peers) log 20 (1,000) = 2.31hops log 20 (10,000) = 3.07hops As blocks are broadcasted across peers in a few hops, the propagation delay D directly impacts the time to reach consensus, making it a critical factor for ensuring timely block propagation. 7.4.2 Propagation Delay Propagation Delay (D) is the time for data to travel between peers in the Irys network. In a gossip network, data moves through multiple hops. Assuming an average link speed of 60ms per hop, data can reach 10,000 peers in three hops, giving a D of about 180ms. Forks may occur when a new block is produced during another's propagation. To maintain a 1% fork chance with a D of 180ms, block times should be around 18 seconds. For the testnet, Irys will implement 30-second blocks to keep the fork chance at 1% with a D of 300ms. 19 Network consensus requires at least 51% of nodes to confirm a block within the Propagation Delay, allowing for a minority of nodes with slower links. Figure 15: Propagation Delay This is important because network propagation delay directly impacts core performance and security parameters. Shorter propagation reduces the likelihood of forks by minimizing the window for simultaneous block production, ensuring a single canonical chain forms more reliably. It also defines the lower bound for block time; faster propagation allows shorter intervals between blocks, improving responsiveness and transaction throughput. Additionally, understanding and optimizing propagation delay determines the network’s scalability limits, dictating how many nodes can participate in consensus while maintaining efficient data flow and synchronized state across the system. 7.4.3 Modeling Programmable Data On a 1Gbps connection, a peer can transfer 500 data chunks (256KB) per second, fully utilizing the connection. Since the protocol handles other tasks like chunk ingress and block gossip, we'll assume 50% of bandwidth is available for Programmable Data chunk propagation. To determine the cost of transferred Programmable Data, consider the following: Network Capacity: ● Assumed connection: 1Gbps ● Maximum transfer rate: 500 chunks (256KB each) per second ● Available bandwidth for Programmable Data: 50% ● Effective transfer rate: 250 chunks per second Block Capacity: ● Block time: 30 seconds ● Maximum chunks per block: 7,500 (250 chunks/second * 30 seconds) Cost Analysis: 20 ● Based on 10Gbps connection at $300/month (retail pricing) ● Transfer cost: $0.10 per 1000MB ● Cost per block (7,500 chunks = 1,875MB): $0.20 ● Cost per chunk: $0.00002667 (negligible for individual pricing) 7.4.4 Pricing Programmable Data Beyond raw bandwidth, unpacking and deserializing data chunks for use within IrysVM introduces computational overhead that must be priced to prevent spam. To account for this, Irys implements a minimum base_fee for Programmable Data transactions. During testnet, the base_fee for 1 MB of Programmable Data is set at $0.01, which also serves as the network-wide minimum cost for such transactions. To balance throughput and demand, Irys employs a dynamic congestion pricing model where the base_fee adjusts by ±12.5% per block, similar to Ethereum’s gas_fee mechanism. If more than 50% of the 7,500 available Programmable Data chunks in a block are used, the base_fee increases linearly up to +12.5%. Conversely, if a block contains no Programmable Data chunks, the base_fee decreases by as much as −12.5%. While there is no upper limit on fee growth during congestion, the system enforces a hard floor of $0.01 to maintain network integrity. When the base_fee is rising but Programmable Data demand still exceeds available capacity, users can attach priority fees (additional payments above the base rate) to incentivize miners or validators to include their transactions in the next block. This ensures market-driven inclusion for high-value or time-sensitive workloads while preserving predictable baseline costs for general use. All base_fees from Programmable Data transactions are deposited directly into the network treasury, effectively removing them from circulation and creating deflationary pressure on the native $IRYS token. In contrast, priority fees—the portion users pay above the base and compute fees—are awarded to the block producer. This dual incentive model aligns miner profitability with network efficiency, while progressively strengthening token value through protocol-level burns and treasury accumulation. 7.5 Gossip & Mempool An important constraint on PD transactions is the maximum capacity for propagating PD chunks between a majority of nodes on the network between blocks. 21 7.6 Transmission When a node receives a PD transaction, it broadcasts it to its peers, indicating whether it has the chunks. Receiving peers may request the chunks in their response. The broadcasting node tracks which peers need the chunks and sends them after receiving them. Receiving peers also broadcast the PD transaction, marking peers that have already received it and noting which peers have the chunks. When a peer receives the chunks, it sends them to peers lacking them. If a peer hasn't received the chunks after some time, it may retrieve them from assigned storage partitions by inspecting the ledger, locating partition owners, and requesting the chunks from a randomly chosen partition. 7.7 Validation Transaction validation follows the same static validation as other transactions. Chunk validation is a little more complicated. PD Transaction chunks can be retrieved in a number of ways. 1. The node has the cached unpacked chunks locally. 2. The node has the packed chunks in a partition they mine. 3. The node receives unpacked chunks from a peer. 4. A node requests packed/unpacked chunks from a peer. Cached Unpacked Chunks : In this case, the node has already validated the chunks with their Merkle roots and can be confident the data in them is correct and ready to be exposed to the VM for PD execution. Local Packed Chunks : The node happens to mine the partition that contains the PD chunks requested by the transaction, but they are packed. The Node: 1. Creates the entropy for the chunk range 2. Unpacks the chunks using the computed entropy 3. Builds a merkle-root out of the unpacked chunks 4. Looks up the transaction that posted the chunks from its block index 5. Compares the computed merkle-root with the one in the transaction. 6. If valid, the node posts the unpacked chunks to any peers marked as not having them. 22 Receives Unpacked Chunks : In this case the node is being sent unpacked chunks by one of their peers. While they do not have to unpack the chunks they do need to verify the chunks contain the correct data or risk proposing an invalid block. The Node: Follow steps 4-6 from the Local Packed Chunks path. Requests Chunks : As a failsafe, if the node is not receiving any of the chunks within time D, where D is the propagation delay of the network (Assume D = 200ms for testnet). The Node: 1. Looks up the partitions responsible for storing the chunks. 2. Picks a partition at random to request the chunks. a. If the partition provides packed chunks, unpack them. 3. Follow steps 4-6 from the Local Packed Chunks path. 7.8 Block Production After a mining node receives a PD transaction and its chunks and validates them, it can include the transaction in a block. To minimize the chance of producing a block with a PD transaction that the majority haven’t received the chunks for, the miner may wait for the propagation delay D before including it. This allows most of the network to retrieve the chunks and validate the PD transaction when it's included in a block. 7.9 Smart Contract Execution Executing a PD smart contract interaction requires further exploration. There are a few possible approaches, but they will require exploration of the code to evaluate their feasibility. 7.9.1 Exposing Chunk Data PD transactions include an instruction to a precompiled “system” contract which takes the Range specification as an input. This precompile will bring the chunk data into scope. There are at leas
프로젝트로 돌아가기