Hedera 백서

Hedera

원문

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

. The message would include the relevant details of a transaction such as a bid on a financial asset, or even just the hash of data stored elsewhere. The topic will allow messages with the same topic to be classified togethe r. The client application would pay a transaction fee, denominated in hbars, for the use of the Consensus Service. The Hedera public ledger will return a record which says that consensus has been reached, the timestamp it was reached and the sequence number of the event for the given topic. The sequence number will allow the application to interpret the order of the message relative to the other messages with the same topic. The result will also include a running hash of all the messages so far for that topic. A running hash is a few bytes that act as a fingerprint of all the messages so far for that topic. Topics are created by executing a transaction defined by the HAPI, which allows the topic to be created, the keys of the owner to be specified, the keys of who is allowed to post to or delete the topic to be specified, and which will return the ID number of the topic. Figure 1A: Public Network 59APPENDICES 12 In practice we expect the Consensus Service to be used by a group of mirror node operators and u sers who are leveraging an application that handles priva te or proprietary data, but benefits from t he fast ordering, decentralized trust, and immutable record of a public ordering service. To set up the network, the organizations would configure one or multiple mirror nodes, program client applications on them, and configure one or multiple keys that a llow those who have the keys t o see what the group is doing. The group would also d efine a topic that they can use to identify transactions relevant to their group. This topic will be attached to messages that the client application will send to the Hedera public network. Figure 1B: Transaction Ordering Process The figure above outlines the process for sending a transaction to the Hedera Consensus Service. The client application will create a transaction using the Hedera SDK which allows it to include a message and topic. The message could describe some action, or contain just a hash, or be any other byte array relevant to the client application. Each application will need to use one or more topics. Like the other Hedera network services, the transaction can be sent to a single or multiple mainnet nodes. The mainnet node will check that the transaction has the necessary information (signature(s), payment, inputs) and return an acknowledgment to the client application that the transaction has met precheck. A sample transaction is shown below: CLIENT APPLICATION SDK INTERFACE MAINNET NODE MIRROR NODE Client application submits transaction with a message/uni00A0 and topic. 1 Hedera node returns pre-check con irmation. 2 Hedera node gossips event to network.3 Hedera network determines order and consensus timestamp of event.4 Hedera node generates transaction record with payload, topic, order and consensus timestamp.5 Mirror node listens for records of a given topic.6 Mirror node parses transaction details to create order./uni00A0 7 Client application communicates with mirror node to execute logic based on transaction order. 8 60APPENDICES 13 The mainnet node will gossip the event to the rest of the network, allowing the network to determine a consensus timestamp for the event using the hashgraph consensus algorithm. A record will then be generated which includes the message, the topic, the order, the running hash, and the consensus timestamp. The consensus timestamp is 100% final once reached, and typically is reached in a matter of seconds. The mirror node receives all information from the mainnet, and therefore learns of the transaction and its consensus orde r, with consensus timestamps, tied together with a running hash. It can also construct state proofs that can prove to a third party the exact list of messages received for the topic, and in what orde r, and with what timestamps. The mirror node runs software that implements the application’s business logic. It would take the results of an ordered transaction and return results to the application such as matching bids and asks in a stock market, transferring security tokens between account holders, or updating the status of a good for a shipping and logistics provide r. This feature would have a performance and cost profile similar to using the Cryptocurrency Service (<$0.001 per transaction). Finality would be achieved within a matter of seconds. The application benefits from the distribution of both the mirror network and Hedera public network. Any user can get records from one or multiple mirror nodes and check state proofs 10 to confirm that the mainnet agreed upon that consensus timestamp and order of a transaction. This enables a real- time audit of the mirror node to verify it did the right thing. Any user can also run a mirror node and would immediately know the truth about ordering and correct c onclusions. Hyperledger Fabric Interoperability The Hedera Consens us Service proof-of-con cept use case provides c ustom Hyperledger F abric networks w ith decentralized consensus on t he validity and order of blockchain transactions without the need to configure a RAFT 11 or Kafka 12 ordering service. Hyperledger Fabric features a kind of a node called an orderer (it’s also known as an “ordering node”) that does this transaction ordering, which along with other nodes forms an ordering service . Because Fabric’s design relies on deterministic c onsensus a lgorithms, a ny block a peer validates as generated by the ordering service is guaranteed to be final and correct. 13 In addition to promoting finality, separating the endorsement of chaincode execution (which happens at the peers) from ordering gives Fabric advantages in performance and scalability, eliminating bottlenecks which can occur when execution and ordering are performed by the same nodes. New as of Hyperledger Fabric v1.4.1, Raft is a crash fault tolerant (CFT) ordering service based on an implementation of Raft protocol in etcd. Raft follows a “leader and follower” model, where a leader node is elected (per channel) and its decisions are replicated by the followers. 14 10State Proof: A cryptographically secure, portable assertion from a majority of the network nodes as to some fact about a transaction entered into consensus or the state that resulted 11Configuring and Operating a Raft Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/raft_configuration.html 12Bringing Up a Kafka-based Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/kafka.html 13The Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/orderer/ordering_service.html 14The Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/orderer/ordering_service.html 61APPENDICES 14 While RAFT is easier to set up and manage than Kafka-based ordering services (another option in Hyperledger Fabric), it still has two drawbacks: 1 C onfiguration Complexity: There are four interrelated steps in the process of bootstrapping a Hyperledger Fabric ordering node 15 and six steps to add a new node to a Raft cluster. 16 2 B yzantine Fault Tolerance: A Byzantine fault is a condition where components may act in a malicious way. It even includes the situation where the network itself may be controlled by an attacker. 17 Raft is the first step toward Fabric’s development of a Byzantine fault tolerant (BFT) ordering service, but it isn’t Byzantine fault tolerant t oday.18 FABRIC PLUGIN & FABRIC PEERS MAINNET NODES MIRROR NODES Notify 4 Gossip of transactions between nodeswith mainnet and mirror nodes calculating consensus timestamp & generating state-proofs. /uni00A02 1CLIENTAPPLICATION SDK INTERFACE Broadcasts endorsed messages the Hedera node of choice (or randomly) Publish order to all registered Peers. Peers can register with any or many mirror nodes. 3 Run by Fabric network members Run by Council/public Byzantine – Hyperledger Fabric network can inherit the ABFT nature of the hashgraph consensus algorithm because any Fabric peer can communicate with any mainnet or mirror net node. Any non-malicious node will have the same record and state proof for a transaction. Malicious nodes would become apparent immediately because their records would contradict. Therefore only one mirror net node needs to be running for the system to be honest. Figure 1C: Hyperledger Fabric/ Hedera Consensus Service Interoperability The Hedera Consensus Service will make a global, fault tolerant, and cost-effective ordering service available to any Hyperledger Fabric network built today. 19 15Setting Up an Ordering Node¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/orderer_deploy.html 16Configuring and Operating a Raft Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/raft_configuration.html 17Byzantine Fault https://en.wikipedia.org/wiki/Byzantine_fault 18The Ordering Service¶ https://hyperledger-fabric.readthedocs.io/en/release-1.4/orderer/ordering_service.html 19Introduction https://hyperledger-fabric.readthedocs.io/en/release-1.2/whatis.html 62APPENDICES 15 The diagram on the previous page demonstrates the architecture for enabling any Hyperledger Fabric network to use the Hedera Consensus Service. In doing so the Hyperledger Fabric network can inherit the Byzantine nature of the Hedera public network. In step 1 the client application will broadcast an endorsed message to the Hedera network. The transaction will have been endorsed by the Hyperledger Fabric peers using the endorsement policy. The client application can submit the transaction to any of the mainnet nodes, or even multiple if it would like a higher degree of confidence that the transaction is submitted to the network. The transaction could be passed as any byte array (hash of the transaction, unique transaction id, etc.) and would include a topic which identifies the transaction as belonging to the specific Fabric network. The transaction would then get a consensus timestamp from the Hedera network, preparing it to be ordered. Mirror nodes would also receive gossip from the mainnet nodes to calculate the consensus timestamp and generate a state proof themselves. One or many mirror nodes would then publish the order to a registered set of Hyperledger Fabric Peers. These transactions would then be structured and stored using a running hash to create a tamper proof chain of ordered transactions relevant to the Fabric network. Any Fabric peer can communicate with any mainnet or mirror net node. Any non-malicious node will have the same record and state proof of a transaction. Malicious nodes would become apparent immediately because they would be unable to provide valid state proofs. The Hedera Consensus Service provides any Fabric network the ability to order transactions with high throughput using a global network of nodes that do not need to be operated or individually trusted by the members of the Fabric network. This will reduce operational cost of Fabric-based solutions, improve resiliency to data center outages, and alleviate the need to determine who operates private Fabric ordering services per network. 63APPENDICES 16 topic s to make their transactions harder to identify. Use Case We will explore the example of a Fabric network security token followed by a decentralized stock market in this paper to demonstrate the use of the Hedera Consensus Service in operation. Private Network Token Issuance A private network based on Hyperledger Fabric could issue a token for securities trading between regulated industries. This could be a fungible token representing fractional ownership in a specific property where only permissioned investors can purchase or trade the asset. The members or network administrator would create a topic and communciate the topic ID to all members of the network, so they can recognize both the network and token for the associated t ransaction. 20 When user A transfers a token to user B, the client application would automatically hash the transaction ID and submit it in the message payload of a transaction while specifying the correct topic. The transaction would be signed by the user’s client application and sent to the Hedera public network. Once the record is returned with an order of the message, the client application would complete the transfer between users, now having a fair and final consensus timestamp on when the transaction occurred. At scale the application would be able to determine which transfers come first, and which may be invalid depending on their timestamp. Users would be able to query the mirror node or the mainnet directly to confirm the record for a given transaction, or use mirror nodes to look further back in time to ensure the application is decentralized correctly. The same network could also support atomic swaps of security tokens between networks. Say user A came to an agreement to trade token 1 for token 2, a token issued and traded in another regulated network and currently owned by user C. In order to exchange the tokens, each user would be a pa rticipant in each network. In this use case this may be required because both networks act as regu lated financial markets where the investors are verified. Each token would then be locked up in a smart contract deployed in each network that requires signatures from both users and a timestamp from a transaction on the Hedera public network. Each user will agree to unlock (transfer) the tokens to the new owner simultaneously when triggered by a transaction sent to the Hedera Consensus Service and returned with a consensus timestamp. 20Networks have different privacy requirements. Certain networks could choose to use rotating or more anonymized 64APPENDICES 17 https://www.npr.org/2014/04/01/297686724/on-a-rigged-wall-street-milliseconds-make-all-the-difference The Fabric-Hedera architecture enables the benefits of permissioned asset trading in a private network and the decentralized trust and immutability of the Hedera public network. Users do not have to worry about manipulation of the transaction order by a centralized party and have confidence that the service can sustain downtime f rom individual n odes. Ordering for a Stock Market Stock markets typically foster behavior causing financial firms to spend millions to get a millisecond advantage in the amount of time it takes them to communicate their bid or ask to the stock market.21 This fosters malicious behavior where certain firms front run others to achieve a financial advance. Stock markets built on Hedera will deliver fairness to all market participants. A stock market could be built as an application in either a private network, similar to the token trading use case above, or directly on top of a mirror node or series of mirror nodes. These mirror nodes would run software allowing them to receive messages from the mainnet, including the consensus timestamp and order . They may only listen to messages sen t to the topic related to the stock market built on top. A user of the application would submit their bid or ask to the Hedera Consensus Service either in an anonymized manner using a random transaction ID, or a s a plaintext bid or ask. The message would include a topic that identifies it as belonging to either a specific market or even asset class. The message would receive a consensus order and timestamp and be returned to the single or multiple mirror nodes running the stock market. The mirror nodes would only be listening for messages which have the correct topic to reduce storage burden. A local database would be structured with the ordered messages. The application would be able to use this database to match bids and asks based on their consensus timestamps to operate an efficient and fair stock m arket. If a user doesn’t trust a mainnet node, that used can s ubmit to one or multiple other nodes rather than be bottlenecked by a single source of truth. If a user doesn’t trust one mirror node, that user would be able to ask it for a state proof, or ask any other mirro r node for the records of transactions and even ask the mainnet for a state proof if users choose. The users may even be able to run the mirror node themselves t o additionally verify the outcomes o f the stock market. Any honest node would be able to cryptographically prove they are right and the other is wrong. 21 On A ‘rigged’ Wall Street, Milliseconds Make All The Difference 65APPENDICES 18 Liars in this use case (users, mirror nodes) would be shown immediately because two node’s results will conflict with each other. The barrier for these malicious users to impact the overall consensus process is also much higher through the use of a public network. A single entity (or an aligned group) would need to attain at least 1/3 of all the hbars in existence to materially impact consensus. In smaller private networks this barrier is lower due to both the fewer number of participants and lack of proof-of-stake security mechanism. It is most likely that stock market applications will add privacy to the above architecture to keep certain information confidential. The application in this case could encrypt the message and submit it to Hedera. Only the appropriate parties would be able to read the message while Hedera would only know that some message was processed. The application would then decrypt the message using its key before comparing the bids and asks. This allows for true privacy for the stock market. 66APPENDICES 19 Additional Opportunities The previous two use cases only scratch the surface of p otential use cases of the Hedera Consensus Service. Ride hailing applications could use the service to match supply with demand for a taxi in real time. Supply chains could use the service to get an accura te and fair timestamp for asset transfers across a supply chain. Parts manufacturer s could use the service for real- time actions of goods. Io T manufacturers could use the service to get a consensus timestamp on data read outs from sensors across the globe. The Hedera Consensus Service provides another tool in the box of application builders for leveraging the power of decentralization. 67APPENDICES 20 Conclusion The Hedera Consensus Service brings the value of fast, fair , secure, and decentralized consensus t o any application – private ledger- based or not. Organizations and individuals can issue and trade tokens between private ledgers by using the fair global ordering of transactions for any application. The Hedera Consensus Service reduces the cost of operating pri vate networks, enables both privacy and scalability, and improves the trust model for b oth private ledgers and centralized servers. As with the other Hedera network services, the value of the Consensus Service will be realized most by the diverse applications built on the network by developers from organizations of any size or focus. Long term this will enable a network of interconnected applications leveraging a common service for the ordering of transactions within and between their user bases. 68APPENDICES
프로젝트로 돌아가기