bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 52쪽 중 9쪽
resses are not *robust* in the sense that they depend on chain state and are defined on-chain by the `InitActor`. Additionally, actor IDs can change for a brief time after creation if the same ID is assigned to different actors on different forks. Actor ID addresses are similar to monotonically increasing numeric primary keys in a relational database. So, when a chain reorganization occurs (similar to a rollback in a SQL database), you can refer to the same ID for different rows. The expected consensus algorithm will resolve the conflict. Once the state that defines a new ID reaches finality, no changes can occur, and the ID is bound to that actor forever.
For example, the mainnet burn account ID address, `f099`, is structured as follows:
```plaintext
Address type
|
f 0 9 9
| |
| Actor ID
|
Network identifier
```
ID addresses are often referred to by their shorthand `f0`.
## Public keys
Actors managed directly by users, like accounts, are derived from a public-private key pair. If you have access to a private key, you can sign messages sent from that actor. The public key is used to derive an address for the actor. Public key addresses are referred to as *robust addresses* as they do not depend on the Filecoin chain state.
Public key addresses allow devices, like hardware wallets, to derive a valid Filecoin address for your account using just the public key. The device doesn’t need to ask a remote node what your ID address is. Public key addresses provide a concise, safe, human-readable way to reference actors before the chain state is final. ID addresses are used as a space-efficient way to identify actors in the Filecoin chain state, where every byte matters.
Filecoin supports two types of public key addresses:
* [`secp256k1` addresses](https://en.wikipedia.org/wiki/Secp256k1) that begin with the prefix `f1`.
* [BLS addresses](https://en.wikipedia.org/wiki/BLS_digital_signature) that begin with the prefix `f3`.
For BLS addresses, Filecoin uses `curve bls12-381` for BLS signatures, which is a pair of two related curves, `G1` and `G2`.
Filecoin uses `G1` for public keys, as G1 allows for a smaller representation of public keys and `G2` for signatures. This implements the same design as ETH2 but contrasts with Zcash, which has signatures on `G1` and public keys on `G2`. However, unlike ETH2, which stores private keys in big-endian order, Filecoin stores and interprets private keys in little-endian order.
Public key addresses are often referred to by their shorthand, `f1` or `f3`.
## Actors
Actor addresses provide a way to create robust addresses for actors not associated with a public key. They are generated by taking a `sha256` hash of the output of the account creation. The ZH storage provider has the actor address `f2plku564ddywnmb5b2ky7dhk4mb6uacsxuuev3pi` and the ID address `f01248`.
Actor addresses are often referred to by their shorthand, `f2`.
## Extensible user-defined actors
Filecoin supports extensible, user-defined actor addresses through the `f4` address class, introduced in [Filecoin Improvement Proposal (FIP) 0048](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md). The `f4` address class provides the following benefits to the network:
* A predictable addressing scheme to support interactions with addresses that do not yet exist on-chain.
* User-defined, custom addressing systems without extensive changes and network upgrades.
* Support for native addressing schemes from foreign runtimes such as the EVM.
An `f4` address is structured as `f4<address-manager-actor-id>f<new-actor-id>`, where `<address-manager-actor-id>` is the actor ID of the *address manager*, and `<new-actor-id>` is the arbitrary actor ID chosen by that actor. An *address manager* is an actor that can create new actors and assign an `f4` address to the new actor.
Currently, per [FIP 0048](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0048.md), `f4` addresses may only be assigned by and in association with specific, built-in actors called *address managers*. Once users are able to deploy custom WebAssembly actors, this restriction will likely be relaxed in a future FIP.
As an example, suppose an address manager has an actor ID (an `f0` address) `123`, and that address manager creates a new actor. Then, the `f4` address of the actor created by the address manager is `f4123fa3491xyz`, where `f4` is the address class, `123` is the actor ID of the address manager, `f` is a separator, and `a3491xyz` is the arbitrary `<new-actor-id>` chosen by that actor.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/core-concepts/filecoin-virtual-machine/addresses)
# Blocks and tipsets
Like many other blockchains, blocks are a fundamental concept in Filecoin. Unlike other blockchains, Filecoin is a chain of groups of blocks called tipsets rather than a chain of individual blocks.
## Blocks
In Filecoin, a block consists of:
* A block header
* A list of *messages* contained in the block
* A signed copy of each message listed
Every block refers to at least one *parent block*; that is, a block produced in a prior epoch.
A *message* represents communication between two actors and thus changes in network state. The messages are listed in their order of appearance, deduplicated, and returned in canonical order of execution. So, in other words, a block describes all changes to the network state in a given epoch.
### Blocktime
Blocktime is a concept that represents the average time it takes to mine or produce a new block on a blockchain. In Ethereum, for example, the blocktime is approximately 15 seconds on average, meaning that a new block is added to the Ethereum blockchain roughly every 15 seconds.
In the Filecoin network, storage providers compete to produce blocks by providing storage capacity and participating in the consensus protocol. The block time determines how frequently new blocks are added to the blockchain, which impacts the overall speed and responsiveness of the network.
Filecoin has a block time of 30 seconds, and this duration was chosen for two main reasons:
* **Hardware requirements**: If the block time were faster while maintaining the same gas limit or the number of messages per block, it would lead to increased hardware requirements. This includes the need for more storage space to accommodate the larger chain data resulting from more frequent block production.
* **Storage provider operations**: The block time also takes into account the various operations that occur during that duration on the storage provider (SP) side. As SPs generate new blocks, the 30-second block time allows for the necessary processes and computations to be carried out effectively. If the blocktime were shorter, SPs would encounter significantly more blocktime failures.
By considering these factors, the Filecoin network has established a block time of 30 seconds, balancing the need for efficient operations and hardware requirements.
## Tipsets
As described in [Consensus](/core-concepts/filecoin-virtual-machine/consensus), multiple potential block producers may be elected via Expected Consensus (EC) to create a block in each epoch, which means that more than one valid block may be produced in a given epoch. All valid blocks with the same height and same parent block are assembled into a group called a *tipset*.
### Benefits of tipsets
In other blockchains, blocks are used as the fundamental representation of network state, that is, the overall status of each participant in the network at a given time. However, this structure has the following disadvantages:
* Potential block producers may be hobbled by network latency.
* Not all valid work is rewarded.
* Decentralization and collaboration in block production are not incentivized.
Because Filecoin is a chain of tipsets rather than individual blocks, the network enjoys the following benefits:
* All valid blocks generated in a given round are used to determine network state, increasing network efficiency and throughput.
* All valid work is rewarded (that is, all validated block producers in an epoch receive a block reward).
* All potential block producers are incentivized to produce blocks, disincentivizing centralization and promoting collaboration.
* Because all blocks in a tipset have the same height and parent, Filecoin is able to achieve rapid convergence in the case of forks.
In summary, blocks, which contain actor messages, are grouped into tipsets in each epoch, which can be thought of as the overall description of the network state for a given epoch.
### Tipsets in the Ethereum JSON-RPC
Wherever you see the term *block* in the Ethereum JSON-RPC, you should mentally read *tipset*. Before the inclusion of the Filecoin EVM runtime, there was no single hash referring to a tipset. A tipset ID was the concatenation of block CIDs, which led to a variable-length ID and poor user experience.
With the Ethereum JSON-RPC, we introduced the concept of the *tipset CID* for the first time. It is calculated by hashing the former *tipset key* using a Blake-256 hash. Therefore, when you see the term:
* *block hash*, think *tipset hash*.
* *block height*, think *tipset epoch*.
* *block messages*, think *messages in all blocks in a tipset, in their order of appearance, deduplicated and returned in canonical order of execution*.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/core-concepts/filecoin-virtual-machine/blocks-and-tipsets)
# Consensus
In the Filecoin blockchain, network consensus is achieved using the Expected Consensus (EC) algorithm, a secret, fair, and verifiable consensus protocol used by the network to agree on the chain state
## Overview
In the Filecoin blockchain, network *consensus* is achieved using the Expected Consensus (EC) algorithm, a probabilistic, *Byzantine fault-tolerant* consensus protocol. At a high level, EC achieves consensus by running a secret, fair, and verifiable *leader election* at every [epoch](/reference/general/glossary#epoch) where a set number of participants may become eligible to submit a block to the chain based on fair and verifiable criteria.
## Properties
Expected Consensus (EC) has the following properties:
* Each epoch has potentially multiple elected leaders who may propose a block.
* A winner is selected randomly from a set of network participants weighted according to the respective storage power they contribute to the Filecoin network.
* All blocks proposed are grouped together in a *tipset*, from which the final chain is selected.
* A block producer can be verified by any participant in the network.
* The identity of a block producer is anonymous until they release their block to the network.
## Steps
In summary, EC involves the following steps at each *epoch*:
1. A storage provider checks to see if they are elected to propose a block by generating an *election proof*.
2. Zero, one, or multiple storage providers may be elected to propose a block. This does not mean that an elected participant is guaranteed to be able to submit a block. In the case where:
* **No storage providers are elected to propose a block in a given epoch**; a new election is run in the next epoch to ensure that the network remains live.
* **One or more storage providers are elected to propose a block in a given epoch**; each must generate a *WinningPoSt proof-of-storage* to be eligible to actually submit a block.
3. Each potential block producer elected generates a storage proof using [WinningPoSt](/reference/general/glossary#winning-proof-of-spacetime-winningpost) for a randomly selected [*sector*](/reference/general/glossary#sector) within in short window of time. Potential block producers that fail this step are not eligible to produce a block. In this step, the following could occur:
* **All potential block producers fail WinningPoSt**, in which case EC returns to step 1 (described above).
* **One or more potential block producers pass WinningPoSt**, which means they are eligible to submit that block to the epochs tipset.
4. Blocks generated by block producers are grouped into a [tipset](/reference/general/glossary#tipset).
5. The tipset that reflects the biggest amount of committed storage on the network is selected.
6. Using the selected tipset, the chain state is propagated.
7. EC returns to step 1 in the next epoch.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/core-concepts/filecoin-virtual-machine/consensus)
# Drand
Drand, pronounced dee-rand, is a distributed randomness beacon daemon written in Golang.
This page covers how Drand is used within the Filecoin network. For more information on Drand generally, [take a look at the project’s documentation](https://www.drand.love/developers).
## Randomness outputs
By polling the appropriate endpoint, a Filecoin node will get back a Drand value formatted as follows:
```json
{
"round": 367,
"signature": "b62dd642e939191af1f9e15bef0f0b0e9562a5f570a12a231864afe468377e2a6424a92ccfc34ef1471cbd58c37c6b020cf75ce9446d2aa1252a090250b2b1441f8a2a0d22208dcc09332eaa0143c4a508be13de63978dbed273e3b9813130d5",
"previous_signature": "afc545efb57f591dbdf833c339b3369f569566a93e49578db46b6586299422483b7a2d595814046e2847494b401650a0050981e716e531b6f4b620909c2bf1476fd82cf788a110becbc77e55746a7cccd47fb171e8ae2eea2a22fcc6a512486d"
}
```
* `signature`: the threshold BLS signature on the previous signature value and the current round number round.
* `previous_signature`: the threshold BLS signature from the previous Drand round.
* `round`: the index of randomness in the sequence of all random values produced by this Drand network.
The message signed is the concatenation of the round number treated as a uint64 and the previous signature. At the moment, Drand uses BLS signatures on the BLS12-381 curve with the latest v7 RFC of hash-to-curve, and the signature is made over G1.
## Polling the network
Filecoin nodes fetch the Drand entry from the distribution network of the selected Drand network.
Drand distributes randomness using multiple distribution channels such as HTTP servers, S3 buckets, gossiping, etc. Simply put, the Drand nodes themselves will not be directly accessible by consumers; rather, highly-available relays will be set up to serve Drand values over these distribution channels.
On initialization, Filecoin initializes a Drand client with chain info that contains the following information:
* Period: the period of time between each Drand randomness generation.
* GenesisTime: at which the first round in the Drand randomness chain is created.
* PublicKey: the public key to verify randomness.
* GenesisSeed: the seed that has been used for creating the first randomness.
It is possible to simply store the hash of this chain info and to retrieve the contents from the Drand distribution network as well on the `/info` endpoint.
Thereafter, the Filecoin client can call Drand’s endpoints:
* `/public/latest` to get the latest randomness value produced by the beacon.
* `/public/<round>` to get the randomness value produced by the beacon at a given round.
## Using Drand
Drand is used as a randomness beacon for leader election in Filecoin. While Drand returns multiple values with every call to the beacon (see above), Filecoin blocks need only store a subset of these in order to track a full Drand chain. This information can then be mixed with on-chain data for use in Filecoin.
## Edge cases and outages
Any Drand beacon outage will effectively halt Filecoin block production. Given that new randomness is not produced, Filecoin miners cannot generate new blocks. Specifically, any call to the Drand network for a new randomness entry during an outage should be blocked in Filecoin.
After a beacon downtime, Drand nodes will work to quickly catch up to the current round. In this way, the above time-to-round mapping in Drand used by Filecoin remains invariant after this catch-up following downtime.
While Filecoin miners were not able to mine during the Drand outage, they will quickly be able to run leader election thereafter, given a rapid production of Drand values. We call this a *catch-up* period.
During the catch-up period, Filecoin nodes will backdate their blocks in order to continue using the same time-to-round mapping to determine which Drand round should be integrated according to the time. Miners can then choose to publish their null blocks for the outage period, including the appropriate Drand entries throughout the blocks, per the time-to-round mapping. Or, as is more likely, try to craft valid blocks that might have been created during the outage.
Based on the level of decentralization of the Filecoin network, we expect to see varying levels of miner collaboration during this period. This is because there are two incentives at play: trying to mine valid blocks during the outage to collect block rewards and not falling behind a heavier chain being mined by a majority of miners who may or may not have ignored a portion of these blocks.
In any event, a heavier chain will emerge after the catch-up period and mining can resume as normal.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/core-concepts/filecoin-virtual-machine/drand)
# Proofs
In Filecoin cryptographic proving systems, often simply referred to as proofs, are used to validate that a storage provider (SP) is properly storing data.
Different blockchains use different cryptographic proving systems (proofs) based on the network’s specific purpose, goals, and functionality. Regardless of which method is used, proofs have the following in common:
* All blockchain networks seek to achieve [*consensus*](/core-concepts/filecoin-virtual-machine/consensus) and rely on proofs as part of this process.
* Proofs incentivize network participants to behave in certain ways and allow the network to penalize participants who do not abide by network standards.
* Proofs allow decentralized systems to agree on a network state without a central authority.
Proof-of-Work and Proof-of-Stake are both fairly common proof methods:
* **Proof-of-Work**: nodes in the network solve complex mathematical problems to validate transactions and create new blocks,
* **Proof-of-Stake**: nodes in the network are chosen to validate transactions and create new blocks based on the amount of cryptocurrency they hold and “stake” in the network.
The Filecoin network aims to provide useful, reliable storage to its participants. With a traditional centralized entity like a cloud storage provider, explicit trust is placed in the entity itself that the data will be stored in a way that meets some minimum set of standards such as security, scalability, retrievability, or replication. Because the Filecoin network is a decentralized network of storage providers (SPs) distributed across the globe, network participants need an automated, trustless, and decentralized way to validate that an SP is doing a good job of handling the data.
In particular, the Filecoin proof process must verify the data was properly stored at the time of the initial request and is continuing to be stored based on the terms of the agreement between the client and the SP. In order for the proof processes to be robust, the process must:
* Target a random part of the data.
* Occur at a time interval such that it is not possible, profitable, or rational for an SP to discard and re-fetch the copy of data.
In Filecoin, this process is known as *Proof-of-Storage*, and consists of two distinct types of proofs:
* [Proof of Replication (PoRep)](#proof-of-replication-porep): a procedure used at the time of initial data storage to validate that an SP has *cr프로젝트로 돌아가기