KR20190104793A - Method for generating block chain and verifying integrity in smart contract system - Google Patents

Method for generating block chain and verifying integrity in smart contract system Download PDF

Info

Publication number
KR20190104793A
KR20190104793A KR1020180025331A KR20180025331A KR20190104793A KR 20190104793 A KR20190104793 A KR 20190104793A KR 1020180025331 A KR1020180025331 A KR 1020180025331A KR 20180025331 A KR20180025331 A KR 20180025331A KR 20190104793 A KR20190104793 A KR 20190104793A
Authority
KR
South Korea
Prior art keywords
key
smart contract
value
transaction
merkle tree
Prior art date
Application number
KR1020180025331A
Other languages
Korean (ko)
Other versions
KR102424841B1 (en
Inventor
이경준
김종협
고동휘
Original Assignee
주식회사 아이콘루프
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 아이콘루프 filed Critical 주식회사 아이콘루프
Priority to KR1020180025331A priority Critical patent/KR102424841B1/en
Publication of KR20190104793A publication Critical patent/KR20190104793A/en
Application granted granted Critical
Publication of KR102424841B1 publication Critical patent/KR102424841B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Abstract

Provided is a method for generating a block chain in a smart contract system, which updates a smart contract database stored in a form of a key and a key value every time the block chain adds a block and a key-height Merkel tree, and uses the smart contract database and the key-height Merkel tree to verify the integrity of a transaction when the transaction is verified in a light client.

Description

스마트 계약 시스템에서 블록체인을 생성하고 무결성을 검증하는 방법{METHOD FOR GENERATING BLOCK CHAIN AND VERIFYING INTEGRITY IN SMART CONTRACT SYSTEM}How to create blockchain in smart contract system and verify integrity {METHOD FOR GENERATING BLOCK CHAIN AND VERIFYING INTEGRITY IN SMART CONTRACT SYSTEM}

이하의 일 실시 예들은 스마트 계약에 특화된 블록체인 플랫폼에 관한 것으로, 스마트 계약 시스템에서 블록체인을 생성하고 무결성을 검증하는 방법에 관한 것이다.The following embodiments are related to a blockchain platform specialized for smart contracts, and a method for creating a blockchain and verifying integrity in a smart contract system.

스마트 계약(Smart Contract)은 Nick Szabo가 1994년 최초 제안한 개념이다. 기존 계약서(Contract)는 서면으로 되어있어 계약 조건을 이행하려면 실제 사람이 계약서 대로 수행을 해야 하지만 디지털 명령어로 계약을 작성하면 조건에 따라 계약 내용을 자동으로 실행할 수 있다고 주장하였습니다.Smart Contract is a concept originally proposed by Nick Szabo in 1994. Existing contracts are written and insisted that the actual person would have to carry out the contracts in order to fulfill the terms of the contract.

디지털로 된 계약서는 조건에 따른 계약 결과가 명확하고, 계약 내용을 즉각 이행할 수 있다. 각자의 자산이 연결된 디지털로 양자 합의를 하고 계약서를 작성하고 실행하기로 한다면 계약을 이행하는데 복잡한 프로세스를 엄청나게 간소화 될 것 이다. 또한 다양한 그러나 디지털로 된 자료들은 쉽게 복사되고 조작이 쉬워 1994년에 제안한 스마트 계약은 개념으로만 존재하고 구체적인 서비스에 이용될 수 없었다.The digital contract is clear in terms of the terms of the contract and can be implemented immediately. If you decide to make bilateral agreements, create and execute contracts with digitally linked assets, the complex process of implementing a contract will be greatly simplified. In addition, various but digital data are easily copied and manipulated. The smart contract proposed in 1994 existed only as a concept and could not be used for specific services.

블록체인은 디지털 데이터를 신뢰할 수 있게 만들어 주는 기술이다. 다수의 노드가 같은 데이터를 공유하고 검증하는 방식을 통해 디지털상에 신뢰관계를 만들수 있다.Blockchain is a technology that makes digital data reliable. Many nodes can share and verify the same data to create trust in the digital world.

이더리움(Ethereum)은 스마트 계약과 블록체인을 결합하여 생성된 것으로, 스마트 계약 특화 블록체인 플랫폼이다.Ethereum is a smart contract-specific blockchain platform created by combining smart contracts and blockchains.

이하의 설명에서 스마트 계약 특화 블록체인 플랫폼을 "스마트 계약 시스템"이라 칭한다.In the following description, the smart contract-specific blockchain platform is referred to as "smart contract system".

스마트 계약 시스템에 포함된 각 노드들은 블록체인에 포함되는 블록을 생성하기도 하지만 블록에 포함된 트랜잭션을 검증하기도 한다.Each node included in the smart contract system generates a block included in the blockchain, but also verifies a transaction included in the block.

하지만 검증을 위해서는 블록체인의 많은 정보를 가지고 있어야 해서 많은 저장 용량을 요구하거나 또는 검증을 위한 오랜 검색 시간을 필요로 한다. 하지만, 스마트 계약 시스템이 보급됨에 따라서 블록체인의 정보를 최소화 하여 저장하여 스마트 계약 시스템을 이용하는 라이트 클라이언트(Light Client)가 늘어나고 있다. However, verification requires a lot of information on the blockchain, which requires a lot of storage capacity or a long search time for verification. However, as the smart contract system is spreading, light clients using the smart contract system are increasing by minimizing and storing information on the blockchain.

이에 라이트 클라이언트에서 많은 블록체인의 정보를 저장하지 않고도 빠르게 트랜잭션을 검증할 수 있는 방법이 요구된다.Therefore, there is a need for a method that can quickly verify a transaction without storing a lot of blockchain information in the light client.

본 발명은 상기와 같은 종래 기술의 문제점을 해결하고자 도출된 것으로서, 스마트 계약 시스템에서 블록체인을 생성하고 무결성을 검증하는 방법을 제공하는 것을 목적으로 한다.The present invention was derived to solve the above problems of the prior art, and an object of the present invention is to provide a method for generating a blockchain and verifying integrity in a smart contract system.

구체적으로, 본 발명은 블록체인이 블록을 추가할 때마다 키와 키의 값의 형태로 저장되는 스마트 계약 데이터베이스와 키 높이 머클 트리를 갱신하고, 라이트 클라이언트에서 트랜잭션을 검증할 때, 스마트 계약 데이터베이스와 키 높이 머클 트리를 이용해서 보다 간단하게 트랜잭션의 무결성을 검증하는 방법을 제공하는 것을 목적으로 한다.Specifically, the present invention updates a smart contract database and a key height merkle tree stored in the form of a key and a key value every time a blockchain adds a block, and when verifying a transaction in a light client, Its purpose is to provide a simpler way to verify transaction integrity using key height Merkle Tree.

또한, 본 발명은 스마트 계약 데이터베이스의 키 값의 갱신 상태를 블록에 저장해 공유하여 소수의 노드의 장애가 발생해도 같은 스마트 계약 데이터베이스가 갱신되기 때문에 블록체인의 특정 노드의 장애로 발생하는 결함을 허용(fault tolerance)하는 것을 목적으로 한다.In addition, the present invention stores the update state of the key value of the smart contract database in a block and shares it so that the same smart contract database is updated even if a few nodes fail, thereby allowing faults caused by failure of a specific node in the blockchain. tolerance).

상기와 같은 목적을 달성하기 위하여, 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 블록체인을 생성하는 방법은, 트랜잭션을 수신하는 단계; 수신된 트랜잭션으로 블록을 생성하는 단계; 상기 생성된 블록에 포함된 트랜잭션을 순차적으로 실행하여 트랜잭션 실행후의 최종 결과인 스마트 계약 상태를 키와 값의 형태로 도출하는 단계; 상기 스마트 계약 상태를 이용해서 키 높이 머클 트리를 갱신하는 단계; 상기 생성된 블록의 헤더에 상기 키 높이 머클 트리의 루트노드의 값을 포함시키는 단계; 합의 알고리즘에 따라 상기 생성된 블록 합의하는 단계; 상기 생성된 블록이 합의에 통과하면, 블록체인에 상기 생성된 블록을 연결하는 단계; 및 상기 스마트 계약 상태의 키와 값으로 상기 스마트 계약 데이터베이스를 갱신하는 단계를 포함한다.In order to achieve the above object, a method for generating a blockchain in a smart contract system according to an embodiment of the present invention, receiving a transaction; Generating a block with the received transaction; Sequentially executing the transactions included in the generated block to derive the smart contract state, which is the final result after executing the transaction, in the form of a key and a value; Updating a key height merkle tree using the smart contract state; Including a value of a root node of the key height merkle tree in a header of the generated block; Agreeing the generated block according to a consensus algorithm; If the generated block passes the consensus, connecting the generated block to a blockchain; And updating the smart contract database with a key and a value of the smart contract status.

이때, 상기 키 높이 머클 트리는, 상기 키와 상기 키의 값이 변경된 블록의 정보를 포함하는 리프노드; 상기 리프노드를 해쉬해서 해쉬된 값을 포함하는 해쉬된 리프노드; 상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 중간노드; 및 상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 최상위에 위치한 루트노드를 포함할 수 있다.The key height merkle tree may include: a leaf node including information of the key and a block of which the key value is changed; A hashed leaf node containing a hashed value by hashing the leaf node; An intermediate node including a value generated by hashing two child nodes excluding the leaf node; And a root node located at the top including a value generated by hashing two child nodes except the leaf node.

이때, 상기 스마트 계약 데이터베이스는, 상기 블록체인에 포함된 모든 키와 각각의 키의 값을 저장할 수 있다.In this case, the smart contract database may store all keys included in the blockchain and the value of each key.

본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 트랜잭션을 검증하는 방법은, 트랜잭션의 검증을 요청받으면, 상기 트랜잭션에 대응하는 키를 포함하는 키 높이 머클 트리의 무결성을 검증하는 단계; 상기 키 높이 머클 트리의 검증 결과 무결하면, 상기 키가 갱신된 블록을 식별하는 단계; 상기 키가 갱신된 모든 블록을 수신하고, 상기 키가 변경된 내용을 확인하여 상기 키의 값을 확인하는 단계; 스마트 계약 데이터베이스에서 상기 키에 대응하는 키의 값을 확인하는 단계; 상기 변경된 내용을 통해서 확인된 상기 키의 값과 상기 스마트 계약 데이터베이스를 통해서 확인된 상기 키의 값을 비교하는 단계; 및 비교결과 상기 변경된 내용을 통해서 확인된 상기 키의 값과 상기 스마트 계약 데이터베이스를 통해서 확인된 상기 키의 값이 동일하면 무결성 검증에 성공했다고 판단하고, 동일하지 않으면 무결성 검증에 실패했다고 판단하는 단계를 포함한다.According to an embodiment of the present invention, a method for verifying a transaction in a smart contract system includes: verifying an integrity of a key height merkle tree including a key corresponding to the transaction when a transaction is requested to be verified; If the verification result of the key height merkle tree is intact, identifying a block in which the key is updated; Receiving all blocks of which the key has been updated, and confirming a value of the key by checking contents of the key changed; Checking a value of a key corresponding to the key in a smart contract database; Comparing the value of the key confirmed through the changed contents with the value of the key confirmed through the smart contract database; And if it is determined that the value of the key identified through the changed contents and the value of the key identified through the smart contract database are the same, determining that the integrity verification is successful, otherwise determining that the integrity verification has failed. Include.

이때, 스마트 계약 시스템에서 트랜잭션을 검증하는 방법은, 블록체인에 블록이 추가될 때마다 블록헤더와 상기 키 높이 머클 트리를 동기화 하는 단계를 더 포함할 수 있다.In this case, the method of verifying a transaction in the smart contract system may further include synchronizing the block header and the key height merkle tree whenever a block is added to the blockchain.

이때, 상기 키 높이 머클 트리는, 상기 키와 상기 키의 값이 변경된 블록의 정보를 포함하는 리프노드; 상기 리프노드를 해쉬해서 해쉬된 값을 포함하는 해쉬된 리프노드; 상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 중간노드; 및 상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 최상위에 위치한 루트노드를 포함할 수 있다.The key height merkle tree may include: a leaf node including information of the key and a block of which the key value is changed; A hashed leaf node containing a hashed value by hashing the leaf node; An intermediate node including a value generated by hashing two child nodes excluding the leaf node; And a root node located at the top including a value generated by hashing two child nodes except the leaf node.

이때, 상기 스마트 계약 데이터베이스는, 블록체인에 포함된 모든 키와 각각의 키의 값을 저장할 수 있다.In this case, the smart contract database may store all keys and values of each key included in the blockchain.

이때, 상기 키 높이 머클 트리의 무결성을 검증하는 단계는, 상기 키 높이 머클 트리에서 상기 트랜잭션에 대응하는 상기 키의 리프노드를 확인하는 단계; 상기 리프노드를 해쉬하고 해쉬한 값을 상기 키 높이 머클 트리의 부모노드와 비교하여 무결성을 검증하는 단계; 이웃노드의 해쉬값과 함께 해쉬해서 생성된 해쉬값을 상기 키 높이 머클 트리의 부모노드와 비교하여 무결성 검증하는 것을 루트 노드까지 수행하는 단계; 및 상기 루트 노드까지 무결성을 검증한 결과 모든 검증에서 이상이 없으면, 상기 키 높이 머클 트리가 무결하다고 판단하는 단계를 포함할 수 있다.At this time, verifying the integrity of the key height Merkle tree, the step of identifying a leaf node of the key corresponding to the transaction in the key height Merkle tree; Hashing the leaf node and comparing the hashed value with a parent node of the key height merkle tree to verify integrity; Performing integrity verification by comparing the hash value generated by hashing with the hash value of the neighbor node with the parent node of the key height merkle tree to the root node; And if there is no abnormality in all verifications as a result of verifying the integrity up to the root node, determining that the key height merkle tree is intact.

본 발명은 블록체인이 블록을 추가할 때마다 키와 키의 값의 형태로 저장되는 스마트 계약 데이터베이스와 키 높이 머클 트리를 갱신하고, 라이트 클라이언트에서 트랜잭션을 검증할 때, 스마트 계약 데이터베이스와 키 높이 머클 트리를 이용해서 트랜잭션의 무결성을 검증하는 방법에 관한 것으로, 적은 양의 데이터를 이용해서 보다 빠른 시간에 트랜잭션의 무결성을 검증할 수 있도록 할 수 있다. 또한, 스마트 계약 데이터베이스의 키 값의 갱신 상태를 블록에 저장하여 공유함으로써 소수의 노드의 장애로 발생하는 결함을 허용(fault tolerance)할 수 있다.The present invention updates the smart contract database and key height merkle tree where the blockchain is stored in the form of key and key value every time a blockchain is added, and when the transaction is verified in the light client, the smart contract database and key height merkle The present invention relates to a method of verifying the integrity of a transaction using a tree, so that a small amount of data can be used to verify the integrity of a transaction at a faster time. In addition, by storing and updating the updated state of the key value of the smart contract database in a block, fault tolerance caused by the failure of a few nodes can be allowed.

도 1은 본 발명의 일 실시 예에 따른 스마트 계약에 특화된 블록체인 시스템인 스마트 계약 시스템의 개략적인 구성을 도시한 도면이다.
도 2는 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 블록체인에 블록을 추가하는 과정을 도시한 흐름도이다.
도 3은 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 트랜잭션을 검증하는 과정을 도시한 흐름도이다.
도 4는 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 키 높이 머클 트리를 검증하는 과정을 도시한 흐름도이다.
도 5는 본 발명의 일 실시 예에 따른 키 높이 머클 트리의 예를 도시한 도면이다.
도 6은 본 발명의 일 실시 예에 따른 스마트 계약 데이터베이스의 예를 도시한 도면이다.
1 is a diagram illustrating a schematic configuration of a smart contract system that is a blockchain system specialized for a smart contract according to an embodiment of the present invention.
2 is a flowchart illustrating a process of adding a block to a block chain in a smart contract system according to an embodiment of the present invention.
3 is a flowchart illustrating a process of verifying a transaction in a smart contract system according to an embodiment of the present invention.
4 is a flowchart illustrating a process of verifying a height height merkle tree in a smart contract system according to an embodiment of the present invention.
5 is a diagram illustrating an example of a key height merkle tree according to an embodiment of the present invention.
6 is a diagram illustrating an example of a smart contract database according to an embodiment of the present invention.

본 명세서에 개시되어 있는 본 발명의 개념에 따른 실시 예들에 대해서 특정한 구조적 또는 기능적 설명들은 단지 본 발명의 개념에 따른 실시 예들을 설명하기 위한 목적으로 예시된 것으로서, 본 발명의 개념에 따른 실시 예들은 다양한 형태로 실시될 수 있으며 본 명세서에 설명된 실시 예들에 한정되지 않는다.Specific structural or functional descriptions of the embodiments according to the inventive concept disclosed herein are provided for the purpose of describing the embodiments according to the inventive concept only. It may be implemented in various forms and is not limited to the embodiments described herein.

본 발명의 개념에 따른 실시 예들은 다양한 변경들을 가할 수 있고 여러 가지 형태들을 가질 수 있으므로 실시 예들을 도면에 예시하고 본 명세서에 상세하게 설명하고자 한다. 그러나, 이는 본 발명의 개념에 따른 실시 예들을 특정한 개시형태들에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 변경, 균등물, 또는 대체물을 포함한다.Embodiments according to the inventive concept may be variously modified and have various forms, so embodiments are illustrated in the drawings and described in detail herein. However, this is not intended to limit the embodiments in accordance with the concept of the present invention to specific embodiments, and includes modifications, equivalents, or substitutes included in the spirit and scope of the present invention.

제1 또는 제2 등의 용어를 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만, 예를 들어 본 발명의 개념에 따른 권리 범위로부터 이탈되지 않은 채, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소는 제1 구성요소로도 명명될 수 있다.Terms such as first or second may be used to describe various components, but the components should not be limited by the terms. The terms are only for the purpose of distinguishing one component from another component, for example, without departing from the scope of the rights according to the inventive concept, the first component may be called a second component, Similarly, the second component may also be referred to as the first component.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. 구성요소들 간의 관계를 설명하는 표현들, 예를 들어 "~사이에"와 "바로~사이에" 또는 "~에 직접 이웃하는" 등도 마찬가지로 해석되어야 한다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between. Expressions describing relationships between components, such as "between" and "immediately between" or "directly neighboring", should be interpreted as well.

본 명세서에서 사용한 용어는 단지 특정한 실시 예들을 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 실시된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함으로 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this specification, terms such as "comprise" or "have" are intended to designate that the implemented feature, number, step, operation, component, part, or combination thereof is present, but one or more other features or numbers, It is to be understood that it does not exclude in advance the possibility of the presence or addition of steps, actions, components, parts or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 갖는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art, and are not construed in ideal or excessively formal meanings unless expressly defined herein. Do not.

이하, 실시 예들을 첨부된 도면을 참조하여 상세하게 설명한다. 그러나, 특허출원의 범위가 이러한 실시 예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조 부호는 동일한 부재를 나타낸다.Hereinafter, exemplary embodiments will be described in detail with reference to the accompanying drawings. However, the scope of the patent application is not limited or limited by these embodiments. Like reference numerals in the drawings denote like elements.

이하에서는, 본 발명의 일 실시 예에 따른 스마트 계약 시스템(Smart Contract System)에서 블록체인(Blockchain)을 생성하고 무결성을 검증하는 방법을 첨부된 도 1 내지 도 6을 참조하여 상세히 설명한다.Hereinafter, a method of generating a blockchain and verifying integrity in a smart contract system according to an embodiment of the present invention will be described in detail with reference to FIGS. 1 to 6.

도 1은 본 발명의 일 실시 예에 따른 스마트 계약(Smart Contract)에 특화된 블록체인 시스템인 스마트 계약 시스템의 개략적인 구성을 도시한 도면이다.1 is a diagram illustrating a schematic configuration of a smart contract system that is a blockchain system specialized for a smart contract according to an embodiment of the present invention.

도 1을 참조하면, 스마트 계약 시스템은 다수의 통신 장치들(110 - 180)로 구성되고, 통신 장치들(110 - 180) 중에서 어떤 통신장치는 블록을 생성하여 블록체인에 블록을 추가할 수도 있다. 이때, 스마트 계약 시스템의 통신 장치에서 트랜잭션의 검증이 용이한 블록을 생성하여 블록체인에 블록을 추가하는 방법을 아래 도 2를 참조하여 보다 상세히 후술한다.Referring to FIG. 1, the smart contract system is composed of a plurality of communication devices 110-180, and any communication device among the communication devices 110-180 may generate a block and add a block to the block chain. . At this time, a method of adding a block to the block chain by generating a block that can easily verify a transaction in a communication device of the smart contract system will be described in more detail with reference to FIG. 2 below.

그리고, 통신 장치들(110 - 180) 중에서 어떤 통신 장치는 사용자의 요청에 따라서 블록체인에 포함되어 있는 트랜잭션(Transaction)의 무결성을 검증할 수도 있다. 이때, 통신 장치들(110 - 180) 중에는 블록체인에 추가할 블록을 생성하지 않고, 트랜잭션을 생성하여 블록을 생성하는 통신 장치로 제공하고, 트랜잭션의 무결성을 검증하는 라이트 클라이언트의 통신 장치가 포함될 수 있다. 스마트 계약 시스템의 통신 장치에서 트랜잭션의 무결성을 검증하는 방법을 아래 도 2를 참조하여 보다 상세히 후술한다.In addition, any communication device among the communication devices 110-180 may verify the integrity of a transaction included in the blockchain according to a user's request. In this case, the communication devices 110 to 180 may include a communication device of a light client that does not generate a block to be added to the blockchain, generates a transaction, provides the block to the communication device, and verifies the integrity of the transaction. have. A method of verifying the integrity of a transaction in the communication device of the smart contract system will be described in more detail with reference to FIG. 2 below.

이하, 상기와 같이 구성된 본 발명에 따른 스마트 계약 시스템에서 블록체인을 생성하고 무결성을 검증하는 방법을 아래에서 도면을 참조하여 설명한다.Hereinafter, a method for generating a blockchain and verifying integrity in a smart contract system according to the present invention configured as described above will be described with reference to the accompanying drawings.

도 2는 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 블록체인에 블록을 추가하는 과정을 도시한 흐름도이다.2 is a flowchart illustrating a process of adding a block to a block chain in a smart contract system according to an embodiment of the present invention.

도 2를 참조하면, 스마트 계약 시스템의 블록체인 생성 장치는 블록에 포함될 트랜잭션을 수신한다(210).Referring to FIG. 2, the blockchain generating apparatus of the smart contract system receives a transaction to be included in a block (210).

그리고, 블록체인 생성 장치는 수신된 트랜잭션으로 블록을 생성한다(212).In operation 212, the blockchain generating apparatus generates a block using the received transaction.

그리고, 블록체인 생성 장치는 생성된 블록에 포함된 트랜잭션을 순차적으로 실행하여 트랜잭션 실행후의 최종 결과인 스마트 계약 상태를 키와 값의 형태로 도출한다(214). 그리고, 블록체인 생성 장치는 스마트 계약 상태를 이용해서 키 높이 머클 트리(Key-Height Merkle tree)를 갱신한다(216).The blockchain generating apparatus sequentially executes the transactions included in the generated block to derive the smart contract state, which is the final result after executing the transaction, in the form of key and value (214). The blockchain generating apparatus updates the key-height merkle tree using the smart contract state (216).

이때, 키 높이 머클 트리는 아래 도 4와 같은 형태로 구성될 수 있다. At this time, the key height Merkle tree may be configured as shown in FIG.

도 5는 본 발명의 일 실시 예에 따른 키 높이 머클 트리의 예를 도시한 도면이다.5 is a diagram illustrating an example of a key height merkle tree according to an embodiment of the present invention.

도 5를 참조하면, 키 높이 머클 트리는 리프노드(510), 해쉬된 리프노드(520), 중간노드(530) 및 루트노드(540)로 구성된다.Referring to FIG. 5, the key height merkle tree is composed of a leaf node 510, a hashed leaf node 520, an intermediate node 530, and a root node 540.

리프노드(510)는 키와 키의 값이 변경된 블록의 정보를 포함하여 구성된다.The leaf node 510 includes a key and information of a block in which a value of the key is changed.

해쉬된 리프노드(520)는 리프노드를 해쉬해서 해쉬된 값으로 구성된다.The hashed leaf node 520 consists of a hashed value of the leaf node.

중간노드(530)는 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값으로 구성된다.The intermediate node 530 consists of a value generated by hashing two child nodes except the leaf node.

루트노드(540)는 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값으로 구성된 최상위에 위치한 노드이다.The root node 540 is a node located at the top composed of a value generated by hashing two child nodes except the leaf node.

다시 도 2의 설명으로 돌아와서, 블록체인 생성 장치는 생성된 블록의 헤더에 키 높이 머클 트리의 루트노드의 값을 포함시킨다(218).Returning to the description of FIG. 2 again, the blockchain generating apparatus includes the value of the root node of the key height Merkle tree in the header of the generated block (218).

그리고, 블록체인 생성 장치는 합의 알고리즘에 따라 생성된 블록 합의를 수행한다(220).In operation 220, the blockchain generating apparatus performs a block agreement generated according to a consensus algorithm.

그리고, 블록체인 생성 장치는 생성된 블록이 합의에 통과하면, 블록체인에 생성된 블록을 연결한다(222).If the generated block passes the consensus, the blockchain generating apparatus connects the generated block to the blockchain (222).

그리고, 블록체인 생성 장치는 스마트 계약 상태의 키와 값으로 스마트 계약 데이터베이스(Smart Contract Database)를 갱신한다(224).The blockchain generating apparatus updates the smart contract database with the key and the value of the smart contract state (224).

이때, 스마트 계약 데이터베이스는 아래 도 6과 같은 형태로 구현될 수 있다.At this time, the smart contract database may be implemented in the form as shown in FIG.

도 6은 본 발명의 일 실시 예에 따른 스마트 계약 데이터베이스의 예를 도시한 도면이다.6 is a diagram illustrating an example of a smart contract database according to an embodiment of the present invention.

도 6을 참조하면, 스마트 계약 데이터베이스(600)는 블록체인에 포함된 모든 키와 각각의 키의 값을 저장할 수 있다.Referring to FIG. 6, the smart contract database 600 may store all keys included in the blockchain and values of each key.

도 3은 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 트랜잭션을 검증하는 과정을 도시한 흐름도이다.3 is a flowchart illustrating a process of verifying a transaction in a smart contract system according to an embodiment of the present invention.

도 3을 참조하면, 스마트 계약 시스템의 트랜잭션 검증 장치는 블록체인에 블록이 추가될 때마다 블록헤더와 키 높이 머클 트리를 동기화 한다(310).Referring to FIG. 3, the transaction verification apparatus of the smart contract system synchronizes the block header and the key height merkle tree whenever a block is added to the block chain (310).

그리고, 트랜잭션 검증 장치는 트랜잭션의 검증을 요청받으면(312), 트랜잭션에 대응하는 키를 포함하는 키 높이 머클 트리를 검증한다(314). 키 높이 머클 트리를 검증하는 구체적인 방법은 이후 도 4를 참조하여 후술한다.When the transaction verification apparatus is requested to verify the transaction (312), the transaction verification apparatus verifies the key height Merkle tree including the key corresponding to the transaction (314). A detailed method of verifying the key height merkle tree will be described later with reference to FIG. 4.

그리고, 트랜잭션 검증 장치는 키 높이 머클 트리의 검증 결과 무결한지 확인한다(316).The transaction verification apparatus verifies whether the verification result of the key height Merkle tree is intact (316).

316단계의 확인결과, 키 높이 머클 트리가 무결하면, 트랜잭션 검증 장치는 키 높이 머클 트리의 해당 키에 대응하는 리프노드에 키와 함께 저장된 키가 갱신된 블록에 관한 정보를 이용해서 키가 갱신된 블록을 식별한다(318).As a result of checking in step 316, if the key height Merkle tree is intact, the transaction verification apparatus updates the key using information on a block in which the key stored with the key has been updated on the leaf node corresponding to the corresponding key of the key height Merkle tree. Identifies the block (318).

그리고, 트랜잭션 검증 장치는 키가 갱신된 모든 블록을 수신하고, 키가 변경된 내용을 확인하여 키의 값(제1값)을 확인한다(320).In operation 320, the transaction verification apparatus receives all blocks whose keys have been updated and checks the value of the key (first value) by checking the changed contents of the key.

그리고, 트랜잭션 검증 장치는 스마트 계약 데이터베이스에서 키에 대응하는 키의 값(제2값)을 확인한다(322).In operation 322, the transaction verification apparatus verifies the value (second value) of the key corresponding to the key in the smart contract database.

그리고, 트랜잭션 검증 장치는 변경된 내용을 통해서 확인된 키의 값(제1값)과 스마트 계약 데이터베이스를 통해서 확인된 키의 값(제2값)이 동일한지 비교한다(324).In operation 324, the transaction verification apparatus compares whether the value (first value) of the key confirmed through the changed content and the value (second value) of the key confirmed through the smart contract database are the same.

324단계의 비교결과 변경된 내용을 통해서 확인된 키의 값(제1값)과 스마트 계약 데이터베이스를 통해서 확인된 키의 값(제2값)이 동일하면, 트랜잭션 검증 장치는 무결성 검증에 성공했다고 판단하고, 검증을 요청한 트랜잭션이 무결하다고 판단한다(326).As a result of the comparison in step 324, if the key value (first value) confirmed through the changed content and the key value (second value) confirmed through the smart contract database are identical, the transaction verification apparatus determines that the integrity verification is successful. In operation 326, the transaction requesting verification is determined to be intact.

316단계의 확인결과 키 높이 머클 트리가 무결하지 않거나, 324단계의 비교결과 변경된 내용을 통해서 확인된 키의 값(제1값)과 스마트 계약 데이터베이스를 통해서 확인된 키의 값(제2값)이 동일하지 않으면, 트랜잭션 검증 장치는 무결성 검증에 실패했다고 판단하고, 검증을 요청한 트랜잭션이 무결하지 않다고 판단한다(328).The key height Merkle tree is not intact as a result of check in step 316, or the value (first value) of the key confirmed through the changed content as a result of the comparison in step 324 and the key value (second value) confirmed through the smart contract database. If not the same, the transaction verification apparatus determines that integrity verification has failed, and determines that the transaction requesting verification is not intact (328).

도 4는 본 발명의 일 실시 예에 따른 스마트 계약 시스템에서 키 높이 머클 트리를 검증하는 과정을 도시한 흐름도이다.4 is a flowchart illustrating a process of verifying a height height merkle tree in a smart contract system according to an embodiment of the present invention.

도 4를 참조하면, 스마트 계약 시스템의 트랜잭션 검증 장치는 키 높이 머클 트리에서 트랜잭션에 대응하는 키의 리프노드를 확인한다(410).Referring to FIG. 4, the transaction verification apparatus of the smart contract system identifies a leaf node of a key corresponding to a transaction in a key height merkle tree (410).

그리고, 트랜잭션 검증 장치는 리프노드를 해쉬하고 해쉬한 값을 키 높이 머클 트리의 부모노드와 비교하여 무결성을 검증한다(412).The transaction verification apparatus hashes the leaf node and compares the hashed value with the parent node of the key height Merkle tree to verify integrity (412).

그리고, 트랜잭션 검증 장치는 이웃노드의 해쉬값과 함께 해쉬해서 생성된 해쉬값을 키 높이 머클 트리의 부모노드와 비교하여 무결성을 검증하는 것을 루트 노드까지 수행한다(414).The transaction verification apparatus compares the hash value generated by hashing with the hash value of the neighbor node with the parent node of the key height Merkle tree, and verifies the integrity to the root node (414).

그리고, 트랜잭션 검증 장치는 루트노드까지 검증한 결과 모든 검증에서 이상이 없는지 확인한다(416).The transaction verification apparatus verifies that there is no abnormality in all verifications as a result of verifying up to the root node (416).

416단계의 확인결과 리프노드에서 루트노드까지 모든 노드의 무결성 검증에 이상이 없으면, 트랜잭션 검증 장치는 키 높이 머클 트리가 무결하다고 판단한다(418).If the integrity verification of all nodes from the leaf node to the root node has no abnormality as a result of checking in step 416, the transaction verification apparatus determines that the key height merkle tree is intact (418).

416단계의 확인결과 리프노드에서 루트노드까지 모든 노드의 무결성 검증에 실패하면, 트랜잭션 검증 장치는 키 높이 머클 트리가 무결하지 않다고 판단한다(420).If it is determined in step 416 that the integrity verification of all nodes from the leaf node to the root node fails, the transaction verification apparatus determines that the key height merkle tree is not intact (420).

이상에서 설명된 장치는 하드웨어 구성요소, 소프트웨어 구성요소, 및/또는 하드웨어 구성요소 및 소프트웨어 구성요소의 조합으로 구현될 수 있다. 실시 예들에서 설명된 장치 및 구성요소는, 예를 들어, 프로세서, 콘트롤러, ALU(arithmetic logic unit), 디지털 신호 프로세서(digital signal processor), 마이크로컴퓨터, FPGA(field programmable gate array), PLU(programmable logic unit), 마이크로프로세서, 또는 명령(instruction)을 실행하고 응답할 수 있는 다른 어떠한 장치와 같이, 하나 이상의 범용 컴퓨터 또는 특수 목적 컴퓨터를 이용하여 구현될 수 있다. 처리 장치는 운영 체제(OS) 및 상기 운영 체제 상에서 수행되는 하나 이상의 소프트웨어 애플리케이션을 수행할 수 있다. 또한, 처리 장치는 소프트웨어의 실행에 응답하여, 데이터를 접근, 저장, 조작, 처리 및 생성할 수도 있다. 이해의 편의를 위하여, 처리 장치는 하나가 사용되는 것으로 설명된 경우도 있지만, 해당 기술분야에서 통상의 지식을 가진 자는, 처리 장치가 복수 개의 처리 요소(processing element) 및/또는 복수 유형의 처리 요소를 포함할 수 있음을 알 수 있다. 예를 들어, 처리 장치는 복수 개의 프로세서 또는 하나의 프로세서 및 하나의 콘트롤러를 포함할 수 있다. 또한, 병렬 프로세서(parallel processor)와 같은, 다른 처리 구성(processing configuration)도 가능하다.The apparatus described above may be implemented as a hardware component, a software component, and / or a combination of hardware components and software components. The apparatus and components described in the embodiments are, for example, a processor, a controller, an arithmetic logic unit (ALU), a digital signal processor, a microcomputer, a field programmable gate array (FPGA), programmable logic (PLU), and the like. unit, microprocessor, or any other device capable of executing and responding to instructions, may be implemented using one or more general purpose or special purpose computers. The processing device may execute an operating system (OS) and one or more software applications running on the operating system. The processing device may also access, store, manipulate, process, and generate data in response to the execution of the software. For convenience of explanation, one processing device may be described as being used, but one of ordinary skill in the art will appreciate that the processing device includes a plurality of processing elements and / or a plurality of types of processing elements. It can be seen that it may include. For example, the processing device may include a plurality of processors or one processor and one controller. In addition, other processing configurations are possible, such as parallel processors.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.The software may include a computer program, code, instructions, or a combination of one or more of the above, and configure the processing device to operate as desired, or process it independently or collectively. You can command the device. Software and / or data may be any type of machine, component, physical device, virtual equipment, computer storage medium or device in order to be interpreted by or to provide instructions or data to the processing device. Or may be permanently or temporarily embodied in a signal wave to be transmitted. The software may be distributed over networked computer systems so that they may be stored or executed in a distributed manner. Software and data may be stored on one or more computer readable recording media.

실시 예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시 예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.Method according to the embodiment is implemented in the form of program instructions that can be executed by various computer means may be recorded on a computer readable medium. The computer readable medium may include program instructions, data files, data structures, etc. alone or in combination. Program instructions recorded on the media may be those specially designed and constructed for the purposes of the present disclosure, or they may be of the kind well-known and available to those having skill in the computer software arts. Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tape, optical media such as CD-ROMs, DVDs, and magnetic disks, such as floppy disks. Magneto-optical media, and hardware devices specifically configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine code generated by a compiler, but also high-level language code that can be executed by a computer using an interpreter or the like. The hardware device described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

이상과 같이 실시 예들이 비록 한정된 실시 예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.Although the above embodiments have been described with reference to the limited embodiments and the drawings, those skilled in the art may make various modifications and variations from the above description. For example, the described techniques may be performed in a different order than the described method, and / or components of the described systems, structures, devices, circuits, etc. may be combined or combined in a different form than the described method, or other components. Or even if replaced or substituted by equivalents, an appropriate result can be achieved.

그러므로, 다른 구현들, 다른 실시 예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims also fall within the scope of the claims that follow.

Claims (9)

트랜잭션을 수신하는 단계;
수신된 트랜잭션으로 블록을 생성하는 단계;
상기 생성된 블록에 포함된 트랜잭션을 순차적으로 실행하여 트랜잭션 실행후의 최종 결과인 스마트 계약 상태를 키와 값의 형태로 도출하는 단계;
상기 스마트 계약 상태를 이용해서 키 높이 머클 트리를 갱신하는 단계;
상기 생성된 블록의 헤더에 상기 키 높이 머클 트리의 루트노드의 값을 포함시키는 단계;
합의 알고리즘에 따라 상기 생성된 블록 합의하는 단계;
상기 생성된 블록이 합의에 통과하면, 블록체인에 상기 생성된 블록을 연결하는 단계; 및
상기 스마트 계약 상태의 키와 값으로 상기 스마트 계약 데이터베이스를 갱신하는 단계
를 포함하는 스마트 계약 시스템에서 블록체인을 생성하는 방법.
Receiving a transaction;
Generating a block with the received transaction;
Sequentially executing the transactions included in the generated block to derive the smart contract state, which is the final result after executing the transaction, in the form of a key and a value;
Updating a key height merkle tree using the smart contract state;
Including a value of a root node of the key height merkle tree in a header of the generated block;
Agreeing the generated block according to a consensus algorithm;
If the generated block passes the consensus, connecting the generated block to a blockchain; And
Updating the smart contract database with the key and value of the smart contract status
How to create a blockchain in a smart contract system comprising a.
제1항에 있어서,
상기 키 높이 머클 트리는,
상기 키와 상기 키의 값이 변경된 블록의 정보를 포함하는 리프노드;
상기 리프노드를 해쉬해서 해쉬된 값을 포함하는 해쉬된 리프노드;
상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 중간노드; 및
상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 최상위에 위치한 루트노드
를 포함하는 스마트 계약 시스템에서 블록체인을 생성하는 방법.
The method of claim 1,
The tall height Merkle tree,
A leaf node including information of the key and a block in which the value of the key is changed;
A hashed leaf node containing a hashed value by hashing the leaf node;
An intermediate node including a value generated by hashing two child nodes excluding the leaf node; And
Root node located at the top that contains a value generated by hashing two child nodes except the leaf node
How to create a blockchain in a smart contract system comprising a.
제1항에 있어서,
상기 스마트 계약 데이터베이스는,
상기 블록체인에 포함된 모든 키와 각각의 키의 값을 저장하는
스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
The method of claim 1,
The smart contract database,
Stores all the keys included in the blockchain and the value of each key
How to validate a transaction in a smart contract system.
트랜잭션의 검증을 요청받으면, 상기 트랜잭션에 대응하는 키를 포함하는 키 높이 머클 트리의 무결성을 검증하는 단계;
상기 키 높이 머클 트리의 검증 결과 무결하면, 상기 키가 갱신된 블록을 식별하는 단계;
상기 키가 갱신된 모든 블록을 수신하고, 상기 키가 변경된 내용을 확인하여 상기 키의 값을 확인하는 단계;
스마트 계약 데이터베이스에서 상기 키에 대응하는 키의 값을 확인하는 단계;
상기 변경된 내용을 통해서 확인된 상기 키의 값과 상기 스마트 계약 데이터베이스를 통해서 확인된 상기 키의 값을 비교하는 단계; 및
비교결과 상기 변경된 내용을 통해서 확인된 상기 키의 값과 상기 스마트 계약 데이터베이스를 통해서 확인된 상기 키의 값이 동일하면 무결성 검증에 성공했다고 판단하고, 동일하지 않으면 무결성 검증에 실패했다고 판단하는 단계
를 포함하는 스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
Verifying the integrity of a key height Merkle tree containing a key corresponding to the transaction when requested to verify the transaction;
If the verification result of the key height merkle tree is intact, identifying a block in which the key is updated;
Receiving all blocks of which the key has been updated, and confirming a value of the key by checking contents of the key changed;
Checking a value of a key corresponding to the key in a smart contract database;
Comparing the value of the key confirmed through the changed contents with the value of the key confirmed through the smart contract database; And
Comparing the determined key and the value of the key identified through the smart contract database to determine that the integrity verification is successful; otherwise, determining that the integrity verification has failed.
How to verify the transaction in the smart contract system comprising a.
제4항에 있어서,
블록체인에 블록이 추가될 때마다 블록헤더와 상기 키 높이 머클 트리를 동기화 하는 단계
를 더 포함하는 스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
The method of claim 4, wherein
Synchronizing the block header and the key height merkle tree whenever a block is added to the blockchain
How to verify the transaction in the smart contract system further comprising.
제4항에 있어서,
상기 키 높이 머클 트리는,
상기 키와 상기 키의 값이 변경된 블록의 정보를 포함하는 리프노드;
상기 리프노드를 해쉬해서 해쉬된 값을 포함하는 해쉬된 리프노드;
상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 중간노드; 및
상기 리프노드를 제외한 2개의 자식 노드를 해쉬해서 생성된 값을 포함하는 최상위에 위치한 루트노드
를 포함하는 스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
The method of claim 4, wherein
The tall height Merkle tree,
A leaf node including information of the key and a block in which the value of the key is changed;
A hashed leaf node containing a hashed value by hashing the leaf node;
An intermediate node including a value generated by hashing two child nodes excluding the leaf node; And
Root node located at the top that contains a value generated by hashing two child nodes except the leaf node
How to verify the transaction in the smart contract system comprising a.
제4항에 있어서,
상기 스마트 계약 데이터베이스는,
블록체인에 포함된 모든 키와 각각의 키의 값을 저장하는
스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
The method of claim 4, wherein
The smart contract database,
It stores all the keys included in the blockchain and the value of each key.
How to validate a transaction in a smart contract system.
제4항에 있어서,
상기 키 높이 머클 트리의 무결성을 검증하는 단계는,
상기 키 높이 머클 트리에서 상기 트랜잭션에 대응하는 상기 키의 리프노드를 확인하는 단계;
상기 리프노드를 해쉬하고 해쉬한 값을 상기 키 높이 머클 트리의 부모노드와 비교하여 무결성을 검증하는 단계;
이웃노드의 해쉬값과 함께 해쉬해서 생성된 해쉬값을 상기 키 높이 머클 트리의 부모노드와 비교하여 무결성 검증하는 것을 루트 노드까지 수행하는 단계; 및
상기 루트 노드까지 무결성을 검증한 결과 모든 검증에서 이상이 없으면, 상기 키 높이 머클 트리가 무결하다고 판단하는 단계
를 포함하는 스마트 계약 시스템에서 트랜잭션을 검증하는 방법.
The method of claim 4, wherein
Verifying the integrity of the key height Merkle tree,
Identifying a leaf node of the key corresponding to the transaction in the key height merkle tree;
Hashing the leaf node and comparing the hashed value with a parent node of the key height merkle tree to verify integrity;
Performing integrity verification by comparing the hash value generated by hashing with the hash value of the neighbor node with the parent node of the key height merkle tree to the root node; And
If integrity is verified up to the root node and there is no abnormality in all verifications, determining that the key height merkle tree is intact
How to verify the transaction in the smart contract system comprising a.
제1항 내지 제8항 중 어느 한 항의 방법을 실행하기 위한 프로그램이 기록되어 있는 것을 특징으로 하는 컴퓨터에서 판독 가능한 기록 매체.A computer-readable recording medium in which a program for executing the method of any one of claims 1 to 8 is recorded.
KR1020180025331A 2018-03-02 2018-03-02 Method for generating block chain and verifying integrity in smart contract system KR102424841B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180025331A KR102424841B1 (en) 2018-03-02 2018-03-02 Method for generating block chain and verifying integrity in smart contract system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180025331A KR102424841B1 (en) 2018-03-02 2018-03-02 Method for generating block chain and verifying integrity in smart contract system

Publications (2)

Publication Number Publication Date
KR20190104793A true KR20190104793A (en) 2019-09-11
KR102424841B1 KR102424841B1 (en) 2022-07-26

Family

ID=67949261

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180025331A KR102424841B1 (en) 2018-03-02 2018-03-02 Method for generating block chain and verifying integrity in smart contract system

Country Status (1)

Country Link
KR (1) KR102424841B1 (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080288A (en) * 2019-10-18 2020-04-28 湖南天河国云科技有限公司 Block chain consensus achieving method and device based on directed acyclic graph
CN111339191A (en) * 2020-02-20 2020-06-26 百度在线网络技术(北京)有限公司 Data storage method, device, equipment and medium of block chain
CN112148794A (en) * 2020-09-23 2020-12-29 京东数字科技控股股份有限公司 Version management method and device of intelligent contract and storage medium
CN112308561A (en) * 2020-10-16 2021-02-02 浙江甲骨文超级码科技股份有限公司 Block chain-based evidence storing method and system, computer equipment and storage medium
KR102225196B1 (en) * 2019-11-06 2021-03-09 알리페이 (항저우) 인포메이션 테크놀로지 씨오., 엘티디. Consensus of shared blockchain data storage based on error correction codes
CN112488683A (en) * 2020-12-11 2021-03-12 深圳前海微众银行股份有限公司 Method and device for offline transaction of block chain
CN112862477A (en) * 2021-02-07 2021-05-28 中国人民大学 Block chain-based digital commodity atomic transaction method and system
WO2021108258A1 (en) * 2019-11-25 2021-06-03 Visa International Service Association Optimizations for verification of interactions system and method using probability density functions
CN113076558A (en) * 2021-04-20 2021-07-06 西安交通大学 Block chain data connection query method capable of efficiently supporting privacy protection and verifying
CN113268408A (en) * 2020-12-28 2021-08-17 上海能链众合科技有限公司 Automatic testing method facing open permission chain
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN113704249A (en) * 2021-07-14 2021-11-26 杭州溪塔科技有限公司 Method and device for using static Mercker tree in block chain
CN113886399A (en) * 2021-10-25 2022-01-04 支付宝(杭州)信息技术有限公司 Index database updating method and device and index database-based retrieval method and device
KR20220052117A (en) * 2020-10-20 2022-04-27 주식회사 커먼컴퓨터 Method and system for managing states for a block chain including a state database of tree structure
WO2022098015A1 (en) * 2020-11-04 2022-05-12 삼성전자 주식회사 Electronic device for generating transaction including internal data, and operating method thereof
CN115017226A (en) * 2021-03-05 2022-09-06 京东科技信息技术有限公司 Data storage method and device, electronic equipment and storage medium
CN115099817A (en) * 2022-06-17 2022-09-23 北京中科深智科技有限公司 Efficient block chain transaction verification and query method and system
US11489663B2 (en) 2020-01-31 2022-11-01 International Business Machines Corporation Correlation-based hash tree verification
CN115632791A (en) * 2022-10-12 2023-01-20 南京航空航天大学 Dynamic cross-chain data consistency decentralized verification method
CN112862477B (en) * 2021-02-07 2024-05-07 中国人民大学 Digital commodity atomic transaction method and system based on blockchain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140298010A1 (en) * 2013-03-26 2014-10-02 Cloudtomo Limited Public-key certificate management system and method
KR101701131B1 (en) * 2016-04-28 2017-02-13 주식회사 라피 Data recording and validation methods and systems using the connecting of blockchain between different type
KR20170091248A (en) * 2016-01-29 2017-08-09 한국과학기술원 Method And Apparatus for Memory Integrity Verification Based on Merkle Tree
KR20180005542A (en) * 2016-07-06 2018-01-16 주식회사 케이티 Apparatus and method for verifing data integrity
KR101816653B1 (en) * 2017-02-14 2018-02-21 주식회사 코인플러그 Method for providing login flow via authentication based on public key infrastructure in response to user’s login request for using service provided by service provider server in use of smart contract with blockchain database and server using the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140298010A1 (en) * 2013-03-26 2014-10-02 Cloudtomo Limited Public-key certificate management system and method
KR20170091248A (en) * 2016-01-29 2017-08-09 한국과학기술원 Method And Apparatus for Memory Integrity Verification Based on Merkle Tree
KR101701131B1 (en) * 2016-04-28 2017-02-13 주식회사 라피 Data recording and validation methods and systems using the connecting of blockchain between different type
KR20180005542A (en) * 2016-07-06 2018-01-16 주식회사 케이티 Apparatus and method for verifing data integrity
KR101816653B1 (en) * 2017-02-14 2018-02-21 주식회사 코인플러그 Method for providing login flow via authentication based on public key infrastructure in response to user’s login request for using service provided by service provider server in use of smart contract with blockchain database and server using the same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Ethan Buchman, "Tendermint: Byzantine Fault Tolerance in the Age of Blockchains"(2016.06.)* *

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111080288B (en) * 2019-10-18 2023-08-18 湖南天河国云科技有限公司 Block chain consensus achieving method and device based on directed acyclic graph
CN111080288A (en) * 2019-10-18 2020-04-28 湖南天河国云科技有限公司 Block chain consensus achieving method and device based on directed acyclic graph
KR102225196B1 (en) * 2019-11-06 2021-03-09 알리페이 (항저우) 인포메이션 테크놀로지 씨오., 엘티디. Consensus of shared blockchain data storage based on error correction codes
US11068338B2 (en) 2019-11-06 2021-07-20 Alipay (Hangzhou) Information Technology Co., Ltd. Consenus of shared blockchain data storage based on error correction code
WO2021108258A1 (en) * 2019-11-25 2021-06-03 Visa International Service Association Optimizations for verification of interactions system and method using probability density functions
US11489663B2 (en) 2020-01-31 2022-11-01 International Business Machines Corporation Correlation-based hash tree verification
CN111339191B (en) * 2020-02-20 2023-05-26 百度在线网络技术(北京)有限公司 Data storage method, device, equipment and medium of block chain
CN111339191A (en) * 2020-02-20 2020-06-26 百度在线网络技术(北京)有限公司 Data storage method, device, equipment and medium of block chain
CN112148794A (en) * 2020-09-23 2020-12-29 京东数字科技控股股份有限公司 Version management method and device of intelligent contract and storage medium
CN112308561A (en) * 2020-10-16 2021-02-02 浙江甲骨文超级码科技股份有限公司 Block chain-based evidence storing method and system, computer equipment and storage medium
KR20220052117A (en) * 2020-10-20 2022-04-27 주식회사 커먼컴퓨터 Method and system for managing states for a block chain including a state database of tree structure
WO2022098015A1 (en) * 2020-11-04 2022-05-12 삼성전자 주식회사 Electronic device for generating transaction including internal data, and operating method thereof
CN112488683A (en) * 2020-12-11 2021-03-12 深圳前海微众银行股份有限公司 Method and device for offline transaction of block chain
CN112488683B (en) * 2020-12-11 2024-02-23 深圳前海微众银行股份有限公司 Under-chain transaction method and device of blockchain
CN113268408A (en) * 2020-12-28 2021-08-17 上海能链众合科技有限公司 Automatic testing method facing open permission chain
CN113268408B (en) * 2020-12-28 2023-11-28 上海零数众合信息科技有限公司 Automatic testing method for open license chain
CN112862477B (en) * 2021-02-07 2024-05-07 中国人民大学 Digital commodity atomic transaction method and system based on blockchain
CN112862477A (en) * 2021-02-07 2021-05-28 中国人民大学 Block chain-based digital commodity atomic transaction method and system
CN115017226A (en) * 2021-03-05 2022-09-06 京东科技信息技术有限公司 Data storage method and device, electronic equipment and storage medium
CN113076558A (en) * 2021-04-20 2021-07-06 西安交通大学 Block chain data connection query method capable of efficiently supporting privacy protection and verifying
CN113657900B (en) * 2021-07-13 2024-03-22 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN113704249A (en) * 2021-07-14 2021-11-26 杭州溪塔科技有限公司 Method and device for using static Mercker tree in block chain
CN113886399A (en) * 2021-10-25 2022-01-04 支付宝(杭州)信息技术有限公司 Index database updating method and device and index database-based retrieval method and device
CN115099817B (en) * 2022-06-17 2023-03-24 北京中科深智科技有限公司 Efficient block chain transaction verification and query method and system
CN115099817A (en) * 2022-06-17 2022-09-23 北京中科深智科技有限公司 Efficient block chain transaction verification and query method and system
CN115632791A (en) * 2022-10-12 2023-01-20 南京航空航天大学 Dynamic cross-chain data consistency decentralized verification method
CN115632791B (en) * 2022-10-12 2024-03-19 南京航空航天大学 Dynamic cross-chain data consistency decentration verification method

Also Published As

Publication number Publication date
KR102424841B1 (en) 2022-07-26

Similar Documents

Publication Publication Date Title
KR102424841B1 (en) Method for generating block chain and verifying integrity in smart contract system
TWI737944B (en) Block chain-based transaction execution method and device, and electronic equipment
US11861343B2 (en) Systems, apparatus, and methods for updating a programmable device using a distributed ledger
US11914712B1 (en) Blockchain based secure naming and update verification
JP7382108B2 (en) Efficient verification for blockchain
US10630463B2 (en) Meta block chain
CN110300984B (en) Changing smart contracts recorded in a blockchain
JP7093599B2 (en) How to manage snapshots on the blockchain, computer programs, snapshot nodes, auditor nodes and systems
US10523526B2 (en) System and method for managing services and licenses using a blockchain network
US20190278767A1 (en) Smart contract upgrade method and system based on alliance chain
JP2023100981A (en) Control flow in block chain script
KR102019211B1 (en) Method for generating block chain capable of overcoming byzantine fault
Wang et al. Mtmr: Ensuring mapreduce computation integrity with merkle tree-based verifications
US10614040B2 (en) Testing of lock managers in computing environments
JP6868728B2 (en) Methods and Equipment for Continuous Delivery of Permissioned Blockchain Applications
Thakkar et al. Scaling blockchains using pipelined execution and sparse peers
CN107451007B (en) Verification method and system of block chain for error correction aiming at added blocks
JP2018106700A (en) Cloud access method monitorable in real time
CN110807195B (en) Intelligent contract issuing method, issuing platform device and issuing system
KR20210097560A (en) Block chain transaction processing method
JP7421443B2 (en) Data migration methods, data migration systems, and nodes
KR102189667B1 (en) Unified block mining for transaction approval and modification in decentralized blockchains
KR102191803B1 (en) Behavior information proof method by block chain
US20230231719A1 (en) Method, apparatus, electronic device, and medium for data transfer
KR20230136078A (en) Device and method for checking policy conflict on sdn

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant