KR20220101576A - A blockchain-based zero-knowledge verification method that can protect privacy - Google Patents

A blockchain-based zero-knowledge verification method that can protect privacy Download PDF

Info

Publication number
KR20220101576A
KR20220101576A KR1020220003975A KR20220003975A KR20220101576A KR 20220101576 A KR20220101576 A KR 20220101576A KR 1020220003975 A KR1020220003975 A KR 1020220003975A KR 20220003975 A KR20220003975 A KR 20220003975A KR 20220101576 A KR20220101576 A KR 20220101576A
Authority
KR
South Korea
Prior art keywords
verification
generating
functions
chain
blockchain
Prior art date
Application number
KR1020220003975A
Other languages
Korean (ko)
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 충남대학교산학협력단
Publication of KR20220101576A publication Critical patent/KR20220101576A/en

Links

Images

Classifications

    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3218Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs
    • 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
    • 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/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Storage Device Security (AREA)

Abstract

The present invention relates to a blockchain-based zero-knowledge verification method performed by a computer device, comprising the steps of: (a) generating a plurality of functions for performing detailed calculations in a contract environment on an off-chain, and generating a single verification function by combining the functions; (b) generating a root value by hashing a plurality of data values on the off-chain; (c) writing the verification function in a programming language of a blockchain, and uploading the rewritten verification function and the root value to the blockchain; (d) performing calculation on at least one of the functions in the verification function on the off-chain; (e) generating a proof as a result of performing the calculation in step (d); and (f) verifying the proof on the blockchain, whereby the blockchain-based zero-knowledge verification method protects privacy and provides scalability.

Description

프라이버시 보호가 가능한 블록체인 기반의 영지식 검증 방법{A BLOCKCHAIN-BASED ZERO-KNOWLEDGE VERIFICATION METHOD THAT CAN PROTECT PRIVACY}A blockchain-based zero-knowledge verification method that can protect privacy {A BLOCKCHAIN-BASED ZERO-KNOWLEDGE VERIFICATION METHOD THAT CAN PROTECT PRIVACY}

본 발명은 블록체인 기반의 영지식 검증 방법에 관한 것으로, 보다 상세하게는 함수 연산 수행 단계와 검증 단계를 블록체인과 오프-체인을 구분하여 검증을 수행할 수 있는 영지식 검증 방법에 관한 것이다.The present invention relates to a block-chain-based zero-knowledge verification method, and more particularly, to a zero-knowledge verification method capable of performing verification by dividing a function operation execution step and a verification step into a block chain and off-chain.

공개 블록체인은 합의를 통해 블록을 생성하여 중앙화된 서버 없이 탈중앙화된 시스템으로 신뢰를 제공할 수 있다. 또한 스마트 컨트랙트에서는 사용자의 데이터와 실행할 함수를 저장하고 트랜잭션을 통해 해당 함수를 실행하여 사용자의 데이터를 변경시킬 수 있다. 그러나, 사용자의 데이터가 모든 노드에게 공개되고 어떠한 연산을 수행하는지 또는 어떠한 연산이 수행되었는지가 드러나 프라이버시 문제가 발생한다.A public blockchain can create blocks through consensus, providing trust as a decentralized system without a centralized server. In addition, smart contracts store user data and functions to be executed, and execute the functions through transactions to change user data. However, a privacy problem arises because the user's data is disclosed to all nodes and what kind of operation is performed or what operation is performed is revealed.

영지식 증명(Zero-Knowledge Proof)은 비밀 값을 드러내지 않고 증명하고자 하는 사실에 대해 검증을 가능하게 한다. 영지식 증명을 사용하여 연산을 증명하는 경우, off-chain에서 개인 정보에 대한 연산을 수행하고 개인 정보는 드러내지 않지만 연산에 대해 증명하는 증명값을 생성하여 블록체인에서 증명값을 제출해 계산이 올바르게 수행되었음을 검증하게 된다. 그 중 libSNARK를 이용해 제안된 ZoKrates와 zkay의 경우에는 memory와 storage의 값을 영지식 증명으로 처리하는 방법을 통해 프라이버시를 보장할 수 있다. 그러나, 어떤 연산을 수행하는지에 대한 정보는 함수를 통해 알 수 있어, 궁극적으로 프라이버시 문제를 해결하지 못하는 한계를 갖는다. Zero-Knowledge Proof enables verification of facts to be proved without revealing secret values. When a zero-knowledge proof is used to prove an operation, the calculation is performed correctly by performing the operation on personal information off-chain and generating a proof value that proves the operation without revealing the personal information and submitting the proof value in the block chain. to verify that it has been Among them, in the case of ZoKrates and zkay proposed using libSNARK, privacy can be guaranteed by treating the values of memory and storage as zero-knowledge proofs. However, information on which operation is performed can be known through a function, and ultimately has a limitation in not solving the privacy problem.

이에 본 발명은 연산이 수행된 함수와, 함수의 연산으로 변경된 정보가 노출되지 않아 프라이버시가 확보될 수 있는 검증 시스템에 대한 연구 개발을 진행하였다.Accordingly, the present invention has conducted research and development on a function on which an operation is performed and a verification system in which privacy can be secured because information changed by the operation of the function is not exposed.

한국등록특허 제10-2289414호Korean Patent No. 10-2289414

본 발명은 블록체인 기반의 영지식 검증 방법에 관한 것으로, 종래의 영지식 증명이 갖는 문제인 증명을 하는 과정에서 사용자의 정보 또는 검증에 연산된 함수가 노출되어 사용자의 프라이버시가 보호되지 않는 문제를 해결하고자 한다.The present invention relates to a blockchain-based zero-knowledge verification method, and solves the problem that user's privacy is not protected because user information or a function calculated for verification is exposed in the process of verification, which is a problem with conventional zero-knowledge proof want to

본 발명이 해결하려는 과제들은 앞에서 언급한 과제들로 제한되지 않는다. 본 발명의 다른 과제 및 장점들은 아래 설명에 의해 더욱 분명하게 이해될 것이다.The problems to be solved by the present invention are not limited to the aforementioned problems. Other objects and advantages of the present invention will be more clearly understood by the following description.

상기 목적을 달성하기 위하여 본 발명은, 컴퓨터 장치에 의해 수행되는 블록체인 기반의 영지식 검증 방법에 있어서, (a) 오프-체인(Off-Chain) 상의 컨트랙트 환경에서 세부 연산을 수행하는 복수의 함수를 생성하고, 복수의 상기 함수들을 결합하여 단일한 검증 함수를 생성하는 단계; (b) 오프-체인 상에서 복수의 데이터 값을 해시(hash)화하여 루트값을 생성하는 단계; (c) 상기 검증 함수를 블록체인의 프로그래밍 언어로 작성하여, 재작성된 상기 검증 함수 및 상기 루트값을 블록체인에 업로드하는 단계; (d) 오프-체인 상에서 상기 검증 함수 내의 복수의 상기 함수 중 적어도 어느 하나에 대한 연산이 수행되는 단계; (e) 상기 (d) 단계에서의 연산 수행의 결과로 proof를 생성하는 단계; 및 (f) 블록체인상에서 proof를 검증하는 단계를 포함하는 것을 특징으로 한다.In order to achieve the above object, the present invention provides a block chain-based zero-knowledge verification method performed by a computer device, (a) a plurality of functions that perform detailed operations in an off-chain contract environment generating , and combining a plurality of the functions to generate a single verification function; (b) generating a root value by hashing a plurality of data values on an off-chain; (c) writing the verification function in a programming language of the block chain, and uploading the rewritten verification function and the root value to the block chain; (d) performing an operation on at least one of a plurality of the functions in the verification function on off-chain; (e) generating proof as a result of the operation performed in step (d); and (f) verifying the proof on the blockchain.

바람직하게, 상기 (b) 단계의 루트값은, (b-1) 복수의 데이터 값에 대해 각각 해시(hash)화하여 복수의 제1 해시값을 생성하는 단계; (b-2) 복수의 상기 제1 해시값 중 인접한 두 개의 노드를 하나의 쌍으로 묶어 해시화하여 제2 해시값으로 변환하는 단계; 및 (b-3) 두 개의 제n 해시값이 남을 때까지 상기 (b-2) 단계를 반복하며, 두 개의 상기 제n 해시값을 해시화하여 생성될 수 있다.Preferably, the root value of step (b) may include: (b-1) generating a plurality of first hash values by hashing each of a plurality of data values; (b-2) converting two adjacent nodes of the plurality of first hash values into a pair and hashing them into a second hash value; and (b-3) repeating step (b-2) until two n-th hash values remain, and may be generated by hashing the two n-th hash values.

바람직하게, 상기 데이터값 중 적어도 어느 하나가 변경되는 경우, (g) 오프-체인 상에서, 변경된 상기 데이터 값이 대해 상기 검증 함수 내의 복수의 상기 함수 중 적어도 어느 하나에 대한 연산이 수행되고, 연산 결과에 대한 proof를 생성하는 단계; (h) 변경된 상기 데이터 값을 기반으로 변경된 수정 루트값을 생성하는 단계; 및 (i) 블록체인에서 상기 (g) 단계의 proof를 검증하고, 검증 결과가 참일 경우 블록체인 내에 저장된 기존의 상기 루트값을 상기 수정 루트값으로 변경하는 단계를 더 포함하여, 변경된 데이터를 노출하지 않고 검증을 수행할 수 있다.Preferably, when at least one of the data values is changed, (g) off-chain, an operation is performed on at least one of a plurality of the functions in the verification function for the changed data value, and the operation result generating proof for; (h) generating a modified root value based on the changed data value; and (i) verifying the proof of step (g) in the block chain and, if the verification result is true, changing the existing root value stored in the block chain to the modified root value, exposing the changed data Validation can be performed without

본 발명에 따르면, 복수의 데이터 값을 해시화하여 최종적인 루트값을 생성하고, 루트값만을 블록체인에 업로드시킴으로써, 데이터의 구체적인 값을 노출시키지 않을 수 있다. 특히, 특정 데이터 값이 변경되는 경우에도 블록체인에는 최종적인 루트값만 변경되어 저장되므로 어떤 데이터 값이 변경된 것인지 확인 불가능하여 사용자 프라이버시가 보호될 수 있다.According to the present invention, by hashing a plurality of data values to generate a final root value, and uploading only the root value to the block chain, it is possible not to expose specific values of data. In particular, even when a specific data value is changed, only the final root value is changed and stored in the block chain, so it is impossible to check which data value has been changed, so user privacy can be protected.

본 발명에 따르면, 블록체인에는 복수의 연산 함수가 결합된 단일한 검증 함수만 저장되어 있으므로, 검증에 있어서도 어떠한 함수에서 연산 수행되었는지 드러나지 않으므로 사용자 프라이버시가 보호될 수 있는 장점을 갖는다.According to the present invention, since only a single verification function in which a plurality of operation functions are combined is stored in the block chain, it is not revealed in which function the operation is performed in verification, so user privacy can be protected.

또한, 본 발명에 따르면 오프-체인에서 복수 회의 연산이 수행된 경우에도 결과적으로 생성되는 proof는 연산 수행횟수에 비례하지 않고 일정한 크기로 생성되므로, 블록체인에서 검증될 때에도 동일한 검증 비용이 요구된다. 따라서, 본 발명은 연산되는 횟수에 제한되지 않으므로 확장성이 크다는 장점을 갖는다. In addition, according to the present invention, even when multiple calculations are performed off-chain, the resulting proof is generated with a constant size, not proportional to the number of calculations performed, so the same verification cost is required even when verified in the block chain. Accordingly, the present invention is not limited to the number of calculations, and thus has the advantage of high scalability.

도 1은 본 발명의 실시예로서 오프-체인에서 생성된 proof가 블록체인 내에서 검증되는 과정을 나타낸다.
도 2는 본 발명의 실시예에 따른 복수의 함수를 결합하여 단일한 검증 함수가 생성되는 과정을 나타낸다.
도 3은 발명의 실시예에 따른 복수의 데이터 값으로부터 루트값이 생성되는 과정을 나타낸다.
도 4는 본 발명의 실시예에 따른 프라이버시 보호가 가능한 블록체인 기반의 영지식 검증 방법의 순서도를 나타낸다.
도 5는 본 발명의 실시예로서, 오프-체인에서 데이터 값이 변경된 경우 블록체인 내에서 검증이 수행되어 루트값이 변경되는 과정을 나타낸다.
도 6은 발명의 실시예로서, 데이터 값이 변경된 경우 검증이 수행되는 과정을 나타낸 순서도이다.
1 shows a process in which a proof generated off-chain is verified in a block chain as an embodiment of the present invention.
2 illustrates a process in which a single verification function is generated by combining a plurality of functions according to an embodiment of the present invention.
3 illustrates a process of generating a root value from a plurality of data values according to an embodiment of the present invention.
4 is a flowchart of a blockchain-based zero-knowledge verification method capable of protecting privacy according to an embodiment of the present invention.
5 illustrates a process in which the root value is changed by performing verification in the block chain when the data value is changed in the off-chain as an embodiment of the present invention.
6 is a flowchart illustrating a process in which verification is performed when a data value is changed as an embodiment of the present invention.

이하, 첨부된 도면들에 기재된 내용들을 참조하여 본 발명을 상세히 설명한다. 다만, 본 발명이 예시적 실시 예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일 참조부호는 실질적으로 동일한 기능을 수행하는 부재를 나타낸다.Hereinafter, the present invention will be described in detail with reference to the contents described in the accompanying drawings. However, the present invention is not limited or limited by the exemplary embodiments. The same reference numerals in each drawing indicate members that perform substantially the same functions.

본 발명의 목적 및 효과는 하기의 설명에 의해서 자연스럽게 이해되거나 보다 분명해질 수 있으며, 하기의 기재만으로 본 발명의 목적 및 효과가 제한되는 것은 아니다. 또한, 본 발명을 설명함에 있어서 본 발명과 관련된 공지 기술에 대한 구체적인 설명이, 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다.Objects and effects of the present invention can be naturally understood or made clearer by the following description, and the objects and effects of the present invention are not limited only by the following description. In addition, in the description of the present invention, if it is determined that the detailed description of the known technology related to the present invention may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted.

도 1은 본 발명의 실시예로서 오프-체인(Off-Chain)에서 생성된 proof가 블록체인 내에서 검증되는 과정을 나타낸다. 도 2는 본 발명의 실시예에 따른 복수의 함수(110, 130)를 결합하여 단일한 검증 함수(10)가 생성되는 과정을 나타낸다.1 shows a process in which a proof generated in an off-chain is verified in a block chain as an embodiment of the present invention. 2 shows a process in which a single verification function 10 is generated by combining a plurality of functions 110 and 130 according to an embodiment of the present invention.

본 발명의 검증 과정은 블록체인과 블록체인 시스템이 아닌 그 외부에서 트랙잭션이 발생하는 오프-체인을 통해 수행될 수 있다. 본 발명은 오프-체인을 이용함으로써 블록체인만으로는 해결하지 못했던 확장성 문제를 해결할 수 있다. 블록체인을 구성하는 각각의 블록은 그 사이즈가 제한적이며, statement 또는 연산 수행횟수에 따라 검증 비용이 증가하므로 확장성에 한계를 가진다. 그러나, 본 발명은 오프-체인에서 연산 수행 함수(110, 130)에서의 수행이 이루어져 오프-체인에서 proof를 생성하고, 블록체인 내에서는 proof를 검증하도록 한다. 따라서, 본 발명은 statement 또는 연산 수행 횟수에 관계없이 일정한 검증 비용을 요구하여 확장성이 있다.The verification process of the present invention can be performed through off-chain where transactions occur outside of the block chain and the block chain system. The present invention can solve the scalability problem that could not be solved with blockchain alone by using off-chain. Each block constituting the block chain has a limited size, and the verification cost increases according to the number of statements or operations performed, so there is a limit to scalability. However, in the present invention, the operation is performed in the off-chain operation functions 110 and 130 to generate the proof in the off-chain and verify the proof in the block chain. Accordingly, the present invention is scalable by requiring a constant verification cost regardless of the number of times a statement or operation is performed.

본 발명은 (a)단계로서, 오프-체인(Off-Chain) 상의 컨트랙트 환경에서 세부 연산을 수행하는 복수의 함수를 생성하고, 복수의 함수(110, 130)들을 결합하여 단일한 검증 함수(10)를 생성할 수 있다(S10). The present invention is a step (a), generating a plurality of functions that perform detailed operations in an off-chain contract environment, and combining the plurality of functions 110 and 130 to create a single verification function 10 ) can be generated (S10).

복수의 함수(110, 130)는 검증하고자 하는 대상에 대한 검증 기준을 포함할 수 있다. 예를 들어, 함수(110, 130)는 특정 나이(19세 이상)를 기준으로 한 성인 인증일 수 있다. 사용자가 성인 인증을 위해 나이를 기준으로 하는 함수(110, 130) 수행을 요청하는 경우, 사용자의 나이를 입력받아 연산을 수행할 수 있다. 함수(110, 130)의 종류 또는 개수는 본 발명에서 제한하지 않는다. 복수의 개별 함수(110, 130)는 결합되어 단일한 검증 함수(10)가 생성될 수 있다. 이때 ‘함수(110, 130)가 결합’된다는 의미는, 검증 함수(10)는 복수의 함수(110, 130) 중 어느 함수(110, 130)에서 연산이 수행되는지 노출되지 않도록 하는 방법을 포함할 수 있다. 즉, 검증 함수(10) 내에서 함수(110, 130)가 결합되는 방법에 제한이 있는 것은 아니며, 복수의 함수(110, 130)를 포함한다는 의미로 이해될 수 있다. The plurality of functions 110 and 130 may include verification criteria for an object to be verified. For example, the functions 110 and 130 may be adult authentication based on a specific age (19 years or older). When the user requests to perform the functions 110 and 130 based on the age for adult authentication, an operation may be performed by inputting the age of the user. The type or number of functions 110 and 130 is not limited in the present invention. A plurality of individual functions 110 , 130 may be combined to generate a single verification function 10 . At this time, the meaning that the 'functions 110 and 130 are combined' means that the verification function 10 includes a method of not exposing which function (110, 130) of the plurality of functions (110, 130) the operation is performed in. can That is, there is no limitation in the method of combining the functions 110 and 130 in the verification function 10 , and it may be understood that the method includes a plurality of functions 110 and 130 .

본 발명의 실시예에서 검증 함수(10)는 Mixing contract에서 검증 함수(10)는 Mixing contract 환경에서 생성될 수 있다. 도 1을 참고하면, 연산을 수행하는 복수의 함수(110, 130)들은 Mixing contract의 DSL(Domain Specific Language)에 각각 존재할 수 있다. Mixing contract의 DSL을 이용해 Mixing contract 코드가 작성될 수 있다. Mixing contract가 작성되면 Mixing contract는 블록체인에서 영지식 증명을 검증하기 위한 언어로 재작성될 수 있다. 블록체인의 프로그래밍 언어로 재작성된 검증 함수(10)는 (c)단계와 같이 블록체인에 업로드될 수 있다(S130).In an embodiment of the present invention, the verification function 10 may be generated in the mixing contract environment, and the verification function 10 may be generated in the mixing contract environment. Referring to FIG. 1 , a plurality of functions 110 and 130 that perform an operation may each exist in a DSL (Domain Specific Language) of a mixing contract. Mixing contract code can be written using DSL of Mixing contract. Once the mixing contract is written, the mixing contract can be rewritten in a language to verify zero-knowledge proofs on the blockchain. The verification function 10 rewritten in the programming language of the block chain may be uploaded to the block chain as in step (c) (S130).

본 발명의 일실시예로서 Mixing contract는 이더리움에서 사용되는 언어인 Solidity에 따라 재작성되어 Solidity 코드로 생성됨으로써, 블록체인에서 영지식 증명을 검증하기 위해 배포될 Solidity Contract가 생성될 수 있다. 따라서, 복수의 함수(110, 130)들은 Mixing contract의 DSL에 각각 존재하지만, 재작성된 스마트 컨트랙트에서는 함수(110, 130)를 구분할 수 있는 private 값을 통해 연산을 구분하는 하나의 검증 함수(10)만이 생성될 수 있다. 이를 통해 복수의 함수(110, 130)에 대한 정보는 Mixing contract DSL에서 구분하고 입력을 달리할 수 있지만, 전체 노드들에게는 Solidity Contract에서 하나의 검증 함수(10)로 인식될 수 있다. 따라서, 검증 함수(10) 내에서 어느 함수(110, 130)의 연산이 수행되는지 노출되지 않는다.As an embodiment of the present invention, the Mixing contract is rewritten according to Solidity, a language used in Ethereum, and generated as a Solidity code, so that a Solidity Contract to be distributed to verify zero-knowledge proof in the block chain can be created. Therefore, a plurality of functions (110, 130) exist in the DSL of the mixing contract, respectively, but in the rewritten smart contract, one verification function (10) that distinguishes the operation through a private value that can distinguish the functions (110, 130) only can be created. Through this, information on the plurality of functions 110 and 130 can be distinguished and inputted differently in the mixing contract DSL, but can be recognized as one verification function 10 in the solidity contract by all nodes. Therefore, in the verification function 10 , the operation of which functions 110 and 130 is performed is not exposed.

Mixing contract는 오프-체인 상에서 proof를 생성할 수 있다. 검증 함수(10) 내의 복수의 함수(110, 130) 중 적어도 어느 하나에 대한 연산이 수행될 수 있고, 연산 수행의 결과로 proof가 생성될 수 있다. 블록체인에서는 proof에 대한 검증을 수행할 수 있다. proof에 대한 검증이 참인 경우, 외부에서 파악할 수 없는 복수의 함수(110, 130) 중 적어도 어느 하나에 대한 연에 대한 연산이 참임을 증명할 수 있다. 반면, proof에 대한 검증이 거짓인 경우에는 수행된 함수(110, 130)에 대한 연산이 거짓인 것으로 증명할 수 있다. Mixing contracts can generate proofs off-chain. An operation for at least one of the plurality of functions 110 and 130 in the verification function 10 may be performed, and a proof may be generated as a result of the operation. In blockchain, verification of proofs can be performed. When the verification of proof is true, it is possible to prove that the operation on at least one of the plurality of functions 110 and 130 that cannot be grasped from the outside is true. On the other hand, when the verification of the proof is false, it can be proved that the operation on the performed functions 110 and 130 is false.

한편, 블록체인의 컨트랙트에 업로드 및 저장되는 값은 복수의 raw 데이터가 아니라 루트값일 수 있다. 도 3은 발명의 실시예에 따른 (b)단계에서 복수의 데이터 값으로부터 루트값이 생성되는 과정을 나타낸다(S110). 데이터는 오프-체인 상에서 복수 회 해시(hash)화될 수 있다. 해시는 단방향 암호화 기법으로, 해시 알고리즘을 통해 raw 데이터가 고정된 길이의 암호화된 문자열로 바뀔 수 있다. 특히 본 발명에서는 복수 회 해시가 수행되어, 단일 노드의 단일 해시값인 루트값을 생성할 수 있다. On the other hand, the value uploaded and stored in the contract of the block chain may not be a plurality of raw data but a root value. 3 shows a process of generating a root value from a plurality of data values in step (b) according to an embodiment of the present invention (S110). Data may be hashed multiple times off-chain. Hash is a one-way encryption technique, in which raw data can be turned into an encrypted string of a fixed length through a hash algorithm. In particular, in the present invention, multiple hashes are performed to generate a root value that is a single hash value of a single node.

보다 상세하게, 루트값이 생성되는 과정은 다음과 같다. n개의 데이터에 대해 각 데이터를 해시화하여 n개의 제1 해시값을 생성할 수 있다. In more detail, the process of generating the root value is as follows. For n pieces of data, each data may be hashed to generate n first hash values.

n이 2 이상의 짝수인 경우, n개의 제1 해시값 중 인접한 두 개의 노드를 하나의 쌍으로 묶어 해시화하여 n/2개의 제2 해시값으로 변환할 수 있다. n이 3 이상의 홀수인 경우에는 도 3과 같이 나머지 1개의 데이터는 제1 해시값인 상태로 유지한다. 인접한 두 개의 노드를 하나의 쌍으로 묶어 해시화하는 과정을 두 개의 제n 해시값이 남을 때까지 반복한다. 두 개의 제n 해시값을 해시화하여 최종적으로 하나의 루트값을 생성한다. n이 3 이상의 홀수인 경우에는 나머지 하나의 제1 해시값과 하나의 제n 해시값을 해시화여 루트값을 생성할 수 있다. 다만, 도 3은 데이터에 대한 해시화 과정을 통해 루트값을 생성하는 일실시예로서, n이 3 이상의 홀수인 경우 나머지 1개의 데이터에 대한 해시화 순서가 이에 제한되는 것은 아니다.When n is an even number of 2 or more, two adjacent nodes among n first hash values may be combined into a pair and hashed to be converted into n/2 second hash values. When n is an odd number of 3 or more, the remaining one piece of data is maintained as the first hash value as shown in FIG. 3 . The process of hashing two adjacent nodes as a pair is repeated until two nth hash values remain. Two n-th hash values are hashed to finally generate one root value. When n is an odd number of 3 or more, a root value may be generated by hashing the remaining one first hash value and one n-th hash value. However, FIG. 3 illustrates an embodiment of generating a root value through a hashing process for data, and when n is an odd number of 3 or more, the hashing order of the remaining one data is not limited thereto.

도 4는 본 발명의 실시예에 따른 프라이버시 보호가 가능한 블록체인 기반의 영지식 검증 방법의 순서도를 나타낸다.4 is a flowchart of a blockchain-based zero-knowledge verification method capable of protecting privacy according to an embodiment of the present invention.

본 발명의 블록체인 기반의 영지식 검증 방법은 컴퓨터 장치에 의해 수행되며, 오프-체인(Off-Chain) 상의 컨트랙트 환경에서 세부 연산을 수행하는 복수의 함수를 생성하고, 복수의 함수들을 결합하여 단일한 검증 함수를 생성하는 (a)단계(S100), 오프-체인 상에서 복수의 데이터 값을 해시(hash)화하여 루트값을 생성하는 (b)단계(S110), 검증 함수를 블록체인의 프로그래밍 언어로 작성하여, 재작성된 검증 함수 및 루트값을 블록체인에 업로드하는 (c)단계(S130), 오프-체인 상에서 검증 함수 내의 복수의 함수 중 적어도 어느 하나에 대한 연산이 수행되는 (d)단계(S150), (d)단계에서의 연산 수행의 결과로 proof를 생성하는 (e)단계(S170) 및 블록체인상에서 proof를 검증하는 (f)단계(S190)를 포함할 수 있다. The blockchain-based zero-knowledge verification method of the present invention is performed by a computer device, generates a plurality of functions that perform detailed calculations in an off-chain contract environment, and combines the plurality of functions into a single (a) step (S100) of generating a verification function, (b) step (S110) of generating a root value by hashing a plurality of data values on an off-chain, programming language of the block chain (c) step (S130) of writing and uploading the rewritten verification function and root value to the block chain (S130), (d) step ( S150) and (d) may include a (e) step (S170) of generating a proof as a result of the operation performed in steps (d), and a (f) step (S190) of verifying the proof on the block chain.

도 5는 본 발명의 실시예로서, 오프-체인에서 데이터 값이 변경된 경우 블록체인 내에서 검증이 수행되어 루트값이 변경되는 과정을 나타낸다. 복수의 데이터 중 적어도 어느 하나의 데이터 값이 변경되는 경우, 변경된 데이터에 대한 함수(110, 130)의 연산 수행의 결과도 이전과 달라질 수 있다. 또한, 전술한 도 3을 참고하면, 변경된 데이터 값에 대한 해시값이 변경되고, 순차적인 해시화에 의해 루트값이 수정될 수 있다. 수정 루트값에 대한 proof를 오프-체인에서 생성하면, 전술한 바와 같이 블록체인에서 proof를 검증할 수 있다. 블록체인의 검증 결과, 참인 경우 컨트랙트의 기존 루트값을 수정된 루트값으로 변경시킬 수 있다. 이때, 실질적으로 데이터에 대한 연산은 Mixing contract DSL을 통해 특정 함수(110, 130)에 대해서만 수행(로컬에서만 수행)되지만, 블록체인에서는 검증 함수(10)를 통해 proof에 대한 검증만 수행되므로, 어떤 데이터값이 변경되었는지, 어떤 함수(110, 130)가 연산되었는지 드러나지 않는다.5 illustrates a process in which the root value is changed by performing verification in the block chain when the data value is changed in the off-chain as an embodiment of the present invention. When the value of at least one of the plurality of data is changed, the result of performing the operation of the functions 110 and 130 on the changed data may also be different from the previous one. In addition, referring to FIG. 3 described above, the hash value for the changed data value may be changed, and the root value may be modified by sequential hashing. If the proof for the modified root value is generated off-chain, the proof can be verified on the blockchain as described above. If it is true as a result of blockchain verification, the existing root value of the contract can be changed to the modified root value. At this time, in reality, data operation is performed only for specific functions (110, 130) through the mixing contract DSL (locally only), but in the blockchain, only verification of proof is performed through the verification function (10). It is not revealed whether the data value has been changed or which functions 110 and 130 have been calculated.

도 6은 발명의 실시예로서, 데이터 값이 변경된 경우 검증이 수행되는 과정을 나타낸 순서도이다. 오프-체인 상에서, 변경된 데이터 값이 대해 검증 함수(10) 내의 복수의 함수(110, 130) 중 적어도 어느 하나에 대한 연산이 수행되고, 연산 결과에 대한 proof를 생성하는 (g)단계(S310), 변경된 데이터 값을 기반으로 변경된 수정 루트값을 생성하는 (h)단계(S330), 블록체인에서 (g)단계의 proof를 검증하고, 검증 결과가 참일 경우 블록체인 내에 저장된 기존의 루트값을 수정 루트값으로 변경하는 (i)단계(S350)를 통해 변경된 데이터를 노출하지 않고 검증을 수행할 수 있다. 반면, 검증 결과가 거짓일 경우 루트값을 변경하지 않고 기존의 루트값을 유지할 수 있다.6 is a flowchart illustrating a process in which verification is performed when a data value is changed as an embodiment of the present invention. Off-chain, an operation is performed on at least one of the plurality of functions 110 and 130 in the verification function 10 for the changed data value, and (g) step of generating a proof for the operation result (S310) , (h) generating a modified root value based on the changed data value (S330), verifying the proof of step (g) in the block chain, and if the verification result is true, modify the existing root value stored in the block chain The verification can be performed without exposing the changed data through the (i) step (S350) of changing to the root value. On the other hand, when the verification result is false, the existing root value may be maintained without changing the root value.

이상에서 대표적인 실시예를 통하여 본 발명을 상세하게 설명하였으나, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 상술한 실시예에 대하여 본 발명의 범주에서 벗어나지 않는 한도 내에서 다양한 변형이 가능함을 이해할 것이다. 그러므로 본 발명의 권리 범위는 설명한 실시예에 국한되어 정해져서는 안 되며, 후술하는 특허청구범위뿐만 아니라 특허청구범위와 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태에 의하여 정해져야 한다. Although the present invention has been described in detail through representative embodiments above, those of ordinary skill in the art to which the present invention pertains will understand that various modifications are possible without departing from the scope of the present invention with respect to the above-described embodiments. will be. Therefore, the scope of the present invention should not be limited to the described embodiments and should be defined by all changes or modifications derived from the claims and equivalent concepts as well as the claims to be described later.

10 : 검증 함수
110, 130: 연산 수행 함수(함수)
10 : Validation function
110, 130: operation performing function (function)

Claims (3)

컴퓨터 장치에 의해 수행되는 블록체인 기반의 영지식 검증 방법에 있어서,
(a) 오프-체인(Off-Chain) 상의 컨트랙트 환경에서 세부 연산을 수행하는 복수의 함수를 생성하고, 복수의 상기 함수들을 결합하여 단일한 검증 함수를 생성하는 단계;
(b) 오프-체인 상에서 복수의 데이터 값을 해시(hash)화하여 루트값을 생성하는 단계;
(c) 상기 검증 함수를 블록체인의 프로그래밍 언어로 작성하여, 재작성된 상기 검증 함수 및 상기 루트값을 블록체인에 업로드하는 단계;
(d) 오프-체인 상에서 상기 검증 함수 내의 복수의 상기 함수 중 적어도 어느 하나에 대한 연산이 수행되는 단계;
(e) 상기 (d) 단계에서의 연산 수행의 결과로 proof를 생성하는 단계; 및
(f) 블록체인상에서 proof를 검증하는 단계를 포함하여, 프라이버시 보호가 가능한 영지식 검증 방법.
In the blockchain-based zero-knowledge verification method performed by a computer device,
(a) generating a plurality of functions that perform detailed operations in an off-chain contract environment, and combining the plurality of functions to create a single verification function;
(b) generating a root value by hashing a plurality of data values on an off-chain;
(c) writing the verification function in a programming language of the block chain, and uploading the rewritten verification function and the root value to the block chain;
(d) performing an operation on at least one of a plurality of the functions in the verification function on off-chain;
(e) generating proof as a result of the operation performed in step (d); and
(f) A zero-knowledge verification method that can protect privacy, including verifying proof on the blockchain.
제 1 항에 있어서,
상기 (b) 단계의 루트값은,
(b-1) 복수의 데이터 값에 대해 각각 해시(hash)화하여 복수의 제1 해시값을 생성하는 단계;
(b-2) 복수의 상기 제1 해시값 중 인접한 두 개의 노드를 하나의 쌍으로 묶어 해시화하여 제2 해시값으로 변환하는 단계; 및
(b-3) 두 개의 제n 해시값이 남을 때까지 상기 (b-2) 단계를 반복하며, 두 개의 상기 제n 해시값을 해시화하여 생성되는 것을 특징으로 하는 영지식 검증 방법.
The method of claim 1,
The root value of step (b) is,
(b-1) generating a plurality of first hash values by hashing each of the plurality of data values;
(b-2) converting two adjacent nodes of the plurality of first hash values into a pair and hashing them into a second hash value; and
(b-3) repeating step (b-2) until two n-th hash values remain, and generating by hashing the two n-th hash values.
제 1 항에 있어서,
상기 데이터값 중 적어도 어느 하나가 변경되는 경우,
(g) 오프-체인 상에서, 변경된 상기 데이터 값이 대해 상기 검증 함수 내의 복수의 상기 함수 중 적어도 어느 하나에 대한 연산이 수행되고, 연산 결과에 대한 proof를 생성하는 단계;
(h) 변경된 상기 데이터 값을 기반으로 변경된 수정 루트값을 생성하는 단계; 및
(i) 블록체인에서 상기 (g) 단계의 proof를 검증하고, 검증 결과가 참일 경우 블록체인 내에 저장된 기존의 상기 루트값을 상기 수정 루트값으로 변경하는 단계를 더 포함하여,
변경된 데이터를 노출하지 않고 검증을 수행할 수 있는 것을 특징으로 하는 영지식 검증 방법.
The method of claim 1,
When at least one of the data values is changed,
(g) performing an operation on at least one of the plurality of functions in the verification function on the changed data value on the off-chain, and generating a proof for the operation result;
(h) generating a modified root value based on the changed data value; and
(i) verifying the proof of step (g) in the block chain, and if the verification result is true, further comprising the step of changing the existing root value stored in the block chain to the modified root value,
Zero-knowledge verification method, characterized in that verification can be performed without exposing changed data.
KR1020220003975A 2021-01-11 2022-01-11 A blockchain-based zero-knowledge verification method that can protect privacy KR20220101576A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20210003532 2021-01-11
KR1020210003532 2021-01-11

Publications (1)

Publication Number Publication Date
KR20220101576A true KR20220101576A (en) 2022-07-19

Family

ID=82607301

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220003975A KR20220101576A (en) 2021-01-11 2022-01-11 A blockchain-based zero-knowledge verification method that can protect privacy

Country Status (1)

Country Link
KR (1) KR20220101576A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117421605A (en) * 2023-10-27 2024-01-19 绍兴清研微科技有限公司 Gait recognition method and system based on block chain technology

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102289414B1 (en) 2018-07-03 2021-08-12 주식회사 케이티 Method for protecting personal information in block chain environment and apparatus therefor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102289414B1 (en) 2018-07-03 2021-08-12 주식회사 케이티 Method for protecting personal information in block chain environment and apparatus therefor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117421605A (en) * 2023-10-27 2024-01-19 绍兴清研微科技有限公司 Gait recognition method and system based on block chain technology
CN117421605B (en) * 2023-10-27 2024-04-30 绍兴清研微科技有限公司 Gait recognition method and system based on block chain technology

Similar Documents

Publication Publication Date Title
JP6955026B2 (en) Systems and methods for parallel processing blockchain transactions
US11157833B2 (en) Learning service blockchain
US11341484B2 (en) Implementing logic gate functionality using a blockchain
US20190149337A1 (en) Implementing logic gate functionality using a blockchain
CN110263544B (en) Receipt storage method and node combining transaction type and judgment condition
CN110032885B (en) Method, node and storage medium for implementing privacy protection in block chain
BR112019016290A2 (en) computer implemented method, computer readable non-transient storage medium and system
CN110245947B (en) Receipt storage method and node combining conditional restrictions of transaction and user types
CN111901402A (en) Method, node and storage medium for implementing privacy protection in block chain
CN110245503B (en) Receipt storage method and node combining code marking and judging conditions
CN110264198B (en) Conditional receipt storage method and node combining code labeling and transaction type
TW202034251A (en) Methods and devices for testing signature verification for blockchain system
CN110245942B (en) Receipt storage method and node combining user type and judgment condition
CN110264197B (en) Receipt storage method and node combining event function type and judgment condition
JP5489587B2 (en) Method and system for managing password hierarchies
US10885516B2 (en) Secure validation using hardware security modules
CN111033489B (en) Method and apparatus for data traversal
CN111651787A (en) Method, node and storage medium for implementing privacy protection in block chain
CN113014563A (en) Method and system for guaranteeing integrity of searchable public key encryption retrieval
CN110245943B (en) Receipt storage method and node based on judgment condition
CN112765652B (en) Method, device and equipment for determining leaf node classification weight
CN110033265B (en) Method, node and storage medium for implementing privacy protection in block chain
CN111612462A (en) Method, node and storage medium for implementing privacy protection in block chain
CN111737279A (en) Service processing method, device, equipment and storage medium based on block chain
JP2015526757A (en) Generation and verification of alternative data with a specific format

Legal Events

Date Code Title Description
E902 Notification of reason for refusal