Quant 백서

Quant

원문

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

pplications on the blockchain layer are affected by the parameters concerning the underlying layers (e.g. speed of transactions, energy efficiency, scalability). In fact, if we want to act as the “over-layer”, we must accept and respect the latency of all underlying blockchain technologies involved. Thus, a discussion about speed and throughput of messages is relevant. Overledger applications may require many operations on a single (or multiple) blockchain(s). In this case, the time for each (and between each) subsequent transaction needs to be properly accounted for. In the trivial case, we want to perform an over-layer action that only affects one blockchain, we want to make sure the hash of the action is stored in a valid transaction. A blockchain transaction is valid when consensus is achieved in the distributed network, meaning if a correct node appends (a set of or a block of) transaction(s) “M” to its copy of the blockchain, before appending (a set of or a block of) transaction(s) “N”, then no other correct node will append “N” before “M” to its copy of the blockchain. While this concept of consensus finality is related to the idea of correctness (existence of a single global set of recognised transactions in the system), it refers to the ability of the distributed system to be resilient to the same correct transaction made multiple times (this is also referred to as the problem of double spending) and forks [29]. In this respect, a blockchain can follow a randomised or probabilistic consensus (e.g., Bitcoin) or a deterministic one (all the blockchains based on Lamport Byzantine Fault Tolerance [9]). For example, in the case of Bitcoin, to be “sure” of the commitment of the transaction we use the heuristic of the 6 confirmed blocks to reduce the probability that someone can come up with a longer chain making our transaction invalid. Now let’s suppose we have our action ready at a particular time, we need to wait for a latency not deterministic before our transaction is accepted and added in a block. After this period, we also need to wait a probabilistic period of time until consensus is achieved (6 blocks in the Bitcoin case). 2.2 Filtering and Ordering Layer One of the benefits of blockchains is its capability to store all transactions (one after the other) in a distributed, replicated (collision-free, hiding and puzzle-friendly [6]), hashed data structure, in a way that can quickly detect any changes of the log data structure or any manipulation of data (tamper-evident property). The consensus mechanism embedded in the blockchain’s protocol, unequivocally decides the order of valid blocks. Thus, filtering and sorting blocks allows us to trace ownership of an asset, or to calculate the balance of an account, by replaying all the transfers and transactions from the beginning of the chain [20]. These transactions and transfers are secured because of digital signatures giving the blockchain identification, authorisation and non-repudiation properties. The signature algorithm, the key length of public and private key pairs and the hash function to produce the account address from the public key are embedded in the particular blockchain protocol. The order property, together with the non-repudiation property, solve the double spending problem within the blockchain. The challenge of building an “over-ledger” upon ledgers is to define a criterion according to which blocks can be sequentially ordered and which blockchains’ addresses can be standardised. Such criterion should intelligibly order which different blocks of different blockchains must be processed first and should Page of 2548 translate addresses, which are unique alphanumeric identifiers, of different blockchains, into the same format. In our reference architecture, all the information contained in all the ledgers are put together in the Filtering and Ordering Layer (a logical, not physical layer) where a set of rules filtering a small set of messages and transactions and determines their processing order, regardless of the sequential position held in their respective ledger. For each transaction, we can extract information regarding the sources, the receivers, the coins, the script, the contract and combine them to define rules. Some ledgers allow users to append arbitrary data to transactions (see Subsection 2.1.3). Users can use this space to fill these fields with messages, or, if there’s not enough space, with their fingerprints. Even if these messages are meaningful in the hosting transactions, we can use the contained information to filter and order messages and transactions in different ways. Considering it’s straightforward to find an order among transactions in the same ledgers, it can be challenging to do it in a multi-ledger environment. In the previous section we focused on how to build this message and what we can achieve with them. In this section we’ll introduce the ordering problem and focus on: ●How to set an order binary relation for blocks of different blockchains; and ●How to allow cross-ledger transactions by mapping addresses of the various blockchains into one address, valid in the Overledger domain. To order the transactions within an application, the application scans the ledgers involved and places transaction hashes compliant to the Applications Blockchain Programming Interface (BPI) into a Virtual Block, called a Verification Block. A hash pointer to the Verification Block is then written to the blockchains forming part of the application. After a given interval, dependent on variables, such as number of application transactions and block height, etc, the application then re-scans the blockchains involved back to the Verification Block. Any new BPI compliant transactions appended to the blockchains that are part of the application are then appended to the Verification Block, which is updated on the blockchains involved. Note, there is no order among transactions in the same block or amongst invalid transactions. By design, the Verification Block is keeping the order across all chains involved in the application of hashes appended after consensus has been reached. 2.2.1 Filtering Criterion in Overledger The Messaging Layer contains potentially infinite combinations of messages and information existing in all the ledgers. To find a way to bound this set is to introduce filtering rules to drop all the messages we’re not interested handling in Overledger. All these rules are related to the transactions and their fields. However, some of the fields can be filled with arbitrary data we used for the out of chain messages. This means we can set rules on these messages because their fingerprints are in the ledgers. We’ve two levels of where to apply these rules: ●Transaction validation rules; and ●Out of chain messages validation rules. The first category can be a set of rules using information in the transaction. These set of rules include the choice of permitted ledgers to produce messages. Once we’ve picked the ledgers to use, we need to decide which fields are selected. This is difficult, because each ledger has its own transaction structure, Page of 2648 but we need to select fields to build consistent messages among the ledgers. Even if we chose the set of shared fields, it’s difficult to create compliant messages among ledgers. For example, if we select two ledgers having a similar transaction structure and we only look to the addresses (source and receiver), we’ll need to find a way to map the addresses to allow for an exchange among ledgers. For this reason, out of band messages are useful because they provide the ability to implement this map and eventually have more detailed information. In fact, we can map two addresses into two different transaction ledgers’ external messages. These messages can contain a signature of a user and their fingerprints in the transactions. We can also apply complex logic to these messages, for example by utilising validation schema. However, transaction information is essential because they can contain low-level information about addresses and coin information. For example, an application can allow some messages only if they pay one of its lower level (transaction ledger) addresses, a certain amount of coin, and then use the source of that transaction to send the response. Possibly, we can also use script-smart contract information to allow a legacy application to work. 2.2.2 Ordering Criterion for Overledger Order binary relations. To address the order problem faced in the Filtering and Ordering Layer, we resort to the Order Theory: the branch of mathematics that studies the order using binary relations. This theory provides formal tools to compare two objects within a set and to decide which one is greater than the other. Consider there are objects comparable under many different ways. For example, it’s possible to sort the set of natural numbers with their magnitude or with the lexicographical order. Complex objects, composed of various fields, can be compared by using the combination of their fields. We therefore use the concept of a partially ordered set (poset) [4] to order blocks and transactions. A poset formalises and generalises the intuitive concept of an ordering, sequencing, or arrangement of the elements of a set. A poset consists of a set, together with a binary relation, indicating for certain pairs of elements in the set, one of the elements precedes the other in the ordering (i.e., not every pair of elements need be comparable). Given a set P and a relation ≤ on P elements, then ≤ is a partial order iff for all x, y , z in P we can ensure these three properties: ●Reflexivity: x ≤ x ; ●Antisymmetry: if x ≤ y and y ≤ x then x = y ; and ●Transitivity: if x ≤ y and y ≤ z then x ≤ z . These orders are also known as a poset. If we can prove only reflexivity and transitivity we can call the order a preorder. If the relation has the antisymmetry and transitivity properties and instead of the reflexivity property has the irreflexivity property: ●Irreflexivity: not x < x we define this relation as a strict partial order relation. If we can prove the previous three properties and the following one: ●Totality: x ≤ y or y ≤ x we can define the relationship as a total order and the set of a total ordered set, or linear orders, or chains. In poset, unique elements exist, like the least element l ≤ x, for all x in the set and the greatest element x ≤ g, for all x in the set. In partial order, there can be items having no elements greater/less than them and are not comparable to each other. In this case, these elements are called, respectively, minimal Page of 2748 and maximal. There are elements in the set that are special, concerning a subset of the order. Given a poset P , a binary relation ≤, and one of its subsets S, a lower bound of S is an element l, such that, it is less or equal to all elements s in S. Conversely, with the same assumptions an upper bound is an element u, such that all elements s in S are less than or equal to u. Another important concept is the infimum and the supremum. The infimum is a lower bound called inf of a subset S of a poset P , in which is defined the relation ≤ inf for all lower bounds l of S in P , l ≤ inf. Hence, the supremum is an upper bound called sup of subset S of a poset P , in which is defined the relation ≤, if for all upper bounds u of S in P , sup ≤ u. If the infimum is contained in the subset S, the infimum is called the Least element, in the same way, if the supremum is contained in the subset S, it’s called the Greatest element. If an ordered set S has the property of every subset of S that is non-empty and it has an upper bound, it also has the least upper bound, then it has the least-upper-bound property, also known as Dedekind completeness [21]. If a total order has a least element for all its subsets not empty, the order is called well-order. An important proposition of the set theory on which we build our ordering criterion is Zorn’s Lemma [22] ZORN’s LEMMA: Given a poset P with the property that every chain contained in P has an upper bound in P; then the set P has at least one maximal element. Moreover, we also resort to the principle of duality [26], according to which, if a given statement is valid for all partially ordered sets, then its dual statement, obtained by inverting the direction of all order relations and by dualising all order theoretic definitions involved, is also valid for all partially ordered sets. Namely, every poset P gives rise to a dual (or opposite) partially ordered set Pop. This dual order Pop is defined to be the set with the inverse order, i.e. x ≤ y holds in Pop iff y ≤ x holds in P . For this principle, the previous definitions of the least element or the minimal set can be obtained by the greatest element, or the maximal, by inverting the ordering function. Starting from a given order, this operation allows us to build new types of order. Representation of a poset. There are alternative manners to graphically represent a poset. The first method is via Hasse diagrams, we now define. The Hasse diagram of a partially ordered set P is the (directed) graph whose vertices are the elements of P and whose edges are the pairs (x, y) for which y covers x. It’s usually drawn so elements are placed higher than the elements they cover. And “y covers x” means [x, y] ={x, y}. That is, no elements of the poset lie strictly between x and y (and x ≠ y). According to the Hasse diagram, a binary relation is represented by an edge between two vertices representing two elements, such that the vertex that’s below is the predecessor of the relation, and the one above is the successor of the other vertex. Orders are represented bottom-up. As an example, Fig. 10 shows the Hasse diagram of the poset P(Ѱ, S) where S is 1, 2, 3, 5, 6, 10, 15, 30 the divisors of 30 and is the divisibility relation that exists if one element is an integer divisor of another. For example 1530, because 30 divided by 15 has no reminder, therefore, there’s an edge connecting these two elements, and 15 is below 30 because the binary relation is 15Ѱ30. The topmost element is 30, because in the set there are no elements for which 30 is a divisor. This is a way to visualise the existence of maximals. It’s not possible to spot the existence of greatest elements; it’s possible there is a vertex with a predecessor and it’s not connected to the presumed greatest element or any of its predecessor. In the same way, with this representation, it’s easy to spot minimals, but not that easy to understand if there’s the Least element. Page of 2848 ! Fig. 10: Hasse Diagram of all divisors of 30, ordered by divisibility. Another way to represent a poset is via a directed acyclic graph (DAG). In this case, each vertex represents an element, and the edges point from the predecessor to the successor. As an example, Fig. 11 depicts the order by divisibility of all the divisors of 30. DAGs are data structures easier to implement, and can be used to check properties, or find particular elements. This representation offers a way to find the set of minimals and maximals in O(n), where n is the number of vertices, by checking node by node if the list of outgoing edges is empty (maximals), or if the list of ingoing edges is empty (minimal). If one of these sets has only one element, it’s a sufficient way to prove the existence of the greatest element or the least element. It’s also possible to check if an element is a predecessor or a successor of another one by checking if a path exists connecting the two elements in O(V+E) with a Depth First Search [28]. ! Fig. 11: DAG of all divisors of 30, ordered by divisibility. Blocks order in popular Blockchains. Blockchain Consensus relates to the set of rules and procedures allowing us to maintain and update the ledger and to guarantee the trustworthiness of the records in the ledger, i.e., their reliability, authenticity and accuracy [29]. Those rules and procedures are to be jointly considered when designing an active network consensus validation process, because not only their individual configuration, but also their combination, determines when and how the overall blockchain agreement is achieved, and the ledger’s updated with new information. From a business logic perspective, the correct order of information is critical because it can establish ownership and therefore Page of 2948 rights and obligations [2]. In particular, new information can be added, ordered and stored in the ledger under different rules of Consensus Immutability and Failure Tolerance [29]. The most common rules include the Proof-of-Work (PoW), the Proof-of-Stake (PoS), or hybrid solutions like “PoW and PoS” where PoW blocks act as checkpoints containing no transactions, but anchor both to each other and to the PoS chain. For example, Bitcoin and Ethereum use a set of rules respectively called HashCash [31] and Etash, based on PoW. In the PoW setup, miners connected to the network perform the task of validating the transactions proposed for addition to the blockchain by solving the inversion of a cryptographic function whose solution can only be found by brute force. In PoW the probability of mining a new block depends on the instantaneous computational power devoted to the task by all miners connected to the network under the rule “one CPU one vote”. In PoW, miners are continuously asked to brute-force a one-way hash function by computing new hash values based on the combination of the previous hash values contained in the message, the new transaction block and a nonce, such that the new hash value will start with a given number of zeros ≤ target. In this way it’s easy to build a strict binary relation among blocks. Differently from PoW, in PoS the creator of a new block is selected in a deterministic way, depending on its stake. Block generation is linked to the proof of ownership of a certain amount of digital assets (e.g., digital currencies) linked to the blockchain. The probability a prover is selected to verify the next block is larger, the larger the share of assets this prover has within the system. The underlying assumption is users with a large share of the system’s wealth are more likely to provide trustworthy information with respect to the verification process, and are therefore to be considered a trusted validator [32]. In the case of DLTs where the storage of data isn’t based on chains of blocks, such as Ripple [31], the addition of new information on the ledger is based on iterative processes. Each node builds a transaction set based on the newer transactions it knows (candidate set) and broadcasts it to its trusted network, as a proposed transaction set to be applied to the ledger. When a node receives a proposed transaction set by trusted nodes, it implicitly votes each transaction into the set with “yes” or “no” by including it in a newer proposed transaction set. If a certain percentage of nodes in the trusted network of a specific node votes for a transaction, then that node will add it to its transaction set. After awhile, the percentage threshold rises by making the transaction set converge into one, which is added to the ledger concerning a specific timing scheme. Blocks and transaction order in Overledger. Among other things, we have seen that consensus techniques order the blocks. It’s therefore convenient to represent, with a Hasse diagram the order of blocks B(< , S) where: S is the set of all blocks, < a relation that states which block comes first. B is a total strict order, meaning given two blocks, it’s always possible to choose which comes first. As an example, Fig.12 represents the Hasse diagram of an order problem wi
프로젝트로 돌아가기