KR102398543B1 - Verifiable block chain virtual machine with zero knowledge algorithm - Google Patents

Verifiable block chain virtual machine with zero knowledge algorithm Download PDF

Info

Publication number
KR102398543B1
KR102398543B1 KR1020210153338A KR20210153338A KR102398543B1 KR 102398543 B1 KR102398543 B1 KR 102398543B1 KR 1020210153338 A KR1020210153338 A KR 1020210153338A KR 20210153338 A KR20210153338 A KR 20210153338A KR 102398543 B1 KR102398543 B1 KR 102398543B1
Authority
KR
South Korea
Prior art keywords
verification
transaction
virtual machine
zero
key
Prior art date
Application number
KR1020210153338A
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 주식회사 온더
Priority to KR1020210153338A priority Critical patent/KR102398543B1/en
Application granted granted Critical
Publication of KR102398543B1 publication Critical patent/KR102398543B1/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/26Testing cryptographic entity, e.g. testing integrity of encryption key or encryption algorithm

Abstract

The present invention relates to a verification system and, more specifically, to a zero-knowledge proof-based blockchain virtual machine verification system which defines and verifies requirements necessary for developing a zero-knowledge proof-based blockchain virtual machine. According to an embodiment of the present invention, disclosed is a virtual machine which completes general verification procedures at high speed by replacing verification for all transactions in a blockchain network through zero-knowledge proof, wherein the verification can be performed through a plurality of verification means for the virtual machine.

Description

영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신{VERIFIABLE BLOCK CHAIN VIRTUAL MACHINE WITH ZERO KNOWLEDGE ALGORITHM}A verifiable blockchain virtual machine with zero-knowledge proof algorithm applied {VERIFIABLE BLOCK CHAIN VIRTUAL MACHINE WITH ZERO KNOWLEDGE ALGORITHM}

본 발명은 블록체인 가상머신에 관한 것으로, 특히 블록체인 참여자가 블록의 내용을 알지 못하더라도 블록의 내용이 위, 변조되지 않았음을 빠르게 검증할 수 있는, 영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신에 관한 것이다. The present invention relates to a blockchain virtual machine, and in particular, a verifiable blockchain to which a zero-knowledge proof algorithm is applied that can quickly verify that the contents of the block have not been forged or altered even if the block chain participants do not know the contents of the block. It's about virtual machines.

블록체인은 P2P(Peer to Peer) 네트워크에서 신뢰할 수 있는 제3자(Trusted Third Parity)의 개입 없이 거래 내역들의 무결성을 확보하고 참여자들이 내역들을 공유하는 분산형 디지털 장부를 의미한다.Blockchain refers to a distributed digital ledger that secures the integrity of transaction details without the intervention of a trusted third party in a peer-to-peer (P2P) network and where participants share the details.

블록체인을 응용한 대표적인 사례는 비트코인(Bitcoin) 및 이더리움(Ethereum) 등과 같은 암호화폐이다. 이더리움은 이더리움 가상머신(Ethereum Virtual Machine; EVM)을 도입한 후, EVM을 통해 사용자들은 사전 정의된 일련의 작업을 수행하기보다 사용자가 원하는 방식에 맞게 직접 프로그래밍을 할 수 있다.Representative examples of blockchain applications are cryptocurrencies such as Bitcoin and Ethereum. After Ethereum introduced the Ethereum Virtual Machine (EVM), the EVM allows users to program directly according to the way they want, rather than performing a set of predefined tasks.

이러한 EVM은 공지의 JVM(Java Virtual Machine)과 유사한 계산 및 스토리지의 추상화를 제공한다. JVM의 경우 기본 호스트 OS 또는 하드웨어에 구속받지 않고 런타임 환경을 제공하도록 설계됨에 따라 다양한 시스템에서 호환이 가능하도록 하는 것을 목적으로 하며, JAVA, Scala 같은 고급 프로그래밍 언어를 가상 머신의 바이트코드 명령어 집합으로 컴파일할 수 있다. EVM 또한 솔리디티, Serpent) 등과 같은 고급 스마트 컨트랙트 프로그램이 언어가 컴파일되어 생성된 자체 바이트코드 명령어 집합을 질행할 수 있다.This EVM provides an abstraction of computation and storage similar to the well-known Java Virtual Machine (JVM). As the JVM is designed to provide a runtime environment without being bound by the underlying host OS or hardware, it aims to make it compatible with various systems, and compiles high-level programming languages such as JAVA and Scala into the bytecode instruction set of the virtual machine. can do. EVM also allows advanced smart contract programs such as Solidity, Serpent, etc. to execute their own set of bytecode instructions generated by compiling the language.

그러나, EVM은 JVM(Java Virtual Machine)과 같은 기존 가상머신에 비해 효율이 매우 떨어지고, 또한 복잡한 어플리케이션 환경을 지원하기 어렵다는 문제점이 있다.However, the EVM has a problem in that efficiency is very low compared to a conventional virtual machine such as a Java Virtual Machine (JVM), and it is difficult to support a complex application environment.

지난 10년간 수많은 블록체인 구현체들이 등장했지만, 트랜잭션을 누적시켜 저장한다는 측면에서 별다른 혁신이 일어나지 않았고, 이럴 경우 모든 트랜잭션 내용을 검증해야 함에 따라 확장성에 한계가 존재한다.Numerous blockchain implementations have appeared in the past 10 years, but there has been no innovation in terms of accumulating and storing transactions.

이에, 종래 비트코인과 같이 UXTO로 만들어진 단순한 형태의 블록체인에서 일부 트랜잭션을 처리하는 경우에만 제한적으로 적용되는 영지식 증명(Zero Knowledge Proof)을 이더리움과 같은 상태 트리(State Tree)를 다루는 복잡한 형태의 블록체인에도 적용하고자 하는 연구가 진행 에 있다.Accordingly, Zero Knowledge Proof, which is limitedly applied only to processing some transactions in a simple type of block chain made of UXTO like conventional Bitcoin, is a complex form of dealing with a state tree such as Ethereum. Research to be applied to the blockchain of

전술한 영지식 증명(Zero Knowledge Proof)은 암호학에서 누군가가 상대방에게 어떤 상태가 참이라는 것을 증명할 때, 그 문장의 참 거짓 여부를 제외한 어떤 것도 노출되지 않도록 하는 방법을 가리킨다. 영지식 증명을 활용한 프로토콜의 가장 큰 특징은 정보를 제3자에게 공개하지 않고 정보의 '유효성'을 증명할 수 있다는 장점이 있다.The aforementioned Zero Knowledge Proof refers to a method in cryptography that prevents exposure of anything except whether the statement is true or false when someone proves that a certain state is true. The biggest feature of the protocol using zero-knowledge proof is that it can prove the 'validity' of information without disclosing it to a third party.

이러한 영지식 증명을 블록체인 가상머신에 적용하기 위해서는, 대표적인 블록체인 관련 가상머신으로서 이더리움 가상머신의 동작에 대한 이해가 요구된다.In order to apply this zero-knowledge proof to the blockchain virtual machine, it is required to understand the operation of the Ethereum virtual machine as a representative blockchain-related virtual machine.

이더리움의 스마트 컨트랙트 언어인 솔리디티(Solidity)는 사람이 이해하기 위해 만들어진 언어임에 따라 가상머신에서 동작하기 위해서는 가상머신이 이해할 수 있는 기계어로의 변경이 필요하다. Ethereum's smart contract language, Solidity, is a language created to be understood by humans. Therefore, in order to operate in a virtual machine, it is necessary to change it to a machine language that the virtual machine can understand.

전술한 솔리디티로 작성된 코드는 컴파일러(인터프리터)에 의해 이더리움 바이트코드로 변경되며, 이 바이트코드를 이더리움의 가상머신인 'EVM'이 실행하게 된다.The code written in the above-mentioned Solidity is changed to Ethereum bytecode by the compiler (interpreter), and the bytecode is executed by 'EVM', the virtual machine of Ethereum.

그리고, 특정 바이트코드가 실행되면 이더리움 네트워크의 모든 노드들은 동일한 바이트코드를 실행하여 해당 트랜잭션을 검증하게 된다. 이때, 가상머신에 일반 연산 검증이 가능한 영지식 증명이 기술이 적용되어 있다면 가상머신을 트랜잭션을 실행하지 않아도 영지식 증거에 대한 검증을 수행함으로써 해당 트랜잭션이 올바른 트랜잭션인지 판단할 수 있다.And, when a specific bytecode is executed, all nodes in the Ethereum network execute the same bytecode to verify the transaction. At this time, if the zero-knowledge proof technology that can verify general operation is applied to the virtual machine, it can be determined whether the transaction is a valid transaction by performing verification of the zero-knowledge proof without executing the transaction in the virtual machine.

공개특허공보 제10-2021-0122211호(공개일자: 2021.10.08.)Laid-open Patent Publication No. 10-2021-0122211 (published date of publication: 2021.10.08.)

본 발명은 검증 시스템에 관한 것으로, 특히 이더리움 가상머신과 유사한 아키텍처를 가지며 영지식 증명 기술이 적용되고, 성능을 검증할 수 있는 블록체인 가상머신을 제공하는 데 과제가 있다.The present invention relates to a verification system, and in particular, has a similar architecture to the Ethereum virtual machine, applies zero-knowledge proof technology, and has a problem in providing a blockchain virtual machine capable of verifying performance.

전술한 과제를 해결하기 위해, 본 발명의 실시예에 따른 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신은, 스마트 컨트랙트를 컴파일하는 인터프리터 및 영지식 증명을 위한 연산기를 포함하는 블록체인 가상머신에 있어서, 입력되는 트랜잭션을 컴파일하여 바이트코드로 변환하고, 바이트 코드에 따라 스마트 콘트랙트를 실행하는 인터프리터 및, 상기 스마트 콘트랙트의 실행시, 일반연산 검증용 서킷을 통해 생성한 증거를 이용하여 상기 트랜잭션을 검증하는 연산기를 포함하고, 상기 인터프리터는, 트랜잭션 발신자로부터 입력되는 트랜잭션을 입력받는 트랜잭션 입력부, 입력된 트랜잭션에 대한 스마트 컨트랙트를 컴파일하여 바이트코드를 출력하는 출력부, 현재 입력된 트랜잭션에 대한 정보 및 증명된 영지식 증거를 저장하는 스토리지, 컴파일된 스마트 컨트랙트에 대한 하나 이상의 바이트코드를 입력받는 데이터 입력부, 상기 바이트코드가 실행되는 과정에서 분리되는 옵코드가 순차적으로 저장되는 스택, 상기 스택에 저장된 명령어의 주소를 제공하는 프로그램 카운터 및, 트랜잭션을 실행하기 위한 로컬변수 및 솔리디티 어셈블리 코드가 저장되는 메모리를 포함할 수 있다.In order to solve the above problems, a blockchain virtual machine capable of verifying a zero-knowledge proof algorithm according to an embodiment of the present invention is a block-chain virtual machine including an interpreter for compiling a smart contract and an operator for zero-knowledge proof. In this case, the transaction is verified using an interpreter that compiles an input transaction, converts it into bytecode, and executes a smart contract according to the bytecode, and evidence generated through a circuit for general operation verification when the smart contract is executed. , wherein the interpreter includes a transaction input unit that receives a transaction input from a transaction sender, an output unit that compiles a smart contract for the input transaction and outputs bytecode, information about the currently input transaction and verified A storage for storing zero-knowledge evidence, a data input unit for receiving one or more bytecodes for a compiled smart contract, a stack for sequentially storing opcodes separated in the process of executing the bytecodes, an address of an instruction stored in the stack It may include a program counter that provides , and a memory in which local variables and solidity assembly codes for executing a transaction are stored.

상기 연산기는, 상기 바이트코드를 입력받아 연산을 수행하고, 연산에 따른 수수료를 산출 및 공제하고, 연산 성공시 잔여코드를 확인 및 잔여가스를 확인하여 스마트 컨트랙트를 실행하는 코드 실행부 및, 일반연산 검증용 서킷 생성기를 포함하는 키 생성기 및, 증명자 및 검증자를 이용하여 트랜잭션에 대한 일반 연산 검증을 수행하는 영지식 증명부를 포함할 수 있다.The calculator includes a code execution unit that receives the bytecode and performs an operation, calculates and deducts a fee according to the operation, checks the residual code and checks the residual gas when the operation is successful, and executes the smart contract; It may include a key generator including a circuit generator for verification, and a zero-knowledge proof unit that performs general operation verification on a transaction using the prover and the verifier.

상기 키 생성기는, 기준 프로그램의 크기, 명령어 및 스텝의 입력개수 및, 시간을 입력받아 일반 검증을 위한 서킷 로직을 생성하는 서킷 생성기 및, 할당된 서킷으로부터 zk-SNARK 검증을 위한 증명기 및 검증키를 생성하는 Zk-SNARK 키 생성기를 포함할 수 있다.The key generator includes a circuit generator that receives the size of a reference program, the input number of commands and steps, and time to generate circuit logic for general verification, and a verifier and verification key for zk-SNARK verification from the assigned circuit. It may include a Zk-SNARK key generator that generates

상기 증명자는, 상기 키 생성기로부터 증명키를 제공받고, zk-SNARK 알고리즘을 통해 획득되는 다항함수의 계수, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거를 생성할 수 있다.The prover may be provided with a proof key from the key generator, and may generate evidence using coefficients of polynomial functions obtained through the zk-SNARK algorithm, and information necessary for verification and proof in the general operation verification circuit.

상기 검증자는, 상기 키 생성기로부터 검증키를 제공받고, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거가 유효한지 검증을 실행할 수 있다.The verifier may receive the verification key from the key generator and verify whether the evidence is valid using information necessary for verification and verification in the general operation verification circuit.

본 발명의 실시예에 따르면, 영지식 증명을 통해 블록체인 네트워크에서 모든 트랜잭션에 대한 검증을 대체함으로써 빠른 속도로 일반 검증절차를 완료하는 가상 머신을 제공할 수 있고, 그 가상머신에 대한 검증을 수행할 수 있는 효과가 있다.According to an embodiment of the present invention, by replacing the verification of all transactions in the blockchain network through zero-knowledge proof, it is possible to provide a virtual machine that completes the general verification procedure at a high speed, and performs verification of the virtual machine. There is an effect that can be done.

도 1은 본 발명의 실시예에 따른 영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신의 전체 구조를 나타낸 도면이다.
도 2는 본 발명의 실시예에 따른 블록체인 가상머신에 적용된 영지식 증명을 위한 키 생성기를 나타낸 도면이다.
도 3은 본 발명의 실시예에 따른 블록체인 가상머신에 적용된 영지식 증명을 위한 키 생성기를 이용한 영지식 증명 로직을 나타낸 도면이다.
도 4 및 도 5는 본 발명의 실시예에 따른 영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신에 구현된 서킷 및 옵코드를 예시한 도면이다.
도 6은 본 발명의 실시예에 따른 블록체인 가상머신의 영지식 증명 알고리즘의 검증방법을 실행하는 방법을 나타낸 도면이다.
1 is a diagram showing the overall structure of a verifiable blockchain virtual machine to which a zero-knowledge proof algorithm is applied according to an embodiment of the present invention.
2 is a diagram illustrating a key generator for zero-knowledge proof applied to a blockchain virtual machine according to an embodiment of the present invention.
3 is a diagram illustrating zero-knowledge proof logic using a key generator for zero-knowledge proof applied to a blockchain virtual machine according to an embodiment of the present invention.
4 and 5 are diagrams illustrating circuits and opcodes implemented in a verifiable blockchain virtual machine to which a zero-knowledge proof algorithm is applied according to an embodiment of the present invention.
6 is a diagram illustrating a method of executing a verification method of a zero-knowledge proof algorithm of a blockchain virtual machine according to an embodiment of the present invention.

상기한 바와 같은 본 발명을 첨부된 도면들과 실시예들을 통해 상세히 설명하도록 한다. The present invention as described above will be described in detail with reference to the accompanying drawings and embodiments.

본 발명에서 사용되는 기술적 용어는 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아님을 유의해야 한다. 또한, 본 발명에서 사용되는 기술적 용어는 본 발명에서 특별히 다른 의미로 정의되지 않는 한, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 의미로 해석되어야 하며, 과도하게 포괄적인 의미로 해석되거나, 과도하게 축소된 의미로 해석되지 않아야 한다. 또한, 본 발명에서 사용되는 기술적인 용어가 본 발명의 사상을 정확하게 표현하지 못하는 잘못된 기술적 용어일 때에는, 당업자가 올바르게 이해할 수 있는 기술적 용어로 대체되어 이해되어야 할 것이다. 또한, 본 발명에서 사용되는 일반적인 용어는 사전에 정의되어 있는 바에 따라, 또는 전후 문맥상에 따라 해석되어야 하며, 과도하게 축소된 의미로 해석되지 않아야 한다.It should be noted that the technical terms used in the present invention are only used to describe specific embodiments, and are not intended to limit the present invention. In addition, the technical terms used in the present invention should be interpreted as meanings generally understood by those of ordinary skill in the art to which the present invention belongs, unless otherwise specifically defined in the present invention, and excessively comprehensive It should not be construed in the meaning of a human being or in an excessively reduced meaning. In addition, when the technical term used in the present invention is an incorrect technical term that does not accurately express the spirit of the present invention, it should be understood by being replaced with a technical term that can be correctly understood by those skilled in the art. In addition, the general terms used in the present invention should be interpreted according to the definition in the dictionary or according to the context before and after, and should not be interpreted in an excessively reduced meaning.

또한, 본 발명에서 사용되는 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한 복수의 표현을 포함한다. 본 발명에서, "구성된다" 또는 "포함한다" 등의 용어는 발명에 기재된 여러 구성 요소들, 또는 여러 단계를 반드시 모두 포함하는 것으로 해석되지 않아야 하며, 그 중 일부 구성 요소들 또는 일부 단계들은 포함되지 않을 수도 있고, 또는 추가적인 구성 요소 또는 단계들을 더 포함할 수 있는 것으로 해석되어야 한다.Also, the singular expression used in the present invention includes the plural expression unless the context clearly dictates otherwise. In the present invention, terms such as “consisting of” or “comprising” should not be construed as necessarily including all of the various components or various steps described in the invention, some of which components or some steps are included. It should be construed that it may not, or may further include additional components or steps.

또한, 본 발명에서 사용되는 제1, 제2 등과 같이 서수를 포함하는 용어는 구성 요소들을 설명하는데 사용될 수 있지만, 구성 요소들은 용어들에 의해 한정되어서는 안 된다. 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성 요소는 제2 구성 요소로 명명될 수 있고, 유사하게 제2 구성 요소도 제1 구성 요소로 명명될 수 있다.In addition, terms including ordinal numbers such as first, second, etc. used in the present invention may be used to describe the components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, a first component may be referred to as a second component, and similarly, a second component may also be referred to as a first component.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시 예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성 요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다.Hereinafter, a preferred embodiment according to the present invention will be described in detail with reference to the accompanying drawings, but the same or similar components are given the same reference numerals regardless of reference numerals, and redundant description thereof will be omitted.

또한, 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 발명의 사상을 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 발명의 사상이 제한되는 것으로 해석되어서는 아니 됨을 유의해야 한다.In addition, in the description of the present invention, if it is determined that a detailed description of a related known technology may obscure the gist of the present invention, the detailed description thereof will be omitted. In addition, it should be noted that the accompanying drawings are only for easy understanding of the spirit of the present invention, and should not be construed as limiting the spirit of the present invention by the accompanying drawings.

이하의 설명에서, 본 발명의 실시예에 따른 '영지식 증명 기반 블록체인 가상머신'을 가리키는 용어는, '검증 시스템' 또는 '시스템'으로 약식 표기될 수 있다.In the following description, a term indicating a 'zero-knowledge proof-based blockchain virtual machine' according to an embodiment of the present invention may be abbreviated as 'verification system' or 'system'.

또한, 이하의 설명에서, "영지식 증명(zero knowledge proof; ZKP)"은 암호학에서 어느 증명자가 상대방 검증자에게 어떤 명제가 참이라는 것을 증명할 때, 그 명제의 참 거짓 여부를 제외한 어떤 지식도 노출시키지 않는 상호 작용의 절차를 의미한다.In addition, in the following description, "zero knowledge proof (ZKP)" in cryptography, when a prover proves to the other party verifier that a certain proposition is true, any knowledge is exposed except whether the proposition is true or false. It means a procedure of interaction that does not let it happen.

또한, 어떠한 명제가 참이라는 것을 증명하려는 쪽을 증명자(prover)라고 하고, 증명 과정에 참여하여 증명자와 정보를 주고 받는 쪽을 검증자(verifier)라고 한다. 영지식 증명에 참여하는 당사자들이 상대방을 속이려는 목적으로 프로토콜을 임의로 변경하는 경우, 당사자들이 부정직하다 또는 정직하지 않다고 한다. 그 외의 경우에는 정직하다고 한다.Also, the party who wants to prove that a certain proposition is true is called a prover, and the party who participates in the proof process and exchanges information with the prover is called a verifier. If the parties participating in the zero-knowledge proof arbitrarily change the protocol for the purpose of deceiving the other party, the parties are said to be dishonest or dishonest. Otherwise, it is said to be honest.

이하, 도면을 참조하여 본 발명의 실시예에 따른 영지식 증명 기반 블록체인 가상머신 검증 시스템을 설명한다.Hereinafter, a zero-knowledge proof-based blockchain virtual machine verification system according to an embodiment of the present invention will be described with reference to the drawings.

이하, 도면을 참조하여 본 발명의 실시예에 따른 영지식 증명 기반 블록체인 가상머신 및 이를 검증하는 검증 시스템을 설명한다.Hereinafter, a zero-knowledge proof-based blockchain virtual machine and a verification system for verifying the same according to an embodiment of the present invention will be described with reference to the drawings.

도 1은 본 발명의 실시예에 따른 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신의 전체 구조를 나타낸 도면이다.1 is a diagram showing the overall structure of a blockchain virtual machine capable of verifying a zero-knowledge proof algorithm according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 실시예에 따른 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신(100)은, 입력되는 트랜잭션을 스마트 컨트랙트의 바이트코드로 컴파일하고, 스마트 컨트랙트를 실행하는 인터프리터(110)와, 영지식 알고리즘에 따라 바이트코드를 검증하는 연산기(120)를 포함할 수 있다.Referring to FIG. 1 , the blockchain virtual machine 100 capable of verifying the zero-knowledge proof algorithm according to the embodiment of the present invention compiles the input transaction into the bytecode of the smart contract, and an interpreter ( 110) and an operator 120 that verifies the bytecode according to a zero-knowledge algorithm.

또한, 본 발명의 실시예에 따른 영지식 증명 기반 블록체인 가상머신은 별도의 검증 시스템이 연결되어 가상머신(100)이 이더리움과 같이 스택 기반의 블록체인 가상머신으로서 요건을 만족하는 지를 검증 받을 수 있다.In addition, the zero-knowledge proof-based block chain virtual machine according to the embodiment of the present invention is connected to a separate verification system to be verified whether the virtual machine 100 satisfies the requirements as a stack-based block chain virtual machine such as Ethereum. can

전술한 가상머신 요건으로는 스택 기반이며, 영지식 증명 기술이 적용되고, CLI 조작이 가능하고, 데이터를 데이터 베이스를 통해 저장, 관리가 가능한지 여부 가 있다.The above-mentioned virtual machine requirements include whether it is stack-based, zero-knowledge proof technology is applied, CLI operation is possible, and data can be stored and managed through a database.

특히, 본 발명의 실시예에 따른 블록체인 가상머신(100)은 실행 순서가 외부에서 구성됨에 따라 스케줄링 기능을 제공하지 않으며, 블록체인(10)으로부터 코드해시, 논스 및 스토리지 루트 해시 등을 제공받아 이더리움과 같이 월드 컴퓨터로서 동작할 수 있다.In particular, the blockchain virtual machine 100 according to the embodiment of the present invention does not provide a scheduling function as the execution order is externally configured, and provides a code hash, a nonce, and a storage root hash from the blockchain 10 It can operate as a world computer like Ethereum.

그리고, 블록체인 가상머신(100) 상에서 프로그램 코드가 실행됨에 따라 사자의 컴퓨터에서 스마트 계약 코드가 실행되고, 그 결과는 다시 블록체인(10)에 저장 및 공유됨에 따라, 다른 사용자기 이전의 작업을 계속 이어서 수행하게 된다. And, as the program code is executed on the blockchain virtual machine 100, the smart contract code is executed on the lion's computer, and the result is stored and shared in the blockchain 10 again, so that other users can will continue to do so.

이를 위해, 블록체인 가상머신(100)은 스마트 컨트랙트에 대한 프로그램 코드를 실행 및 연산을 수행하기 위한 인터프리터(110) 및 연산기(120)를 포함할 수 있다.To this end, the blockchain virtual machine 100 may include an interpreter 110 and an operator 120 for executing program codes for smart contracts and performing calculations.

상세하게는, 인터프리터(110)는 트랜잭션 발신자로부터 입력되는 트랜잭션을 입력받는 트랜잭션 입력부(111), 입력된 트랜잭션에 대한 스마트 컨트랙트를 컴파일하여 바이트코드를 출력하는 바이트코드 출력부(112), 현재 입력된 트랜잭션에 대한 정보 및 증명된 영지식 증거를 저장하는 스토리지(113), 컴파일된 스마트 컨트랙트에 대한 하나 이상의 바이트코드를 입력받는 데이터 입력부(114), 바이트코드가 실행되는 과정에서 분리되는 데이터가 순차적으로 저장되는 스택(115), 스택에 저장된 명령어의 주소를 제공하는 프로그램 카운터(116) 및, 연산기(120)를 통해 연산된 실행결과를 저장하는 메모리(117)를 포함할 수 있다.In detail, the interpreter 110 includes a transaction input unit 111 that receives a transaction input from a transaction sender, a bytecode output unit 112 that compiles a smart contract for the input transaction and outputs a bytecode, and a currently inputted transaction. The storage 113 for storing transaction information and proven zero-knowledge evidence, the data input unit 114 for receiving one or more bytecodes for the compiled smart contract, and the data separated during the bytecode execution are sequentially The stack 115 may include a stored stack 115 , a program counter 116 providing an address of an instruction stored in the stack, and a memory 117 storing an execution result calculated through the operator 120 .

트랜잭션 입력부(111)는 가상머신(100)에서 실행할 트랜잭션을 입력 받을 수 있다. 트랜잭션 발신자는 논스(nonce), 가스한도(STARTGAS), 가스가격, 목적지(MSG.SENDER), 값(MSG.VALUE), 발신자의 서명 및 데이터 바이트코드 등을 트랜잭션 입력부(111)에 입력할 수 있다. 트랜잭션 입력부(111)는 전술한 데이터들을 이용하여 해당 트랜잭션이 올바른 형식인지 확인할 수 있고, 그렇지 않은 경우 오류를 반환할 수 있다.The transaction input unit 111 may receive a transaction to be executed in the virtual machine 100 . The transaction sender may input nonce, gas limit (STARTGAS), gas price, destination (MSG.SENDER), value (MSG.VALUE), sender's signature and data bytecode, etc. into the transaction input unit 111 . The transaction input unit 111 may check whether the corresponding transaction is in the correct format using the above-described data, and if not, may return an error.

바이트코드 출력부(112)는 트랜잭션에 의해 실행되는 스마트 컨트랙트의 코드를 컴파일하여 바이트코드를 출력할 수 있다. 이러한 바이트코드는 영지식 증명 알고리즘이 적용된 연산기(120)에 제공되어 검증 과정을 거치게 되며, 이에 따라 종래 트랜잭션이 모든 블록체인 네트워크에 배포되어 검증 받는 과정이 생략되게 된다.The bytecode output unit 112 may compile the code of the smart contract executed by the transaction and output the bytecode. These bytecodes are provided to the calculator 120 to which the zero-knowledge proof algorithm is applied and go through a verification process, thereby omitting the process of verifying that a conventional transaction is distributed to all blockchain networks.

스토리지(113)는 트랜잭션의 실행과 관련된 다양한 데이터가 저장될 수 있으며, 256비트 문자가 키-값 형태로 연결된 저장소일 수 있다. 스토리지(113)에 저장되는 데이터로는 현재상태, 잔여가스, 블록헤더, 트랜잭션 송신자(MSG.SENDER), WEI로 표시된 트랜잭션 값(MSG.VALUE), 실행된 코드 소유자 및 실행을 위한 바이트코드 컨트랙트 등이 있다. 특히, 본 발명의 일 실시예에 따르면 스토리지(113)는 연산기(120)에 의해 영지식 알고리즘에 따라 증명된 증거를 저장할 수 있다.The storage 113 may store various data related to the execution of a transaction, and may be a storage in which 256-bit characters are connected in the form of a key-value. Data stored in the storage 113 include the current state, residual gas, block header, transaction sender (MSG.SENDER), transaction value expressed in WEI (MSG.VALUE), the owner of the executed code, and a bytecode contract for execution, etc. There is this. In particular, according to an embodiment of the present invention, the storage 113 may store evidence proven by the operator 120 according to a zero-knowledge algorithm.

데이터 입력부(114)는 트랜잭션과 관련된 데이터, 특히 컴파일된 바이트코드를 이루는 옵코드를 스택(115)에 저장할 수 있다. 데이터 입력부(114)는 스택(115)의 최상단 16개 요소들 중 하나를 최상단에 복사하거나 최상단의 요소를 밑의 16개 요소 중 하나와 교체할 수 있다. 연산들은 스택(115)의 최상단 2개 혹은 2±1개를 가져오며 그 결과를 스택에 푸시할 수 있다.The data input unit 114 may store transaction-related data, in particular, opcodes constituting compiled bytecodes in the stack 115 . The data input unit 114 may copy one of the top 16 elements of the stack 115 to the top or replace the topmost element with one of the 16 bottom elements. The operations may fetch the top two or 2±1 of the stack 115 and push the result onto the stack.

또한, 데이터 입력부(114)는 더 깊은 스택의 액세스를 위해 스택 요소들을 스토리지(113)나 메모리(117)로 이동시킬 수 있다. 단, 스택(115)의 상단 요소를 제거하지 않으면 그 밑에 존재하는 요소를 임의로 접근하는 건 불가능하며, 이러한 스택(115)의 특성은 별도의 검증 시스템에 의해 검증될 수 있다.Data input 114 may also move stack elements to storage 113 or memory 117 for access to a deeper stack. However, unless the upper element of the stack 115 is removed, it is impossible to arbitrarily access an element existing thereunder, and the characteristics of the stack 115 may be verified by a separate verification system.

스택(115)은 스마트 컨트랙트를 실행하기 위한 트랜잭션과 관련된 데이터를 순차적으로 저장할 수 있다. 본 발명의 일 실시예에 따른 가상머신(100)은 스택 머신으로서 모든 연산은 스택(stack) 영역에서 처리되며, 최대 1024개의 요소를 가질 수 있고 256비트의 단어들을 포함할 수 있다. The stack 115 may sequentially store data related to a transaction for executing a smart contract. The virtual machine 100 according to an embodiment of the present invention is a stack machine, and all operations are processed in the stack area, and may have a maximum of 1024 elements and may include 256-bit words.

프로그램 카운터(116)는 스택(115)에 저장된 명령어의 주소를 제공하는 것으로, 스택(115)에 저장된 옵코드에서 다음 차례에 실행할 명령어 위치를 가리킬 수 있다. The program counter 116 provides the address of the instruction stored in the stack 115 , and may indicate the position of the instruction to be executed next in the opcode stored in the stack 115 .

메모리(117)는 메시지 콜에 대해 새로 초기화된 인스턴스를 저장할 수 있다. 메모리는 선형이며 바이트 레벨로 처리되고, 쓰기는 8 비트나 256 비트가 될 수 있고, 읽기는 256 비트로 한정되어 처리될 수 있다. 또한, 메모리(117)의 일부 미리 할당된 영역에는 트랜잭션을 실행하기 위한 로컬변수 및 솔리디티 어셈블리 코드 등이 저장될 수 있다.The memory 117 may store a newly initialized instance for the message call. Memory is linear and processed at the byte level, writes can be 8 or 256 bits, and reads can be limited to 256 bits. In addition, a local variable for executing a transaction, a solidity assembly code, and the like may be stored in some pre-allocated area of the memory 117 .

또한, 본 발명의 일 실시예에 따른 가상머신(100)은 바이트코드를 실행하는 연산기(120)를 포함할 수 있고, 이러한 연산기(120)에는 가스를 소비하여 옵코드를 실행하는 코드 실행부(121) 및 영지식 증명 알고리즘이 적용된 영지식 증명부(200)가 탑재될 수 있다.In addition, the virtual machine 100 according to an embodiment of the present invention may include an operator 120 that executes a bytecode, and the operator 120 has a code execution unit ( 121) and the zero-knowledge proofing unit 200 to which the zero-knowledge proof algorithm is applied may be mounted.

연산기(120)는 바이트코드를 입력받아 연산을 수행하되, 수수료를 산출 및 공제하고, 바이트코드의 연산에 성공하면, 잔여코드를 확인 및 잔여가스를 확인하여 스마트 컨트랙트를 실행할 수 있다. 만약, 연산에 실패하거나 잔여코드 및 잔여가스가 존재하지 않으면 트랜잭션을 되돌릴 수 있다.The operator 120 receives the bytecode and performs an operation, calculates and deducts a fee, and when the operation of the bytecode succeeds, checks the residual code and checks the residual gas to execute the smart contract. If the operation fails or there is no residual code and residual gas, the transaction can be reversed.

전술한 가스(gas)는 본 발명의 실시예에 따른 블록체인 가상머신(100)은 작업을 수행하는데 필요한 계산 및 스토리지 자원을 측정하는 단위로서, 가상머신에서 처리되는 트랜잭션 및 스마트 컨트랙트의 코드 실행에 의해 수행되는 모든 계산에 고려될 수 있고, 각 작업을 수행함에 따라 고정된 양 또는 유동적인 양의 가스가 소비될 수 있다.The above-described gas is a unit for measuring the calculation and storage resources required for the block chain virtual machine 100 according to an embodiment of the present invention to perform a task, and is used for executing transactions and smart contracts processed in the virtual machine. It can be taken into account in all calculations performed by

일례로서, 2개의 숫자를 추가하는 것은 3개의 가스가 소비될 수 있고, Keccak-256 해시 계산시 해시되는 각 256비트 데이터에 대해서는 30 gas + 6 gas 비용이 소요될 수 있다.As an example, adding 2 numbers can cost 3 gas, and for each 256-bit data hashed when calculating a Keccak-256 hash it can cost 30 gas + 6 gas.

그러나, 이러한 가스는 토큰과는 달리 소유하거나 소비할 수는 없으며, 단지 얼마나 많은 계산 작업이 수행되고 있는지를 나타내는 값으로서, 가상머신 내부에서면 존재하는 개념이다. 이에, 본 발명의 실시예에 따른 코드 실행부(121)는 가스 비용 확인, 소비 및 잔여 가스 환불 등의 작업과 더불어 검증 시스템의 요청에 따라 발생하는 가스의 사용량 및 잔여량을 가스 데이터로 회신할 수 있다. 여기서, 가스 데이터는 토큰으로 환산된 값이 아닌, 직접적인 가스량이 수치값으로 기재될 수 있다.However, unlike tokens, this gas cannot be owned or consumed. It is a value that merely indicates how many calculations are being performed, and is a concept that exists inside a virtual machine. Accordingly, the code execution unit 121 according to an embodiment of the present invention may return the gas consumption and residual amount generated according to the request of the verification system as gas data, as well as operations such as gas cost confirmation, consumption and residual gas refund. there is. Here, the gas data may not be a value converted into a token, but a direct gas amount may be described as a numerical value.

영지식 증명부(200)는 일반연산 검증용 서킷 생성기를 포함하는 키 생성기, 증명자 및 검증자를 포함할 수 있고, 이를 통해 트랜잭션에 대한 일반 연산 검증을 수행할 수 있다.The zero-knowledge proof unit 200 may include a key generator including a circuit generator for general operation verification, a prover, and a verifier, through which it is possible to perform general operation verification on a transaction.

특히, 영지식 증명부(200)는 후술하는 기준 명령어의 개수, 기준 머신 스텝의 개수 및 기준 시스템의 크기를 갖는 일반연산 검증용 서킷을 생성하고, 키 생성자 정보, 증명자 정보 및 검증자 정보를 수신한 후, 시큐리티 파라미터 및 생성된 일반연산 검증용 서킷을 이용하여 증명키(pk) 및 검증키(vk)를 생성할 수 있다.In particular, the zero-knowledge proof unit 200 generates a general operation verification circuit having the number of reference instructions, the number of reference machine steps, and the size of the reference system, which will be described later, and generates key generator information, prover information, and verifier information. After receiving, a verification key (pk) and a verification key (vk) can be generated using the security parameter and the generated general operation verification circuit.

또한, 증명자는 증명키(pk)를 비롯하여 획득된 다항함수의 계수, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거(

Figure 112021129232309-pat00001
)를 생성하고, 검증자는 검증키(vk)를 비롯하여 증명에 필요한 정보를 이용하여 증거(
Figure 112021129232309-pat00002
)가 유효한지 검증을 실행할 수 있다.In addition, the prover uses the proof key (pk), the obtained coefficients of the polynomial function, and the information necessary for verification and proof among the general operation verification circuits.
Figure 112021129232309-pat00001
), and the verifier uses the information necessary for proof, including the verification key (vk), to
Figure 112021129232309-pat00002
) can be verified to be valid.

이러한 영지식 증명부(200)에 포함되는 키 생성기 및 이를 이용한 영지식 증명 기반 트랜잭션 검증 방법에 대한 구체적 설명은 후술한다.A detailed description of a key generator included in the zero-knowledge proof unit 200 and a zero-knowledge proof-based transaction verification method using the same will be described later.

그리고, 본 발명의 일 실시예에 따른 블록체인 가상머신(100)은 이더리움의 스펙에 부합하는지를 검증하는 검증 시스템과 연결될 수 있고 이를 통해 본 발명의 블록체인 가상머신이 영지식 증명 기술에 기반하여 트랜잭션을 처리하고 전술한 요건을 만족하는 지 검증할 수 있다.And, the blockchain virtual machine 100 according to an embodiment of the present invention can be connected to a verification system that verifies whether it conforms to the specifications of Ethereum, and through this, the blockchain virtual machine of the present invention is based on zero-knowledge proof technology. It can process the transaction and verify that the above-mentioned requirements are satisfied.

전술한 구조에 따라, 본 발명의 실시예에 따른 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신은 최소한의 트랜잭션 검증을 통해 검증량과 저장공간을 줄일 수 있다.According to the above-described structure, the blockchain virtual machine capable of verifying the zero-knowledge proof algorithm according to the embodiment of the present invention can reduce the amount of verification and storage space through minimal transaction verification.

이하, 도면을 참조하여 본 발명의 실시예에 따른 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신을 설명한다.Hereinafter, a blockchain virtual machine capable of verifying a zero-knowledge proof algorithm according to an embodiment of the present invention will be described with reference to the drawings.

도 2는 본 발명의 실시예에 따른 블록체인 가상머신에 적용된 영지식 증명을 위한 키 생성기를 나타낸 도면이다.2 is a diagram illustrating a key generator for zero-knowledge proof applied to a blockchain virtual machine according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 실시예에 따른 영지식 증명 기반 블록체인 가상머신에 적용된 영지식 증명을 위한 키 생성기(Key Generator; 10)는 기준 프로그램의 크기(program size), 명령어 및 스텝의 입력개수 및, 시간을 입력받아 일반 검증을 위한 서킷 로직을 생성하는 서킷 생성기(circuit generator; 11) 및 할당된 서킷으로부터 zk-SNARK 검증을 위한 증명기(proving key) 및 검증키(verification key)를 생성하는 zk-SNARK 키 생성기(zk-SNARK key generator)를 포함할 수 있다.Referring to FIG. 2 , a key generator 10 for zero-knowledge proof applied to a zero-knowledge proof-based blockchain virtual machine according to an embodiment of the present invention is a reference program size, commands and steps. A circuit generator 11 that receives the input number and time to generate circuit logic for general verification, and a proving key and verification key for zk-SNARK verification from the allocated circuit It may include a zk-SNARK key generator that generates it.

전술한 구조에서, 키 생성기(210)의 서킷 생성기(211)는 기준이 되는 프로그램의 크기, 입력되는 명령어 크기 및 시간 등을 수신하고, 어떤 프로그램에서도 동작하는 일반연산 검증용 서킷을 생성하여 zk-SNARK 키 생성기 (212)에 할당할 수 있다.In the above structure, the circuit generator 211 of the key generator 210 receives the standard program size, the input command size and time, etc., and generates a general operation verification circuit that operates in any program to generate zk- can be assigned to the SNARK key generator 212 .

서킷 생성기(211)에 의해 생성된 검증용 서킷은 하기의 수학식 1을 만족해야 한다. 수학식 1에 따르면, 일반적인 서킷(

Figure 112021129232309-pat00003
)은 이하의 '
Figure 112021129232309-pat00004
'개 명령어, 'T '개 이하의 머신 스텝, 'n' 이하의 크기를 갖는 어떤 프로그램에서도 동작하는 서킷을 생성할 수 있다.The circuit for verification generated by the circuit generator 211 must satisfy Equation 1 below. According to Equation 1, the general circuit (
Figure 112021129232309-pat00003
) is the following '
Figure 112021129232309-pat00004
You can create circuits that run on any program with 't' instructions, ' T ' or fewer machine steps, or 'n' or less in size.

Figure 112021129232309-pat00005
Figure 112021129232309-pat00005

여기서, 'C'는 서킷, '

Figure 112021129232309-pat00006
'은 기준 명령어의 개수, 'T '는 기준 머신 스텝의 개수, 'n'은 기준 시스템의 크기를 가리킨다.Here, 'C' is the circuit, '
Figure 112021129232309-pat00006
' is the number of reference instructions, ' T ' is the number of reference machine steps, and 'n' is the size of the reference system.

상기의 수학식 1을 만족하는 서킷 'C'는 프로그램이나 주요 입력 값에 의존하지 않으며, 오직 '

Figure 112021129232309-pat00007
', 'n', 'T ' 값에만 의존함에 따라 일반적(universal)이라 할 수 있고, zk-SNARK 키 생성기(212)와 결합함에 따라 검증 시스템의 파라미터 또한 일반적이게 된다.Circuit 'C' satisfying Equation 1 above does not depend on a program or main input value, only '
Figure 112021129232309-pat00007
It can be said to be universal as it depends only on the ', 'n', and ' T ' values, and in combination with the zk-SNARK key generator 212, the parameters of the verification system also become general.

이러한 키 생성기(210)를 이용하면, 한 번의 키 생성으로 모든 프로그램을 검증할 수 있으며, 이후에는 주어진 계산 범위에 맞는 키를 선택 가능하기 때문에 이를 통해 프로그램마다 별도의 키를 생성하는 비용의 소모를 줄일 수 있다.By using such a key generator 210, all programs can be verified with one key generation, and after that, a key suitable for a given calculation range can be selected, thereby reducing the cost of generating a separate key for each program. can be reduced

또한, zk-SNARK 키 생성기(212)는 키 생성자 정보, 증명자 정보 및 검증자 정보 등을 수신한 후 시큐리티 파라미터(

Figure 112021129232309-pat00008
) 및 서킷 생성기(211)에 의해 생성된 서킷(
Figure 112021129232309-pat00009
)을 이용하여 증명키(proving key; pk) 및 검증키(verification key; vk)를 생성할 수 있다.In addition, the zk-SNARK key generator 212 receives the key generator information, prover information, and verifier information, and then receives the security parameter (
Figure 112021129232309-pat00008
) and the circuit generated by the circuit generator 211 (
Figure 112021129232309-pat00009
) can be used to generate a proving key (pk) and a verification key (vk).

먼저, zk-SNARK 키 생성기(212)는 zk-SNARK(Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) 알고리즘을 이용하여 정보를 공개하지 않고 비밀 키와 같은 특정 정보의 소유를 증명할 수 있는 증거를 생성한다.First, the zk-SNARK key generator 212 uses a zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) algorithm to generate evidence that can prove ownership of specific information, such as a secret key, without disclosing the information. do.

즉, zk-SNARK 키 생성기(212)는 검증 규칙을 트리플 벡터를 지시하는 수학적 형태로 변환한 후, 트리플 벡터로 변환된 검증 규칙을 라그랑주 다항식 또는 고속 푸리에 변환하여 다항함수를 생성할 수 있다.That is, the zk-SNARK key generator 212 converts the verification rule into a mathematical form indicating a triple vector, and then converts the verification rule converted into the triple vector into a Lagrange polynomial or fast Fourier to generate a polynomial function.

상세하게는, zk-SNARK 키 생성기(212)는 검증 규칙을 R1CS(rank-1 constraint system) 형식으로 변환한 후, R1CS를 QAP(Quadratic Arithmetic Program)로 변환한다. 이때, 검증 규칙은 입력 금액이 출력 금액보다 큰지, 트랜잭션이 적절한 서명이 있는지 또는 입력이 UTXO에 속하는지 여부 등에 관한 것이다.Specifically, the zk-SNARK key generator 212 converts the verification rule into a rank-1 constraint system (R1CS) format, and then converts the R1CS into a quadratic arithmetic program (QAP). At this time, the verification rules relate to whether the input amount is greater than the output amount, whether the transaction has an appropriate signature, or whether the input belongs to UTXO.

상기 R1CS는 트리플 벡터(A, B, C)로서, 이는 검증 규칙의 수학적 형태를 의미하고, QAP는 라그랑주 다항식 또는 고속 푸리에 변환을 통해 R1CS를 이하의 수학식 2와 같은 다항식 형태로 변환할 수 있다.The R1CS is a triple vector (A, B, C), which means a mathematical form of a verification rule, and QAP is a Lagrange polynomial or fast Fourier transform to transform R1CS into a polynomial form as shown in Equation 2 below. .

Figure 112021129232309-pat00010
Figure 112021129232309-pat00010

그리고, zk-SNARK 키 생성기(212)는 랜덤 엘리먼트(Γ)를 통해

Figure 112021129232309-pat00011
를 값을 산출할 수 있다. 여기서,
Figure 112021129232309-pat00012
는 QAP 인스턴스인 '
Figure 112021129232309-pat00013
'으로 표현할 수 있고, QAP의 증거(
Figure 112021129232309-pat00014
)인 '
Figure 112021129232309-pat00015
'을 이용하여 증명키(pk) 및 검증키(vk)를 생성할 수 있다.And, the zk-SNARK key generator 212 through the random element (Γ)
Figure 112021129232309-pat00011
value can be calculated. here,
Figure 112021129232309-pat00012
is the QAP instance '
Figure 112021129232309-pat00013
', and the evidence of QAP (
Figure 112021129232309-pat00014
)sign '
Figure 112021129232309-pat00015
' can be used to generate a proof key (pk) and a verification key (vk).

이때, zk-SNARK 키 생성기(212)는 서킷 당 증명키(pk) 및 검증키(vk)를 한번만 생성하게 된다.At this time, the zk-SNARK key generator 212 generates a proof key (pk) and a verification key (vk) only once per circuit.

따라서, 한번 생성된 후에는 어느 증명자라도 증명키(pk)를 이용하여 증거(

Figure 112021129232309-pat00016
)를 생성할 수 있고, 어느 검증자라도 검증키(vk)를 이용하여 증거(
Figure 112021129232309-pat00017
)를 검증할 수 있다.Therefore, once created, any prover can use the proof key (pk) to
Figure 112021129232309-pat00016
), and any validator can use the verification key (vk) to
Figure 112021129232309-pat00017
) can be verified.

본 발명의 시스템에 적용되는 영지식 증명 방법은 시간이 아닌 공간에서의 추가적인 효율성을 달성하기 위한 것으로, 증명키(pk)의 크기를 줄이기 위해 산술 서킷으로부터 파생된 QAP의 구조적 특성을 이용한 것이다.The zero-knowledge proof method applied to the system of the present invention is to achieve additional efficiency in space rather than time, and uses the structural characteristics of QAP derived from an arithmetic circuit to reduce the size of the proof key pk.

따라서, 한번의 서킷 생성으로 모든 프로그램을 검증할 수 있으며, 이후에는 주어진 계산 범위에 맞는 키의 선택이 가능하게 되며, 이를 통해 프로그램 별로 키를 생성하는 비용의 소모를 줄일 수 있다.Therefore, it is possible to verify all programs by generating a circuit once, and thereafter, it becomes possible to select a key suitable for a given calculation range, thereby reducing the cost of generating a key for each program.

도 3은 본 발명의 실시예에 따른 블록체인 가상머신에 적용된 영지식 증명을 위한 키 생성기를 이용한 영지식 증명 로직을 나타낸 도면이다.3 is a diagram illustrating zero-knowledge proof logic using a key generator for zero-knowledge proof applied to a blockchain virtual machine according to an embodiment of the present invention.

도 3을 참조하면, 본 발명의 실시예에 따른 시스템에 적용된 영지식 증명 로직은, 전술한 키 생성기(210)로부터 증명키(pk)를 제공받고, zk-SNARK 알고리즘을 통해 획득되는 다항함수의 계수, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거(

Figure 112021129232309-pat00018
)를 생성하는 증명자(220) 및, 전술한 키 생성기(210)로부터 검증키(vk)를 제공받고, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거(
Figure 112021129232309-pat00019
)가 유효한지 검증을 실행하는 검증자(230)를 포함할 수 있다.Referring to FIG. 3 , the zero-knowledge proof logic applied to the system according to the embodiment of the present invention is provided with a proof key pk from the above-described key generator 210, and is a polynomial function obtained through the zk-SNARK algorithm. Evidence (
Figure 112021129232309-pat00018
), a verification key (vk) is provided from the above-described key generator 210 and the prover 220, and the proof (
Figure 112021129232309-pat00019
) may include a verifier 230 that executes verification that is valid.

이러한 증명자(220) 및 검증자(230)는 키 생성기(210)와 연결되는 하나 이상의 단말로 구현할 수 있다.The prover 220 and the verifier 230 may be implemented as one or more terminals connected to the key generator 210 .

증명자(220)는 일반연산 검증용 키 생성기(210)에서 생성된 증명키(pk)를 이용하여 증거(

Figure 112021129232309-pat00020
)를 생성할 수 있다. 이러한 증명자(220)는 증인 맵(witness map; 1) 및 제1 zk-SNARK 증명자(222)를 포함할 수 있고, 증인 맵(221)은 프로그램 및 입력값을 통해 서킷을 할당하고, 제1 zk-SNARK 증명자(222)는 할당된 서킷에 따라 증명키(pk)를 zk-SNARK 알고리즘을 통해 획득된 다항함수의 계수 및 검증과 증명에 필요한 정보(
Figure 112021129232309-pat00021
)를 이용하여 상기의 수학식 2에 따라, 증거(
Figure 112021129232309-pat00022
)를 생성할 수 있다.The prover 220 uses the proof key (pk) generated by the key generator 210 for general operation verification to provide evidence (
Figure 112021129232309-pat00020
) can be created. Such prover 220 may include a witness map 1 and a first zk-SNARK prover 222, and the witness map 221 allocates circuits through programs and inputs, and 1 The zk-SNARK prover 222 sets the proof key (pk) according to the assigned circuit, the coefficients of the polynomial function obtained through the zk-SNARK algorithm, and information (
Figure 112021129232309-pat00021
) according to Equation 2 above using the evidence (
Figure 112021129232309-pat00022
) can be created.

상세하게는, 증명자(220)는 'H(z)'의 계수(

Figure 112021129232309-pat00023
), QAP의 증거(
Figure 112021129232309-pat00024
) 및 증명키(pk) 를 이용해서 증거(
Figure 112021129232309-pat00025
)를 생성할 수 있다.In detail, the prover 220 is a coefficient of 'H(z)'
Figure 112021129232309-pat00023
), evidence of QAP (
Figure 112021129232309-pat00024
) and proof key (pk)
Figure 112021129232309-pat00025
) can be created.

또한, 검증자(230)는 검증키(vk), 검증과 증명에 필요한 정보(

Figure 112021129232309-pat00026
) 및 증거(
Figure 112021129232309-pat00027
)를 수신하면 증거(
Figure 112021129232309-pat00028
)가 유효한지 검증하는 역할을 한다. 검증자(230)는 탑재된 제2 zk-SNARK 증명자(231)를 통해 검증키(vk)의 일부 및 검증과 증명에 필요한 정보(
Figure 112021129232309-pat00029
)를 이용하여 이하의 수학식 3을 산출하고, 검증키(vk) 및 수학식 3의 결과 값을 이용하여 12개의 페어링을 계산하고 필요한 점검을 수행하여 승인(accept) 또는 거절(reject)을 출력할 수 있다.In addition, the verifier 230 includes a verification key (vk), information required for verification and proof (
Figure 112021129232309-pat00026
) and evidence (
Figure 112021129232309-pat00027
) upon receipt of evidence (
Figure 112021129232309-pat00028
) to verify that it is valid. The verifier 230 provides a part of the verification key (vk) through the mounted second zk-SNARK prover 231 and information required for verification and proof
Figure 112021129232309-pat00029
) to calculate the following Equation 3, calculate 12 pairings using the verification key vk and the result value of Equation 3, and perform necessary checks to output accept or reject can do.

Figure 112021129232309-pat00030
Figure 112021129232309-pat00030

여기서, 'vk'는 검증키, 'n'은 입력크기, 'C'는 서킷을 가리킨다.Here, 'vk' is a verification key, 'n' is an input size, and 'C' is a circuit.

상기의 수학식 3의 산출 과정에서 가변 기반 다중 스칼라 곱셈 기법을 사용하여 수학식 3의 계산 결과인

Figure 112021129232309-pat00031
의 계산에 필요한 연산량을 줄일 수 있고, 페어링 평가에는 입력 크기(n)와 무관하게 일정한 시간이 걸리더라도, 이러한 평가는 매우 비싸고 작은 서킷에 대해 지배적이라 할 수 있다.In the calculation process of Equation 3, the calculation result of Equation 3 using a variable-based multiple scalar multiplication technique is
Figure 112021129232309-pat00031
Although it is possible to reduce the amount of computation required for the calculation of , and the pairing evaluation takes a certain amount of time regardless of the input size (n), this evaluation is very expensive and is dominant for small circuits.

그리고, 가상 머신에는 증거에 대한 검증을 수행하면, 해당 트랜잭션이 올바른 트랜잭션인지 확인한다. 이때, 가상머신의 영지식 증명부에는 일반 연산 검증이 가능한 영지식 증명 기술이 적용되어 있기 때문에 트랜잭션을 실행하지 않아도, 영지식 증거에 대한 검증을 수행하면 해당 트랜잭션이 올바른 트랜잭션인지 판단할 수 있으므로, 영지식 증명을 블록체인 가상머신에 적용할 수 있게 된다.And, if the virtual machine verifies the evidence, it is checked whether the transaction is a valid transaction. At this time, since the zero-knowledge proof technology that enables general operation verification is applied to the zero-knowledge proof part of the virtual machine, even if the transaction is not executed, if the verification of the zero-knowledge proof is performed, it can be determined whether the transaction is a valid transaction. Zero-knowledge proof can be applied to blockchain virtual machines.

도 4 및 도 5는 본 발명의 실시예에 따른 블록체인 가상머신에 정의된 서킷의 옵코드 및 정의된 옵코드들을 예시한 도면이다.4 and 5 are diagrams illustrating opcodes and defined opcodes of a circuit defined in a blockchain virtual machine according to an embodiment of the present invention.

본 발명의 실시예에 따른 블록체인 가상머신은 일반적인 서킷을 제공하는 것으로, 32 Byte word size를 지원하고, 메모리 크기가 가변적이고 스택의 크기에 제한이 없으며, 반복 호출 횟수(call depth)를 1024로 제한하여 함수 반복 호출을 통한 공격으로 성능이 저하되거나 보안 문제가 발생하는 것이 방지되도록 하며, 스택(stack) 기반이라는 데 특징이 있다.The blockchain virtual machine according to an embodiment of the present invention provides a general circuit, supports a 32 byte word size, has a variable memory size, has no limit on the size of the stack, and sets the number of repeated calls (call depth) to 1024 By limiting it, it prevents performance degradation or security problems caused by attacks through repeated function calls, and it is characterized in that it is stack-based.

도 4를 참조하면, 본 발명의 실시예에 따른 영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신에 탑재되는 트랜잭션을 처리할 수 있는 간단한 서킷을 예시한 것으로, 최소공배수(LCM)를 산출하는 옵코드 명령어를 정의하고 있다.Referring to FIG. 4, a simple circuit capable of processing a transaction mounted on a verifiable blockchain virtual machine to which a zero-knowledge proof algorithm according to an embodiment of the present invention is applied is exemplified. Defines code instructions.

예시된 옵코드 명령어에 따르면, 옵코드 명령이 실행시 제1 피연산자(left_operand) 및 제2 피연산자(right_operand)를 입력받고, 두 피연산자(left_operand, right_operand)의 곱을 최대공약수(gcd)로 나눈값을 반환하는 형태로 최대공약수를 산출하는 옵코드 명령어를 나타내고 있다.According to the exemplified opcode instruction, when the opcode instruction is executed, the first operand (left_operand) and the second operand (right_operand) are input, and the product of the two operands (left_operand, right_operand) divided by the greatest common divisor (gcd) is returned. It shows the opcode instruction that calculates the greatest common divisor in the form

도 5를 참조하면, 본 발명의 실시예에 따른 블록체인 가상머신이 지원하는 옵코드 명령어들을 예시한 것으로, 공지의 이더리움 가상머신이 지원하는 옵코드와 유사하거나 동일할 수 있다.Referring to FIG. 5, opcode commands supported by the blockchain virtual machine according to an embodiment of the present invention are exemplified, and may be similar to or the same as opcodes supported by a known Ethereum virtual machine.

상세하게는, 중지(stop) 연산 또는 산술(arithmetic) 연산과 관련된 옵코드로서, 실행을 중단시키는 'STOP', 덧셈, 뺄셈, 곱셈 및 정수 나눗셈 연산을 각각 수행하는 'ADD', 'MUL', 'SUB' 및 'DIV', 부호 있는 정수 나눗셈 연산 'SDIV', 나눗셈의 나머지를 산출하는 'MOD', 부호 있는 정수 나눗셈의 나머지를 산출하는 'SMOD', 특수 함수로서, 256비트의 제약없이 임의의 정밀도로 덧셈 및 뺄셈을 각각 수행하는 'ADDMOD', 'MULMOD', 지수 연산을 위한 'EXP' 및 부호 확장 명령어인 'SIGNEXTEND'를 포함할 수 있다. 이러한 옵코드 명령어는 지속적으로 추가될 수 있다.Specifically, as an opcode related to a stop operation or arithmetic operation, 'STOP' to stop execution, 'ADD', 'MUL' to perform addition, subtraction, multiplication and integer division operations, respectively, 'SUB' and 'DIV', signed integer division operation 'SDIV', 'MOD' yields remainder of division, 'SMOD' yields remainder of signed integer division, special function, arbitrary without 256-bit constraint 'ADDMOD' and 'MULMOD' for performing addition and subtraction with precision of , 'EXP' for exponentiation, and 'SIGNEXTEND', a sign extension instruction, may be included. These opcode instructions may be continuously added.

또한, 본 발명의 일 실시예에 따른 블록체인 가상머신은 스택 기반임에 따라, 스택 제어를 위한 스택, 메모리 및 스토리지 관리 명령어를 더 제공할 수 있다. 일례로서, 스택에서 맨 위 아이템을 제거하는 'POP', 메모리에서 단어를 불러오는 'MLOAD', 단어를 메모리에 저장하는 'MSTORE', x바이트 항목을 스택에 넣은 'PUSHx' 등이 있다.In addition, since the blockchain virtual machine according to an embodiment of the present invention is stack-based, it may further provide stack, memory, and storage management commands for stack control. Examples include 'POP', which removes the top item from the stack, 'MLOAD' to load a word from memory, 'MSTORE' to store a word in memory, and 'PUSHx' to put an x-byte item onto the stack.

아울러, 이러한 명령어는 관리자에게 공지되고 가상머신과 연결되는 검증 시스템에 의한 검증 과정에서 스택이 정상적으로 구현되었는지 확인하는 데 활용될 수 있다.In addition, these commands are notified to the administrator and can be utilized to check whether the stack is normally implemented during the verification process by the verification system connected to the virtual machine.

이하, 도면을 참조하여 본 발명의 실시예에 따른 블록체인 가상머신의 영지식 증명 방법을 설명한다.Hereinafter, a zero-knowledge proof method of a blockchain virtual machine according to an embodiment of the present invention will be described with reference to the drawings.

도 6은 본 발명의 실시예에 따른 블록체인 가상머신의 영지식 증명 방법을 나타낸 도면이다. 이하의 설명에서 각 단계별 실행주체는 별도의 기재가 없더라도 본 발명의 실시예에 따른 블록체인 가상머신과 연산기와, 그 구성부가 된다.6 is a diagram illustrating a zero-knowledge proof method of a blockchain virtual machine according to an embodiment of the present invention. In the following description, even if there is no separate description, the execution subject of each step becomes the block chain virtual machine and calculator according to the embodiment of the present invention, and its constituent parts.

도 6을 참조하면, 본 발명의 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신은, 일반 연산을 검증하고 트랜잭션 검증량과 저장 공간을 줄일 수 있도록 하는 것이며, 본 발명의 블록체인 가상머신은 검증용 서킷 생성기를 탑재하고 있고, 이를 통해 기준 명령어의 개수, 기준 머신 스텝의 개수 및 기준 시스템의 크기를 갖는 일반연산 검증용 서킷을 생성할 수 있다(단계 S100).Referring to FIG. 6 , the blockchain virtual machine capable of verifying the zero-knowledge proof algorithm of the present invention is to verify general operations and reduce the amount of transaction verification and storage space, and the blockchain virtual machine of the present invention is verified It is equipped with a circuit generator for use, and through this, a circuit for general operation verification having the number of reference instructions, the number of reference machine steps, and the size of the reference system can be generated (step S100).

다음으로, 본 발명의 서킷 생성기는 기준 명령어의 개수, 기준 머신 스텝의 개수 및 기준 시스템의 크기를 수신하고, 어떤 프로그램에서도 동작하는 일반연산 검증용 서킷을 생성할 수 있다.Next, the circuit generator of the present invention may receive the number of reference instructions, the number of reference machine steps, and the size of the reference system, and generate a circuit for general operation verification that operates in any program.

본 발명의 일 실시예에 따르면, 가상머신에 탑재되는 서킷 생성기는 전술한 수학식 1에 따른 명령어, T 이하의 머신 스텝, n 이하의 크기를 갖는 어떤 프로그램에서도 동작하는 서킷을 생성할 수 있다.According to an embodiment of the present invention, a circuit generator mounted on a virtual machine may generate a circuit that operates in any program having a command according to Equation 1, a machine step of T or less, and a size of n or less.

전술한 바와 같이, 명령어, T 이하의 머신 스텝, n 이하의 크기를 갖는 어떤 프로그램에서도 동작하는 서킷 C는 프로그램이나 주요 입력 값에 의존하지 않고, '

Figure 112021129232309-pat00032
', 'T ', 'n' 값에만 의존하기 때문에 일반적이라 할 수 있다. zk-SNARK 키 생성기와 결합한다면 검증 시스템의 파라미터 또한 일반 검증이 된다.As mentioned above, circuit C running on instructions, machine steps less than T , and any program with size n or less does not depend on the program or main input values, and '
Figure 112021129232309-pat00032
', ' T ', 'n' only depend on the values, so it's general. When combined with the zk-SNARK key generator, the parameters of the verification system are also general verification.

특히, 전술한 서킷에 따르면 한 번의 키 생성으로 모든 프로그램을 검증할 수 있으며, 이후에는 주어진 계산 범위에 맞는 키를 선택 가능하기 때문에 이를 통해 프로그램 별로 키를 생성하는 비용의 소모를 줄일 수 있다는 장점이 있다.In particular, according to the circuit described above, all programs can be verified with one key generation, and after that, a key suitable for a given calculation range can be selected, thereby reducing the cost of generating a key for each program. there is.

다음으로, 연산기는 일반연산 검증용 서킷 및 zk-SNARK(Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) 알고리즘을 이용하여 증명 키 및 검증 키를 생성한다(단계 S110).Next, the operator generates a proof key and a verification key by using the general operation verification circuit and zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) algorithm (step S110).

단계 S110에 대한 일 실시예에서, 일반연산 검증용 서킷 생성기는 키 생성자 정보, 증명자 정보 및 검증자 정보를 수신한 후, 시큐리티 파라미터 및 서킷 생성 모듈에 의해 생성된 일반연산 검증용 서킷을 이용하여 증명 키 및 검증 키를 생성한다.In an embodiment for step S110, the circuit generator for general operation verification receives the key generator information, prover information, and verifier information, and then uses the security parameter and circuit for general operation verification generated by the circuit generation module to Generate proof key and verification key.

이때, 서킷 생성기는 검증 규칙을 트리플 벡터를 지시하는 수학적 형태로 변환한 후, 상기 트리플 벡터로 변환된 검증 규칙을 라그랑주 다항식 또는 고속 푸리에 변환하여 다항함수를 생성할 수 있다.In this case, the circuit generator may generate a polynomial function by converting the verification rule into a mathematical form indicating a triple vector, and then transforming the verification rule converted into the triple vector into a Lagrange polynomial or fast Fourier.

다음으로, 증명자는 증명 키, 상기 zk-SNARK 알고리즘을 통해 획득된 다항함수의 계수, 상기 일반연산 검증용 서킷중 검증과 증명에 필요한 정보를 이용하여 증거를 생성한다(단계 S120).Next, the prover generates evidence using the proof key, the coefficients of the polynomial function obtained through the zk-SNARK algorithm, and the information required for verification and proof in the general operation verification circuit (step S120).

그리고, 검증자는 상기 검증 키, 상기 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보 및 상기 증거를 이용하여 상기 증거가 유효한지 검증을 실행한다(단계 S130).Then, the verifier verifies whether the evidence is valid by using the verification key, information necessary for verification and verification among the general operation verification circuit, and the evidence (step S130).

전술한 절차에 따라, 본 발명의 실시예에 따른 영지식 증명 알고리즘이 적용된 검증 가능한 블록체인 가상머신에서 검증용 서킷을 생성하고, 이를 통해 트랜잭션을 검증함으로써 일반적인 블록체인 네트워크에서 모든 트랜잭션에 대한 검증을 대체할 수 있어 신속하게 검증절차를 완료할 수 있게 된다.According to the procedure described above, a verification circuit is created in a verifiable blockchain virtual machine to which the zero-knowledge proof algorithm according to an embodiment of the present invention is applied, and the transaction is verified through this, thereby verifying all transactions in a general blockchain network. It can be replaced, so that the verification process can be completed quickly.

상기한 설명에 많은 사항이 구체적으로 기재되어 있으나 이것은 발명의 범위를 한정하는 것이라기보다 바람직한 실시예의 예시로서 해석되어야 한다. 따라서, 발명은 설명된 실시예에 의하여 정할 것이 아니고 특허청구범위와 특허청구범위에 균등한 것에 의하여 정하여져야 한다.Although many matters are specifically described in the above description, these should be construed as examples of preferred embodiments rather than limiting the scope of the invention. Accordingly, the invention should not be defined by the described embodiments, but should be defined by the claims and equivalents to the claims.

100 : 가상머신 110 : 인터프리터
111 : 트랜잭션 입력부 112 : 바이트코드 출력부
113 : 스토리지 114 : 데이터 입력부
115 : 스택 116 : 프로그램 카운터
117 : 메모리 120 : 연산기
121: 코드 실행부 200 : 영지식 증명부
210 : 키 생성기 211 : 서킷 생성기
212, 213 : zk-SNARK 키 생성기 220 : 증명자
221 : 증인 맵 222 : zk-SNARK 증명자
230 : 검증자
100: virtual machine 110: interpreter
111: transaction input unit 112: bytecode output unit
113: storage 114: data input unit
115: stack 116: program counter
117: memory 120: operator
121: code execution unit 200: zero-knowledge proof unit
210: key generator 211: circuit generator
212, 213: zk-SNARK key generator 220: prover
221: witness map 222: zk-SNARK prover
230: validator

Claims (5)

스마트 컨트랙트를 컴파일하는 인터프리터 및 영지식 증명을 위한 연산기를 포함하는 블록체인 가상머신에 있어서,
입력되는 트랜잭션을 컴파일하여 바이트코드로 변환하고, 바이트 코드에 따라 스마트 콘트랙트를 실행하는 인터프리터; 및
상기 스마트 콘트랙트의 실행시, 일반연산 검증용 서킷을 통해 생성한 증거를 이용하여 상기 트랜잭션을 검증하는 연산기를 포함하고,
상기 인터프리터는,
트랜잭션 발신자로부터 입력되는 트랜잭션을 입력받는 트랜잭션 입력부;
입력된 트랜잭션에 대한 스마트 컨트랙트를 컴파일하여 바이트코드를 출력하는 출력부;
현재 입력된 트랜잭션에 대한 정보 및 증명된 영지식 증거를 저장하는 스토리지;
컴파일된 스마트 컨트랙트에 대한 하나 이상의 바이트코드를 입력받는 데이터 입력부;
상기 바이트코드가 실행되는 과정에서 분리되는 옵코드가 순차적으로 저장되는 스택;
상기 스택에 저장된 명령어의 주소를 제공하는 프로그램 카운터; 및
트랜잭션을 실행하기 위한 로컬변수 및 솔리디티 어셈블리 코드가 저장되는 메모리를 포함하고,
상기 데이터 입력부는,
컴파일된 바이코드를 이루는 옵코드를 상기 스택에 저장하되, 상기 스택의 최상단 16개 요소들 중 하나를 상기 스택의 최상단에 복사하거나, 상기 스택의 최상단의 16개 요소들 중 하나를 최상단의 16개의 요소 밑의 16개 요소와 교체 가능하고, 상기 스택의 요소를 상기 스토리지나 상기 메모리로 이동시키는 것이 가능하고,
상기 스토리지에 저장되는 데이터는,
트랜잭션의 현재수행상태, 잔여가스, 블록헤더, 트랜잭션 송신자(MSG.SENDER), WEI로 표시된 트랜잭션 값(MSG.VALUE) 및, 실행된 코드 소유자 및 실행을 위한 바이트코드 컨트랙트를 더 포함하고,
상기 연산기는,
상기 바이트코드를 입력받아 연산을 수행하고, 연산에 따른 수수료를 산출 및 공제하고, 연산 성공시 잔여코드를 확인 및 잔여가스를 확인하여 스마트 컨트랙트를 실행하는 코드 실행부; 및
일반연산 검증용 서킷 생성기를 포함하는 키 생성기 및, 증명자 및 검증자를 이용하여 트랜잭션에 대한 일반 연산 검증을 수행하는 영지식 증명부를 포함하고,
상기 키 생성기는,
기준 프로그램의 크기, 명령어 및 스텝의 입력개수 및, 시간을 입력받아 일반 검증을 위한 서킷 로직을 생성하는 서킷 생성기; 및
할당된 서킷으로부터 zk-SNARK 검증을 위한 증명기 및 검증키를 생성하는 Zk-SNARK 키 생성기를 포함하고,
상기 증명자는,
상기 키 생성기로부터 증명키를 제공받고, zk-SNARK 알고리즘을 통해 획득되는 다항함수의 계수, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거를 생성하고,
상기 검증자는,
상기 키 생성기로부터 검증키를 제공받고, 일반연산 검증용 서킷 중 검증과 증명에 필요한 정보를 이용하여 증거가 유효한지 검증을 실행하는 영지식 증명 알고리즘의 검증이 가능한 블록체인 가상머신.
In a blockchain virtual machine comprising an interpreter for compiling a smart contract and an operator for zero-knowledge proof,
an interpreter that compiles an input transaction, converts it into bytecode, and executes a smart contract according to the bytecode; and
When the smart contract is executed, it includes a calculator that verifies the transaction by using the evidence generated through the general operation verification circuit,
The interpreter is
a transaction input unit receiving a transaction input from a transaction sender;
an output unit that compiles the smart contract for the input transaction and outputs a bytecode;
a storage for storing information about a currently input transaction and proof of zero-knowledge evidence;
a data input unit for receiving one or more bytecodes for the compiled smart contract;
a stack in which opcodes separated while the bytecode is executed are sequentially stored;
a program counter providing an address of an instruction stored in the stack; and
a memory in which local variables and solidity assembly code for executing a transaction are stored;
The data input unit,
The opcode constituting the compiled bicode is stored in the stack, and one of the top 16 elements of the stack is copied to the top of the stack, or one of the top 16 elements of the stack is copied to the top 16 interchangeable with 16 elements below an element, and capable of moving elements of the stack into the storage or the memory;
The data stored in the storage is
The current execution status of the transaction, residual gas, block header, the sender of the transaction (MSG.SENDER), the transaction value expressed in WEI (MSG.VALUE), and the owner of the executed code and a bytecode contract for execution,
The calculator is
a code execution unit that receives the bytecode and performs an operation, calculates and deducts a fee according to the operation, checks the residual code and checks the residual gas when the operation is successful, and executes the smart contract; and
A key generator including a circuit generator for general operation verification, and a zero-knowledge proof unit that performs general operation verification on a transaction using a prover and a verifier,
The key generator is
a circuit generator for generating circuit logic for general verification by receiving the size of the reference program, the number of inputs of commands and steps, and time; and
a Zk-SNARK key generator for generating a prover and a verification key for zk-SNARK verification from the assigned circuit;
The prover is
A proof key is provided from the key generator, and the proof is generated using the coefficients of the polynomial function obtained through the zk-SNARK algorithm, and information necessary for verification and proof among the general operation verification circuits,
The verifier is
A blockchain virtual machine capable of verifying a zero-knowledge proof algorithm that receives a verification key from the key generator and verifies that the evidence is valid by using the information required for verification and proof in the general operation verification circuit.
삭제delete 삭제delete 삭제delete 삭제delete
KR1020210153338A 2021-11-09 2021-11-09 Verifiable block chain virtual machine with zero knowledge algorithm KR102398543B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020210153338A KR102398543B1 (en) 2021-11-09 2021-11-09 Verifiable block chain virtual machine with zero knowledge algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020210153338A KR102398543B1 (en) 2021-11-09 2021-11-09 Verifiable block chain virtual machine with zero knowledge algorithm

Publications (1)

Publication Number Publication Date
KR102398543B1 true KR102398543B1 (en) 2022-05-17

Family

ID=81803762

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210153338A KR102398543B1 (en) 2021-11-09 2021-11-09 Verifiable block chain virtual machine with zero knowledge algorithm

Country Status (1)

Country Link
KR (1) KR102398543B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020064460A (en) * 2018-10-17 2020-04-23 伸太郎 原 Cloud design management method, cloud design database, and cloud design management program
KR102170820B1 (en) * 2020-07-03 2020-10-28 주식회사 온더 A system to implement a virtual machine based on a zero-knowledge proof circuit for general operation verification
KR20210122211A (en) 2020-12-24 2021-10-08 베이징 바이두 넷컴 사이언스 테크놀로지 컴퍼니 리미티드 Transaction processing method, device, equipment, program and medium of ethereum virtual machine
US20210318897A1 (en) * 2020-08-31 2021-10-14 Alipay (Hangzhou) Information Technology Co., Ltd. Methods, blockchain nodes, and node devices for executing smart contract

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020064460A (en) * 2018-10-17 2020-04-23 伸太郎 原 Cloud design management method, cloud design database, and cloud design management program
KR102170820B1 (en) * 2020-07-03 2020-10-28 주식회사 온더 A system to implement a virtual machine based on a zero-knowledge proof circuit for general operation verification
US20210318897A1 (en) * 2020-08-31 2021-10-14 Alipay (Hangzhou) Information Technology Co., Ltd. Methods, blockchain nodes, and node devices for executing smart contract
KR20210122211A (en) 2020-12-24 2021-10-08 베이징 바이두 넷컴 사이언스 테크놀로지 컴퍼니 리미티드 Transaction processing method, device, equipment, program and medium of ethereum virtual machine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Gbadebo Ayoade 외 3명, Smart Contract Defense Through Bytecode Rewriting, IEEE International Conference on Blockchain (2019.07.)* *

Similar Documents

Publication Publication Date Title
EP3707871B1 (en) System for recording verification keys on a blockchain
US10699269B1 (en) System and method for smart contract publishing
CN110245490B (en) Conditional receipt storage method and node combining code labeling and type dimension
CN110264196B (en) Conditional receipt storage method and node combining code labeling and user type
Almeida et al. Formally verifying Kyber episode IV: implementation correctness
KR102372111B1 (en) Verification system based on zero knowledge for block chain virtual machine
US11513815B1 (en) Defining data storage within smart contracts
KR102398543B1 (en) Verifiable block chain virtual machine with zero knowledge algorithm
Covaci et al. NECTAR: non-interactive smart contract protocol using blockchain technology
CN110807195A (en) Intelligent contract issuing method, issuing platform device and issuing system
Palladino Ethereum for Web Developers
Wüst et al. Bitcontracts: Adding Expressive Smart Contracts to Legacy Cryptocurrencies.
JP7477674B2 (en) System for simplifying executable instructions for optimized verifiable computation - Patents.com
KR102519490B1 (en) Method for verifying block chain virtual machine based on zero knowledge
US11657391B1 (en) System and method for invoking smart contracts
Team zkMIPS
Brunetto Distributed Verifier-Smart Contract for verifying ECDSA signatures on multiple curves
Tran et al. An Implementation and Evaluation of Layer 2 for Ethereum with zk-Rollup
Pacheco et al. Formally verifying Kyber Part I: Implementation Correctness
Liu et al. Fundamental Data Security Technologies
CN116305064A (en) Zero knowledge proof method, device, storage medium and electronic equipment
CN117591087A (en) Efficient formalized code construction method aiming at complex data processing requirements
Brun et al. A Security Audit of the Blockchain Signaling Systems Protocol

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant