KR20210048241A - Apparatus and method for surveilling smart contract - Google Patents

Apparatus and method for surveilling smart contract Download PDF

Info

Publication number
KR20210048241A
KR20210048241A KR1020190132250A KR20190132250A KR20210048241A KR 20210048241 A KR20210048241 A KR 20210048241A KR 1020190132250 A KR1020190132250 A KR 1020190132250A KR 20190132250 A KR20190132250 A KR 20190132250A KR 20210048241 A KR20210048241 A KR 20210048241A
Authority
KR
South Korea
Prior art keywords
smart contract
state value
variable
control device
smart
Prior art date
Application number
KR1020190132250A
Other languages
Korean (ko)
Other versions
KR102272008B1 (en
Inventor
김순태
홍준기
Original Assignee
전북대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 전북대학교산학협력단 filed Critical 전북대학교산학협력단
Priority to KR1020190132250A priority Critical patent/KR102272008B1/en
Publication of KR20210048241A publication Critical patent/KR20210048241A/en
Application granted granted Critical
Publication of KR102272008B1 publication Critical patent/KR102272008B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/563Static detection by source code analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Virology (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Disclosed are a device and method for controlling a smart contract, wherein the method for controlling the smart contract according to one embodiment of the present application may comprise: a step of parsing a source code of an issued smart contract to extract variables associated with the smart contract; a step of extracting a state value associated with the smart contract based on the address information of the smart contract; a step of mapping the extracted variable and the state value; and a step of visualizing and displaying the mapped variable and the state value. Therefore, the present invention is capable of allowing a user to easily understand the information about the smart contract.

Description

스마트 컨트랙트에 대한 관제 장치 및 방법{APPARATUS AND METHOD FOR SURVEILLING SMART CONTRACT}Control device and method for smart contract {APPARATUS AND METHOD FOR SURVEILLING SMART CONTRACT}

본원은 스마트 컨트랙트에 대한 관제 장치 및 방법에 관한 것이다.The present application relates to a control device and method for a smart contract.

최근 들어, 가상화폐에 대한 관심이 고조되면서 블록체인을 기반으로 한 다양한 어플리케이션이 생산 및 소비되고 있다. 가상화폐를 포함하는 블록체인 중 하나인 이더리움은 스마트 컨트랙트(Smart Contract)라는 기술을 활용하여 가상화폐의 기능을 넘어선 서비스를 제공하고 있다.Recently, as interest in cryptocurrency has increased, various applications based on blockchain are being produced and consumed. Ethereum, one of the blockchains that includes virtual currency, uses a technology called Smart Contract to provide services beyond the function of virtual currency.

이에 따라, 많은 개발자들은 이더리움에서 활용할 수 있는 스마트 컨트랙트를 개발하여 관련 서비스를 제공하고 있으며, 개발자뿐만 아니라 일반 사용자에 의해서도 스마트 컨트랙트가 배포되거나 사용될 수 있는데, 이러한 일반 사용자가 자신이 배포한 스마트 컨트랙트 혹은 사용하고자 하는 스마트 컨트랙트에 대한 정보를 획득하기 위해서는 별도의 수수료를 지급해야 하거나 해당 스마트 컨트랙트에 대한 Bytecode를 직접 분석하여야 하는 한계가 있다.Accordingly, many developers develop smart contracts that can be used in Ethereum and provide related services, and smart contracts can be distributed or used not only by developers but also by general users. Or, in order to obtain information on the smart contract to be used, there is a limitation in that a separate fee must be paid or the bytecode for the smart contract must be analyzed directly.

전술한 개발자와 일반 사용자의 편의성 측면 외에도, 정부, 민간단체, 이더리움 관계자 등의 주체는 블록체인 네트워크 내의 악의적인 사용(예를 들면, 자금 세탁, DDoS 공격 등)에 대한 발생 여부 및 상황을 신속히 파악하고 대처하여 이더리움 생태계를 지속적으로 관리할 책임과 필요성이 높아지고 있다.In addition to the above-described aspect of convenience for developers and general users, subjects such as the government, private organizations, and Ethereum officials quickly detect the occurrence and situation of malicious use (e.g., money laundering, DDoS attacks, etc.) within the blockchain network. Responsibility and necessity to continuously manage the Ethereum ecosystem by identifying and responding are increasing.

또한, 가상화폐에 대한 전세계적인 활용 증가 추세를 고려하면, 다양한 국가의 사정에 맞는 규제와 법률이 적용되어야 할 필요성이 높음에도 이더리움 등의 블록체인 시스템에 대한 규제 또는 제어를 위한 도구는 아직 제대로 마련되지 않은 실정이다.In addition, considering the increasing trend of global use of cryptocurrency, the need to apply regulations and laws appropriate to the circumstances of various countries is high, but tools for regulation or control of blockchain systems such as Ethereum are still adequate. It is not prepared.

본원의 배경이 되는 기술은 한국공개특허공보 제10-2019-0048227호에 개시되어 있다.The technology behind the present application is disclosed in Korean Laid-Open Patent Publication No. 10-2019-0048227.

본원은 전술한 종래 기술의 문제점을 해결하기 위한 것으로서, 이더리움 등의 블록체인 시스템에서 제공되는 스마트 컨트랙트에 대한 소스코드 분석, 상태 값 정보 추출 등을 통해 사용자가 쉽게 이해할 수 있도록 스마트 컨트랙트에 대한 정보를 제공하는 스마트 컨트랙트에 대한 관제 장치 및 방법을 제공하는 것을 목적으로 한다.This application is intended to solve the problems of the prior art described above, and information on smart contracts so that users can easily understand them through source code analysis and state value information extraction for smart contracts provided by blockchain systems such as Ethereum. It is an object to provide a control device and method for a smart contract that provides a.

본원은 전술한 종래 기술의 문제점을 해결하기 위한 것으로서, 이더리움 등의 블록체인 시스템에서 제공되는 복수의 스마트 컨트랙트의 이상 상황 또는 악의적인 사용을 감지하여 즉각적인 조치가 가능하도록 하는 스마트 컨트랙트에 대한 관제 장치 및 방법을 제공하는 것을 목적으로 한다.The present application is to solve the problems of the prior art described above, and a control device for a smart contract that enables immediate action by detecting an abnormal situation or malicious use of a plurality of smart contracts provided in a blockchain system such as Ethereum. And to provide a method.

다만, 본원의 실시예가 이루고자 하는 기술적 과제는 상기된 바와 같은 기술적 과제들로 한정되지 않으며, 또 다른 기술적 과제들이 존재할 수 있다.However, the technical problem to be achieved by the embodiments of the present application is not limited to the technical problems as described above, and other technical problems may exist.

상기한 기술적 과제를 달성하기 위한 기술적 수단으로서, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 방법은, 발행된 스마트 컨트랙트의 소스코드를 파싱하여 상기 스마트 컨트랙트와 연계된 변수를 추출하는 단계, 상기 스마트 컨트랙트의 주소 정보에 기초하여 상기 스마트 컨트랙트와 연계된 상태값을 추출하는 단계, 추출된 상기 변수 및 상기 상태값을 매핑하는 단계 및 매핑된 상기 변수 및 상기 상태값을 시각화하여 표시하는 단계를 포함할 수 있다.As a technical means for achieving the above technical task, the control method for a smart contract according to an embodiment of the present application includes the steps of parsing the source code of the issued smart contract and extracting a variable associated with the smart contract, the Extracting a state value associated with the smart contract based on the address information of the smart contract, mapping the extracted variable and the state value, and visualizing and displaying the mapped variable and the state value can do.

또한, 상기 변수를 추출하는 단계는, 상기 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리를 생성하는 단계 및 상기 추상 구문 트리에 기초하여 상기 스마트 컨트랙트와 연계된 변수 각각의 데이터 유형 및 변수명을 추출하는 단계를 포함할 수 있다.In addition, the extracting of the variable includes generating an abstract syntax tree based on the parsing result of the source code, and data type and variable name of each variable associated with the smart contract based on the abstract syntax tree. It may include the step of extracting.

또한, 상기 상태값을 추출하는 단계는, 상기 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터를 획득하는 단계 및 상기 부호화된 데이터를 상기 상태값으로 변환하는 단계를 포함할 수 있다.In addition, the extracting the state value may include obtaining encoded data through a Blockchain API based on the address information of the smart contract, and converting the encoded data into the state value.

또한, 상기 표시하는 단계는, 매핑된 상기 변수 및 상기 상태값을 타임라인 형태로 표시하되, 상기 타임라인 상에는 상기 상태값이 변화한 시점에 대응하는 지점이 상기 상태값이 유지된 영역과 구분되도록 표시될 수 있다.In addition, the displaying may include displaying the mapped variable and the state value in the form of a timeline, so that a point on the timeline corresponding to a time point at which the state value is changed is distinguished from the region in which the state value is maintained. Can be displayed.

또한, 상기 표시하는 단계는, 소정의 변수에 대한 시간에 따른 상태값 변화를 나타낸 그래프 형태로 매핑된 상기 변수 및 상기 상태값을 표시할 수 있다.In addition, in the displaying, the variable and the state value mapped in a graph form representing a change in a state value over time for a predetermined variable may be displayed.

또한, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 방법은, 상기 스마트 컨트랙트의 이상을 탐지하는 단계를 포함할 수 있다.In addition, the control method for a smart contract according to an embodiment of the present application may include detecting an abnormality in the smart contract.

또한, 상기 이상을 탐지하는 단계는, 기 학습된 인공 지능 알고리즘에 기초하여 상기 상태값의 변화 패턴이 비정상적인 것으로 판단되는 경우 이상을 탐지할 수 있다.In addition, the step of detecting the abnormality may detect the abnormality when it is determined that the change pattern of the state value is abnormal based on a previously learned artificial intelligence algorithm.

또한, 상기 이상을 탐지하는 단계는, 복수의 발행된 스마트 컨트랙트 각각에 대하여 수행되는 것일 수 있다.In addition, the step of detecting the abnormality may be performed for each of a plurality of issued smart contracts.

또한, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 방법은, 소정의 상기 스마트 컨트랙트에 대한 이상이 탐지된 경우, 경고 및 알림 신호를 생성하는 단계를 포함할 수 있다.In addition, the control method for a smart contract according to an embodiment of the present application may include generating a warning and a notification signal when an abnormality with the predetermined smart contract is detected.

한편, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치는, 발행된 스마트 컨트랙트의 소스코드를 파싱하여 상기 스마트 컨트랙트와 연계된 변수를 추출하는 변수 추출부, 상기 스마트 컨트랙트의 주소 정보에 기초하여 상기 스마트 컨트랙트와 연계된 상태값을 추출하는 상태 추출부, 추출된 상기 변수 및 상기 상태값을 매핑하는 매핑부 및 매핑된 상기 변수 및 상기 상태값을 시각화하여 표시하는 표시부를 포함할 수 있다.On the other hand, the control device for a smart contract according to an embodiment of the present application, a variable extraction unit for extracting a variable associated with the smart contract by parsing the source code of the issued smart contract, based on the address information of the smart contract A state extracting unit for extracting a state value associated with the smart contract, a mapping unit for mapping the extracted variable and the state value, and a display unit for visualizing and displaying the mapped variable and the state value.

또한, 상기 변수 추출부는, 상기 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리를 생성하고, 상기 추상 구문 트리에 기초하여 상기 스마트 컨트랙트와 연계된 변수 각각의 데이터 유형 및 변수명을 추출할 수 있다.In addition, the variable extraction unit may generate an abstract syntax tree based on a result of parsing the source code, and extract a data type and variable name of each variable associated with the smart contract based on the abstract syntax tree. .

또한, 상기 상태 추출부는, 상기 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터를 획득하고, 상기 부호화된 데이터를 상기 상태값으로 변환할 수 있다.In addition, the state extraction unit may obtain encoded data through a Blockchain API based on the address information of the smart contract, and convert the encoded data into the state value.

또한, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치는, 기 학습된 인공 지능 알고리즘에 기초하여 적어도 하나 이상의 스마트 컨트랙트에 대하여 상기 상태값의 변화 패턴이 비정상적인 것으로 판단되는 경우 해당 스마트 컨트랙트의 이상을 탐지하는 이상 탐지부를 포함할 수 있다.In addition, the control device for a smart contract according to an embodiment of the present application is, based on a previously learned artificial intelligence algorithm, when it is determined that the change pattern of the state value for at least one smart contract is abnormal, the smart contract is abnormal. It may include an abnormality detection unit that detects.

상술한 과제 해결 수단은 단지 예시적인 것으로서, 본원을 제한하려는 의도로 해석되지 않아야 한다. 상술한 예시적인 실시예 외에도, 도면 및 발명의 상세한 설명에 추가적인 실시예가 존재할 수 있다.The above-described problem solving means are merely exemplary and should not be construed as limiting the present application. In addition to the above-described exemplary embodiments, additional embodiments may exist in the drawings and detailed description of the invention.

전술한 본원의 과제 해결 수단에 의하면, 이더리움 등의 블록체인 시스템에서 제공되는 스마트 컨트랙트에 대한 소스코드 분석, 상태 값 정보 추출 등을 통해 사용자가 쉽게 이해할 수 있도록 스마트 컨트랙트에 대한 정보를 제공하는 스마트 컨트랙트에 대한 관제 장치 및 방법을 제공할 수 있는 효과가 있다.According to the above-described problem solving means of the present application, smart contracts that provide information on smart contracts so that users can easily understand them through source code analysis and state value information extraction for smart contracts provided by blockchain systems such as Ethereum. There is an effect that can provide a control device and method for a contract.

전술한 본원의 과제 해결 수단에 의하면, 스마트 컨트랙트에 대한 정보를 그래프, 타임라인 형태 등으로 시각화하여 제공함으로써, 사용자가 용이하게 스마트 컨트랙트의 상태를 확인할 수 있다.According to the above-described problem solving means of the present application, information on the smart contract is visualized and provided in the form of a graph or a timeline, so that a user can easily check the status of the smart contract.

전술한 본원의 과제 해결 수단에 의하면, 이더리움 등의 블록체인 시스템에서 제공되는 복수의 스마트 컨트랙트의 이상 상황 또는 악의적인 사용을 감지하여 즉각적인 조치가 가능하며 지속적인 추적이 가능하도록 하는 스마트 컨트랙트에 대한 관제 장치 및 방법을 제공할 수 있다.According to the above-described problem solving means of the present application, it is possible to detect an abnormal situation or malicious use of a plurality of smart contracts provided by a blockchain system such as Ethereum and take immediate action and control a smart contract that enables continuous tracking. Apparatus and method can be provided.

전술한 본원의 과제 해결 수단에 의하면, 개발자, 사용자 등의 여러 이해관계자들에게 스마트 컨트랙트에 대한 다양한 상태 정보를 제공하여 스마트 컨트랙트 동작에 대한 이해도를 높임으로써, 개발자는 다음 스마트 컨트랙트 개발 시 향상된 품질의 스마트 컨트랙트를 제작하도록 유도하고, 사용자는 모니터링 정보를 기반으로 하여 신뢰도 및 안정성이 향상된 거래를 수행하도록 할 수 있다.According to the above-described problem solving means of the present application, by providing various status information about the smart contract to various stakeholders such as developers and users, the degree of understanding of the operation of the smart contract is improved, so that the developer can improve the quality of the next smart contract development. Induce the creation of smart contracts, and users can perform transactions with improved reliability and stability based on monitoring information.

다만, 본원에서 얻을 수 있는 효과는 상기된 바와 같은 효과들로 한정되지 않으며, 또 다른 효과들이 존재할 수 있다.However, the effect obtainable in the present application is not limited to the above-described effects, and other effects may exist.

도 1은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치를 포함하는 블록체인 관제 시스템의 개략적인 구성도이다.
도 2는 Blockchain API를 통해 스마트 컨트랙트에 대한 상태값을 추출하는 것을 설명하기 위한 개념도이다.
도 3은 Level DB를 통해 스마트 컨트랙트에 대한 상태값을 추출하는 것을 설명하기 위한 개념도이다.
도 4는 추출된 변수 및 상태값을 매핑하는 것을 설명하기 위한 개념도이다.
도 5는 본원의 일 실시예에 따른 매핑된 변수 및 상태값을 타임라인 형태로 표시하는 화면을 나타낸 도면이다.
도 6은 본원의 일 실시예에 따른 매핑된 변수 및 상태값을 포함하여 스마트 컨트랙트와 연계된 정보를 표시하는 화면을 나타낸 도면이다.
도 7은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치가 복수의 발행된 스마트 컨트랙트 중 비정상적인 것으로 판단된 스마트 컨트랙트에 대한 이상을 탐지하는 것을 설명하기 위한 도면이다.
도 8은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치의 개략적인 구성도이다.
도 9는 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 방법의 동작 흐름도이다.
1 is a schematic configuration diagram of a block chain control system including a control device for a smart contract according to an embodiment of the present application.
2 is a conceptual diagram illustrating extracting a state value for a smart contract through a Blockchain API.
3 is a conceptual diagram illustrating extracting a state value for a smart contract through a level DB.
4 is a conceptual diagram illustrating mapping of extracted variables and state values.
5 is a diagram illustrating a screen displaying mapped variables and state values in the form of a timeline according to an exemplary embodiment of the present disclosure.
6 is a diagram illustrating a screen displaying information associated with a smart contract, including mapped variables and state values according to an exemplary embodiment of the present disclosure.
7 is a view for explaining that the control device for a smart contract according to an embodiment of the present application detects an abnormality in a smart contract determined to be abnormal among a plurality of issued smart contracts.
8 is a schematic configuration diagram of a control device for a smart contract according to an embodiment of the present application.
9 is a flowchart illustrating an operation of a control method for a smart contract according to an embodiment of the present application.

아래에서는 첨부한 도면을 참조하여 본원이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본원의 실시예를 상세히 설명한다. 그러나 본원은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본원을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings so that those of ordinary skill in the art may easily implement the present application. However, the present application may be implemented in various different forms and is not limited to the embodiments described herein. In addition, in the drawings, parts irrelevant to the description are omitted in order to clearly describe the present application, and similar reference numerals are attached to similar parts throughout the specification.

본원 명세서 전체에서, 어떤 부분이 다른 부분과 "연결"되어 있다고 할 때, 이는 "직접적으로 연결"되어 있는 경우뿐 아니라, 그 중간에 다른 소자를 사이에 두고 "전기적으로 연결" 또는 "간접적으로 연결"되어 있는 경우도 포함한다. Throughout the present specification, when a part is said to be "connected" with another part, it is not only the case that it is "directly connected", but also "electrically connected" or "indirectly connected" with another element interposed therebetween. "Including the case.

본원 명세서 전체에서, 어떤 부재가 다른 부재 "상에", "상부에", "상단에", "하에", "하부에", "하단에" 위치하고 있다고 할 때, 이는 어떤 부재가 다른 부재에 접해 있는 경우뿐 아니라 두 부재 사이에 또 다른 부재가 존재하는 경우도 포함한다.Throughout the present specification, when a member is positioned "on", "upper", "upper", "under", "lower", and "lower" of another member, this means that a member is located on another member. This includes not only the case where they are in contact but also the case where another member exists between the two members.

본원 명세서 전체에서, 어떤 부분이 어떤 구성 요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성 요소를 제외하는 것이 아니라 다른 구성 요소를 더 포함할 수 있는 것을 의미한다.In the entire specification of the present application, when a certain part "includes" a certain component, it means that other components may be further included rather than excluding other components unless specifically stated to the contrary.

본원은 스마트 컨트랙트에 대한 관제 장치 및 방법에 관한 것이다.The present application relates to a control device and method for a smart contract.

도 1은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치를 포함하는 블록체인 관제 시스템의 개략적인 구성도이다.1 is a schematic configuration diagram of a block chain control system including a control device for a smart contract according to an embodiment of the present application.

도 1을 참조하면, 본원의 일 실시예에 따른 블록체인 관제 시스템(10)은, 스마트 컨트랙트가 배포되고, 사용자(20)에 의해 발생한 트랜잭션(Transaction)에 의해 배포된 스마트 컨트랙트가 변동되는 블록 체인(Blockchain) 영역과 스마트 컨트랙트에 대한 관제 장치(100)를 포함하고 배포된 스마트 컨트랙트에 대한 모니터링이 이루어지는 관제(Monitoring) 영역을 포함할 수 있다.Referring to FIG. 1, the blockchain control system 10 according to an embodiment of the present application is a blockchain in which a smart contract is distributed and a smart contract distributed by a transaction generated by a user 20 is changed. It may include a (Blockchain) area and a control device 100 for smart contracts, and a monitoring area in which monitoring of deployed smart contracts is performed.

본원에서의 '스마트 컨트랙트'는 블록체인 기술을 이용하여 대금 결제, 송금 등의 금융거래뿐만 아니라 임의의 유형의 계약을 처리할 수 있도록 확장된 것을 의미할 수 있다. 달리 말해, 스마트 컨트랙트는 코드를 활용한 디지털 계약서로 이해될 수 있으며, 계약 조건이 충족되면 코드 순서대로 계약이 자동적으로 이행될 수 있다. 특히, 본원에서의 스마트 컨트랙트는 가상화폐의 유형 중 스마트 컨트랙트의 개념을 가장 활발히 적용한 이더리움(Ethereum)을 대상으로 하는 것일 수 있으나, 이에만 한정되는 것은 아니고 블록체인을 통해 임의의 계약 기능을 제공하는 종래의 공지되었거나 향후 개발되는 모든 가상화폐 유형, 플랫폼 등(예를 들면, 넥스레저(NexLedger) 등)에 적용되는 것일 수 있다.The term'smart contract' in the present application may mean an extension to be able to process any type of contract as well as financial transactions such as payment and remittance using blockchain technology. In other words, smart contracts can be understood as digital contracts using codes, and when contract conditions are satisfied, contracts can be automatically executed in code order. In particular, the smart contract in the present application may target Ethereum, which actively applies the concept of a smart contract among the types of virtual currency, but is not limited to this and provides arbitrary contract functions through a blockchain. It may be applied to all conventionally known or future developed virtual currency types, platforms, etc. (eg, NexLedger, etc.).

특히, 이더리움을 대상으로 하는 스마트 컨트랙트는 Solidity 코드를 컴파일 한 Bytecode의 형태로 블록체인 네트워크(이더리움 네트워크)에 배포될 수 있으며, 사용자(네트워크 참여자)는 배포된 스마트 컨트랙트를 활용하여 거래를 진행할 수 있다. In particular, smart contracts targeting Ethereum can be distributed to the blockchain network (Ethereum network) in the form of Bytecode compiled with Solidity code, and users (network participants) can proceed with transactions using the deployed smart contract. I can.

이하에서는, 도 2 내지 도 6을 참조하여, 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치(100)가 스마트 컨트랙트에 대한 소스코드 분석, 상태 값 정보 추출 등을 통해 배포된 스마트 컨트랙트에 대한 정보를 획득(분석)하고 이를 사용자에게 제공하는 실시예에 관하여 상세히 서술하도록 한다.In the following, with reference to FIGS. 2 to 6, the control device 100 for a smart contract according to an embodiment of the present application analyzes the source code for the smart contract, extracts state value information, etc. for the distributed smart contract. An embodiment of acquiring (analyzing) information and providing it to a user will be described in detail.

본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치(100)(이하, '관제 장치(100)'라 한다.)는, 발행된 스마트 컨트랙트의 소스코드를 파싱하여 스마트 컨트랙트와 연계된 변수(1)를 추출할 수 있다.According to an embodiment of the present application The control device 100 for the smart contract (hereinafter, referred to as “control device 100”) may extract the variable 1 associated with the smart contract by parsing the source code of the issued smart contract.

참고로, 본원의 일 실시예에 따른 스마트 컨트랙트의 소스코드는 해당 스마트 컨트랙트의 배포를 위하여 Bytecode 형태로 컴파일된 Solidity 코드를 의미하는 것일 수 있다. 실시예에 따라, 본원에서의 소스코드는 실행 코드(Execution Code) 등으로 달리 지칭될 수 있다.For reference, the source code of the smart contract according to the embodiment of the present application may mean a solidity code compiled in a bytecode format for distribution of the corresponding smart contract. Depending on the embodiment, the source code herein may be referred to differently as an execution code or the like.

본원의 일 실시예에 따르면, 관제 장치(100)는 Antlr-js 등의 솔리디티 파서(Solidity Parser)를 활용하여 소스코드를 파싱할 수 있다.According to an embodiment of the present application, the control device 100 may parse the source code using a solidity parser such as Antlr-js.

구체적으로 본원의 일 실시예에 따르면, 관제 장치(100)는 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리(Abstract Syntax Tree, AST)를 생성할 수 있다. 또한, 관제 장치(100)는 생성된 추상 구문 트리에 기초하여 스마트 컨트랙트와 연계된 변수(1) 각각의 데이터 유형(1a) 및 변수명(1b)를 추출할 수 있다.Specifically, according to the exemplary embodiment of the present application, the control device 100 may generate an abstract syntax tree (AST) based on a result of parsing the source code. Also, the control device 100 may extract a data type 1a and a variable name 1b of each variable 1 associated with the smart contract based on the generated abstract syntax tree.

또한, 관제 장치(100)는 스마트 컨트랙트의 주소 정보에 기초하여 스마트 컨트랙트와 연계된 상태값(2)을 추출할 수 있다. 여기서, 스마트 컨트랙트와 연계된 상태값(2)이란, 배포된 스마트 컨트랙트의 전역 변수(global variable)에 대하여 할당된 값을 의미하는 것일 수 있다.In addition, the control device 100 may extract the state value 2 associated with the smart contract based on the address information of the smart contract. Here, the state value 2 associated with the smart contract may mean a value assigned to a global variable of the deployed smart contract.

도 2는 Blockchain API를 통해 스마트 컨트랙트에 대한 상태값을 추출하는 것을 설명하기 위한 개념도이다.2 is a conceptual diagram illustrating extracting a state value for a smart contract through a Blockchain API.

도 2를 참조하면, 본원의 일 실시예에 따른 관제 장치(100)는 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터(Encoded data, 2')를 획득할 수 있다. 또한, 관제 장치(100)는 부호화된 데이터(2')를 상태값(2)으로 변환할 수 있다. 여기서, API는 본원에서의 스마트 컨트랙트와 연계된 블록체인 네트워크에서 활용 가능한 Application Programming Interface를 지칭하는 것으로, API에 관한 사항은 통상의 기술자에게 자명한 것이므로 구체적인 설명은 생략한다.Referring to FIG. 2, the control device 100 according to an exemplary embodiment of the present disclosure may acquire encoded data (Encoded data, 2') through a Blockchain API based on address information of a smart contract. In addition, the control device 100 may convert the encoded data 2 ′ into a state value 2. Here, the API refers to an Application Programming Interface that can be used in the blockchain network linked to the smart contract in the present application, and details about the API are obvious to those of ordinary skill in the art, so a detailed description will be omitted.

또한, 실시예에 따라 관제 장치(100)는 스마트 컨트랙트의 주소 정보에 기초하여 getStorageAt 함수를 통해 부호화된 데이터(Encoded data, 2')를 획득하도록 구현될 수 있다. 참고로, getStorageAt 함수는 스마트 컨트랙트의 상태값과 관련하여 EVM 메모리 구조에 적합한 16진수의 형태로 변환된 부호화된 데이터(예를 들면, 0Xfab242534234030001 등의 형태)를 출력하는 함수일 수 있다. 아울러, getStorageAt 함수를 통해 부호화된 데이터(2')를 획득하는 방식은 본원이 적용되는 블록 체인의 유형이 이더리움과 연계된 것일 때 특히 활용될 수 있다.또한, 부호화된 데이터(2')에 대한 상태값(2)으로의 변환과 관련하여, 본원의 일 실시예에 따른 관제 장치(100)는 획득된 부호화된 데이터(Encoded data, 2')(달리 말해, 부호화된 값)을 가져오고, 파서에 의해 추출한 데이터를 활용하여 부호화된 데이터(2')를 상태값(2)으로 변환하는 것일 수 있다.In addition, according to an embodiment, the control device 100 may be implemented to obtain encoded data (2') through the getStorageAt function based on the address information of the smart contract. For reference, the getStorageAt function may be a function that outputs encoded data (for example, in the form of 0Xfab242534234030001) converted into a hexadecimal form suitable for the EVM memory structure in relation to the state value of the smart contract. In addition, the method of obtaining the encoded data (2') through the getStorageAt function can be particularly utilized when the type of the block chain to which the present application is applied is linked to Ethereum. In addition, in the encoded data (2') In relation to the conversion to the state value 2 for, the control device 100 according to an embodiment of the present application obtains the obtained encoded data (2') (in other words, an encoded value), It may be to convert the encoded data 2'into a state value 2 by using the data extracted by the parser.

도 3은 Level DB를 통해 스마트 컨트랙트에 대한 상태값을 추출하는 것을 설명하기 위한 개념도이다.3 is a conceptual diagram illustrating extracting a state value for a smart contract through a level DB.

도 3을 참조하면, 본원의 다른 실시예에 따른 관제 장치(100)는 스마트 컨트랙트의 주소 정보에 기초하여 Level DB를 통해 상태값을 추출할 수 있다. 구체적으로, 본원의 다른 실시예에 따른 관제 장치(100)는 Geth에 의해 저장된 블록체인 Level DB를 복사할 수 있다. 또한, 관제 장치(100)는 복사된 Level DB(Replicated Level DB)로부터 Storage Trie(예를 들어, 도 3의 Contract Storage Merkle Patricia Trie)를 추출할 수 있다. 또한, 관제 장치(100)는 추출된 Storage Trie에 RLP 디코딩(RLP Decode)을 수행하여 부호화된 데이터(Encoded data, 2')를 획득할 수 있다. 또한, 관제 장치(100)는 부호화된 데이터(2')를 상태값(2)으로 변환할 수 있다.Referring to FIG. 3, the control device 100 according to another embodiment of the present application may extract a state value through a Level DB based on address information of a smart contract. Specifically, the control device 100 according to another embodiment of the present application may copy the Blockchain Level DB stored by Geth. In addition, the control device 100 may extract a Storage Trie (eg, Contract Storage Merkle Patricia Trie of FIG. 3) from the copied Level DB (Replicated Level DB). In addition, the control device 100 may obtain encoded data (2') by performing RLP decoding on the extracted Storage Trie. In addition, the control device 100 may convert the encoded data 2 ′ into a state value 2.

참고로, Level DB는 오픈 소스(Open-Source) 기반 온-디스크(on-disk) 키/밸류 저장소일 수 있다. 구체적으로, Level DB는 키값 및 밸류값을 임의의 바이트 배열로 저장하고, 데이터가 키별로 정렬되어 저장되는 특징을 갖는 데이터베이스일 수 있다. 또한, Geth는 Go 언어로 개발된 이더리움 기반의 블록체인 클라이언트 소프트웨어(Goetherium)를 의미할 수 있다. 또한, 상기의 Storage Trie는 스마트 컨트랙트의 상태(예를 들면, 변수의 값)를 저장하는 머클 패트리샤 트리(Merkle Patricia Trie )일 수 있다. 이러한, Stroage Trie는 이더리움의 경우 솔리디티 코드의 전역 변수(global variable)를 저장할 수 있다. 또한, 상술한 RLP는 이더리움 등에서 상태, 트랙잭션 정보 등이 머클 패트리샤 트리에 키(Key)/밸류(Value) 형태로 저장되는 경우, 밸류(Value) 주소와 연계된 여러 정보들을 직렬화하여 삽입하기 위하여 사용되는 인코딩/디코딩 방법을 지칭하는 것일 수 있다.For reference, Level DB may be an open-source-based on-disk key/value storage. Specifically, the Level DB may be a database having a characteristic of storing key values and value values in an arbitrary byte array, and storing data sorted by key. In addition, Geth can mean Ethereum-based blockchain client software (Goetherium) developed in the Go language. In addition, the Storage Trie may be a Merkle Patricia Trie that stores the state of a smart contract (eg, a value of a variable). In the case of Ethereum, Stroage Trie can store a global variable of Solidity code. In addition, the above-described RLP is to serialize and insert various information related to the value address when the state and transaction information, etc. are stored in the Merkle Patricia tree in the form of a key/value in Ethereum, etc. It may refer to the encoding/decoding method used.

또한, 관제 장치(100)는 추출된 변수(1) 및 상태값(2)을 매핑할 수 있다.In addition, the control device 100 may map the extracted variable 1 and the state value 2.

도 4는 추출된 변수 및 상태값을 매핑하는 것을 설명하기 위한 개념도이다.4 is a conceptual diagram illustrating mapping of extracted variables and state values.

도 4를 참조하면, 본원의 일 실시예에 따른 관제 장치(100)는 추출된 변수(1) 각각에 대하여 변수(1)와 추출된 상태값(2) 간의 대응 관계를 매핑을 통해 파악할 수 있다. 예시적으로 도 4를 참조하면, 관제 장치(100)는 제1 변수인 이름(데이터 유형: String, 변수명: name)에 대응되는 상태값인 'Hong'을 제1 변수에 대하여 매핑하고, 제2 변수인 나이(데이터 유형: int, 변수명: age)에 대응되는 상태값인 '28'을 제2 변수에 대하여 매핑하도록 동작할 수 있다.Referring to FIG. 4, the control device 100 according to an exemplary embodiment of the present disclosure may determine a correspondence relationship between the variable 1 and the extracted state value 2 for each of the extracted variables 1 through mapping. . For example, referring to FIG. 4, the control device 100 maps'Hong', which is a status value corresponding to a name (data type: String, variable name: name), which is a first variable to the first variable, and 2 It is possible to operate to map the state value '28' corresponding to the variable age (data type: int, variable name: age) to the second variable.

본원의 일 실시예에 따르면, 관제 장치(100)는 도 4와 같이 매핑된 변수(1)와 상태값(2)을 등호(=)를 통해 대응 관계를 표시한 테이블 형태로 매핑 결과를 도출하여 저장할 수 있으나, 이에만 한정되는 것은 아니다. 본원의 일 실시예에 따르면, 매핑 결과가 저장되는 테이블은 복수의 슬롯(Slot)을 포함하고, 각각의 슬롯(Slot)의 크기는 256bit일 수 있다. 이 때, 관제 장치(100)는 추출된 변수(1)의 데이터 유형(1a)에 따라 매핑된 상태값(2)을 하나 이상의 슬롯(Slot)에 할당할 수 있다.According to an embodiment of the present application, the control device 100 derives the mapping result in the form of a table indicating the correspondence relationship between the mapped variable (1) and the state value (2) as shown in FIG. 4 through an equal sign (=). It can be stored, but is not limited thereto. According to an exemplary embodiment of the present disclosure, a table in which a mapping result is stored includes a plurality of slots, and the size of each slot may be 256 bits. In this case, the control device 100 may allocate the mapped state value 2 to one or more slots according to the data type 1a of the extracted variable 1.

예를 들어, 관제 장치(100)는 추출된 변수(1)의 데이터 유형(1a)이 int인 경우, int 형의 변수(1)는 256bit이므로 하나의 슬롯(Slot)에 매핑된 상태값(2)이 저장할 수 있다. 이와 달리, 변수(1)의 데이터 유형(1a)이 int64인 경우, int64 형의 변수(1)는 64bit를 사용하므로, 관제 장치(100)는 4개의 int64 형의 상태값(2)을 하나의 슬롯(Slot)에 저장하여 관리하도록 동작할 수 있다.For example, if the data type (1a) of the extracted variable (1) is int, the control device 100 has a state value (2) mapped to one slot because the int-type variable (1) is 256 bits. ) Can be saved. On the other hand, when the data type (1a) of the variable (1) is int64, the variable (1) of the int64 type uses 64 bits. It can be operated to store and manage in a slot.

또한, 관제 장치(100)는 매핑된 변수(1) 및 상태값(2)을 시각화하여 표시할 수 있다. 본원의 일 실시예에 따르면, 관제 장치(100)는 매핑된 변수(1) 및 상태값(2)을 시각화한 화면을 출력(표시)하는 디스플레이 모듈을 구비하여 구비된 디스플레이 모듈을 통해 매핑된 변수(1) 및 상태값(2)을 시각화한 화면을 출력하도록 동작할 수 있으나, 이에만 한정되는 것은 아니다. 다른 예로, 관제 장치(100)는 매핑된 변수(1) 및 상태값(2)에 대한 시각화 결과 정보를 별도의 사용자 단말(미도시)로 전송하고, 시각화 결과 정보를 수신한 사용자 단말에 구비된 디스플레이 상에서 해당 매핑된 변수(1) 및 상태값(2)을 시각화한 화면이 출력되도록 구현될 수 있다.In addition, the control device 100 may visualize and display the mapped variable 1 and the state value 2. According to an embodiment of the present application, the control device 100 includes a display module for outputting (displaying) a screen visualizing the mapped variable 1 and the state value 2, and the mapped variable It can be operated to output a screen visualizing (1) and the state value (2), but is not limited thereto. As another example, the control device 100 transmits the visualization result information for the mapped variable 1 and the state value 2 to a separate user terminal (not shown), and is provided in the user terminal receiving the visualization result information. A screen visualizing the mapped variable 1 and the state value 2 may be displayed on the display.

도 5는 본원의 일 실시예에 따른 매핑된 변수 및 상태값을 타임라인 형태로 표시하는 화면을 나타낸 도면이다.5 is a diagram illustrating a screen displaying mapped variables and state values in the form of a timeline according to an exemplary embodiment of the present disclosure.

도 5를 참조하면, 관제 장치(100)는 매핑된 변수(1) 및 상태값(2)을 타임라인 형태로 표시할 수 있다. 여기서, 관제 장치(100)에 의해 생성된 타임라인 상에는 상태값(2)이 변화한 시점(예를 들어, 해당 스마트 컨트랙트의 상태가 임의의 사용자에 의한 트랜잭션(Transaction)에 의해 변동된 시점)에 대응하는 지점이 상태값(2)이 변화하지 않고 유지된 다른 영역과 구분되도록 표시될 수 있다.Referring to FIG. 5, the control device 100 may display the mapped variable 1 and the state value 2 in the form of a timeline. Here, on the timeline generated by the control device 100, at the time when the state value 2 changes (for example, when the state of the corresponding smart contract is changed by a transaction by an arbitrary user). The corresponding point may be displayed to be distinguished from other areas where the state value 2 remains unchanged.

본원의 일 실시예에 따르면, 타임라인 형태의 화면은 시간의 흐름을 가로 축으로 하는 막대 형태로 구비(블록의 시간 순 배열)되고, 상태값(2)이 변화한 시점에 대응하는 막대 내의 소정의 위치에 다른 영역과 구분되게 식별될 수 있는 식별 표지(예를 들면, 도형 형태, 색상 변화, 마크 등)가 삽입될 수 있다. 사용자가 타임라인 형태의 화면에서 관제 장치(100) 또는 시각화 화면을 출력하는 별도의 사용자 단말(미도시)에 소정의 식별 표지를 선택하는 사용자 입력을 인가(예를 들어, 식별 표지를 클릭하거나 터치하는 등의 동작)하는 경우, 해당 식별 표지에 대응하는 스마트 컨트랙트의 상태값 변화 정보가 표시될 수 있다.According to an embodiment of the present application, the screen in the form of a timeline is provided in a bar shape with the passage of time as a horizontal axis (arrangement of blocks in chronological order), and a predetermined value in the bar corresponding to the time point at which the state value 2 changes. An identification mark (eg, shape shape, color change, mark, etc.), which can be distinguished from other areas, may be inserted at the location of. The user applies a user input for selecting a predetermined identification mark to the control device 100 or a separate user terminal (not shown) that outputs a visualization screen on a timeline-type screen (for example, clicking or touching the identification mark) In the case of an operation, such as), information on a change in the state value of the smart contract corresponding to the corresponding identification mark may be displayed.

본원의 일 실시예에 따르면, 스마트 컨트랙트의 상태값 변화 정보는 현재 블록 번호(Block Number), Tx 정보, 상태값이 변화하기 이전의 블록(PreBlock)에 포함된 상태값 정보, 상태값이 변화한 후의 블록(CurrentBlock)에 포함된 상태값 정보 등을 포함할 수 있다. 다만, 이에만 한정되는 것은 아니며, 스마트 컨트랙트의 상태 변화와 연계된 다양한 정보가 표시되도록 구현될 수 있다.According to an embodiment of the present application, the state value change information of the smart contract is the current block number (Block Number), Tx information, state value information included in the block (PreBlock) before the state value changes, and the state value is changed. State value information, etc. included in a later block (CurrentBlock) may be included. However, the present invention is not limited thereto, and various information related to the state change of the smart contract may be displayed.

예시적으로 도 5를 참조하면, 관제 장치(100)가 사용자가 마우스 커서를 갖다대거나 클릭한 식별 표지에 대응하는 상태값 변화 정보를 제공함으로써, 사용자는 스마트 컨트랙트의 상태값 중 제1변수인 이름과 관련하여 기존 블록에서는 'Kim' 이었다가 해당 식별 표지에 대응하는 시점에 변화하여 현재 블록에서는 'Hong'으로 변동되었음을 확인할 수 있고, 제2변수인 나이와 관련하여 기존 블록에서는 '10'이었다가 해당 식별 표지에 대응하는 시점에 변화하여 현재 블록에서는 '28'로 변동되었음을 확인할 수 있다.For example, referring to FIG. 5, the control device 100 provides status value change information corresponding to the identification mark that the user places or clicks on the mouse cursor, so that the user has a name that is the first variable among the status values of the smart contract. In relation to this, it can be confirmed that it was'Kim' in the existing block and changed to'Hong' in the current block by changing at the time point corresponding to the corresponding identification mark. In relation to the second variable, age, it was '10' in the existing block It can be confirmed that the current block has changed to '28' by changing at the time point corresponding to the corresponding identification mark.

또한, 본원의 일 실시예에 따르면, 관제 장치(100)는 소정의 변수에 대한 시간에 따른 상태값 변화를 나타낸 그래프 형태로 매핑된 변수(1) 및 상태값(2)을 표시할 수 있다. 예를 들어, 사용자가 관제 장치(100) 또는 시각화된 화면을 출력하는 별도의 사용자 단말(미도시)에 소정의 변수(1)를 선택하는 사용자 입력을 인가하는 경우, 선택된 변수(1)에 대한 매핑된 상태값(2)의 시간에 따른 변화 추이를 나타내는 그래프가 관제 장치(100) 또는 사용자 단말(미도시)에 표시되도록 구현될 수 있다.In addition, according to the exemplary embodiment of the present disclosure, the control device 100 may display the mapped variable 1 and the state value 2 in the form of a graph representing a change in a state value over time for a predetermined variable. For example, when a user applies a user input for selecting a predetermined variable 1 to the control device 100 or a separate user terminal (not shown) that outputs a visualized screen, A graph indicating a change trend of the mapped state value 2 over time may be implemented to be displayed on the control device 100 or a user terminal (not shown).

도 6은 본원의 일 실시예에 따른 매핑된 변수 및 상태값을 포함하여 스마트 컨트랙트와 연계된 정보를 표시하는 화면을 나타낸 도면이다.6 is a diagram illustrating a screen displaying information associated with a smart contract including mapped variables and state values according to an exemplary embodiment of the present disclosure.

도 6을 참조하면, 관제 장치(100)는 매핑된 변수(1) 및 상태값(2)을 포함하여 스마트 컨트랙트와 연계된 다양한 정보를 표시하는 화면을 관제 장치(100)의 디스플레이 모듈(예를 들면, 표시부(140))을 통해 출력하거나 스마트 컨트랙트와 연계된 다양한 정보를 표시하는 시각화 결과 정보를 사용자 단말(미도시)로 전송할 수 있다.Referring to FIG. 6, the control device 100 displays a screen displaying various information related to the smart contract, including the mapped variable 1 and the state value 2, in a display module of the control device 100 (for example, For example, the visualization result information outputting through the display unit 140 or displaying various information related to the smart contract may be transmitted to a user terminal (not shown).

본원의 일 실시예에 따르면, 매핑된 변수(1) 및 상태값(2)을 포함하는 스마트 컨트랙트와 연계된 정보 표시 화면에는, 스마트 컨트랙트 주소 정보(a), 스마트 컨트랙트의 컴파일러 버전 정보(b), 스마트 컨트랙트의 소스 코드(예를 들면, Solidity 코드) 정보(c), 스마트 컨트랙트의 전체 변수(1) 별 상태값(2) 정보(d), 스마트 컨트랙트의 숫자 타입의 데이터 유형을 가지는 소정의 변수(1)에 대한 상태값(2) 변화 추이 그래프(e), 문자 타입의 데이터 유형을 가지는 소정의 변수(1)에 대한 상태값(2) 변화 추이 그래프(f), 지역별 스마트 컨트랙트 사용 빈도 정보(g) 등이 포함될 수 있으나, 이에만 한정되는 것은 아니고, 변수 및 상태 변화, 트랜잭션 발생 정보, 사용 패턴, 함수별 사용 빈도, 가상화폐 수량(이더량) 변동 정보, 가상화폐 거래 정보 등 배포된 스마트 컨트랙트와 연계된 다양한 정보가 표시될 수 있다.According to an embodiment of the present application, on the information display screen associated with the smart contract including the mapped variable (1) and the state value (2), the smart contract address information (a), the compiler version information of the smart contract (b) , Smart contract source code (e.g., Solidity code) information (c), status value for each variable (1) of the smart contract (2) information (d), a predetermined data type of the smart contract's numeric type. Status value for variable (1) (2) Change trend graph (e), Status value for a given variable (1) with character type data type (2) Change trend graph (f), Smart contract usage frequency by region Information (g) may be included, but is not limited thereto, and distribution of variable and state change, transaction occurrence information, usage pattern, frequency of use by function, virtual currency quantity (ether amount) change information, virtual currency transaction information, etc. Various information related to the created smart contract can be displayed.

이더리움을 통해 발행되는 스마트 컨트랙트의 경우, get 함수를 활용하여 사용자 등이 변수의 상태를 확인할 수 있지만, 이는 해당 변수가 발행(배포) 시에 Public으로 선언되었을 것을 전제 조건으로 하며, Public으로 선언되지 않은 변수의 경우 get function 기능을 활용해야 하나 이러한 방식의 경우 Tx를 발행해야 하므로 사용자 등에게 별도의 수수료 부담이 부과되는 한계가 있었다. 이와 달리, 본원의 관제 장치(100)는 스마트 컨트랙트에 대한 다양한 상태 정보를 사용자(20), 개발자(30) 등을 포함하는 여러 이해 관계인이 손쉽게 확인할 수 있도록 시각화하여 제공하는 이점이 있다.In the case of smart contracts issued through Ethereum, users can check the status of variables by using the get function, but this is a prerequisite that the variable has been declared as public at the time of issuance (distribution), and is declared as public. In the case of a variable that is not available, the get function function should be used, but in this method, Tx has to be issued, so there is a limitation that a separate fee burden is imposed on the user. In contrast, the control device 100 of the present application has the advantage of providing a variety of status information on the smart contract by visualizing it so that various stakeholders, including the user 20 and the developer 30, can easily check.

또한, 관제 장치(100)는 스마트 컨트랙트의 이상을 탐지할 수 있다. 본원의 일 실시예에 따르면, 관제 장치(100)는 기 학습된 인공 지능 알고리즘에 기초하여 소정의 변수(1)에 대한 상태값(2)의 변화 패턴이 비정상적인 것으로 판단되는 경우 이상을 탐지하도록 동작할 수 있다. 특히, 본원에서의 기 학습된 인공 지능 알고리즘은 Txs, Balance 등의 지표들을 활용하여 비정상적인 상황을 식별하도록 학습된 것일 수 있다.In addition, the control device 100 may detect an abnormality in the smart contract. According to an embodiment of the present application, the control device 100 operates to detect an abnormality when it is determined that the change pattern of the state value 2 for the predetermined variable 1 is abnormal based on a previously learned artificial intelligence algorithm. can do. In particular, the artificial intelligence algorithm previously learned in the present application may be learned to identify an abnormal situation using indicators such as Txs and Balance.

본원의 일 실시예에 따르면, 스마트 컨트랙트의 이상을 탐지하기 위한 기 학습된 인공 지능 알고리즘은 로지스틱 회귀 분석(Logistic Regression), 랜덤 포레스트(Random Forest), 딥 러닝(Deep Learning), 서포트 벡터 머신(Supprot Vector Machine, SVM), 인공신경망(Artificial Neural Network, ANN), 강화 학습(Reinforcement Learning) 등 종래에 공지되었거나 향후 개발되는 모든 종류의 기계 학습 방식을 통해 생성(학습)된 것일 수 있다.According to an embodiment of the present application, a pre-trained artificial intelligence algorithm for detecting anomalies in a smart contract is Logistic Regression, Random Forest, Deep Learning, and Support Vector Machine (Supprot). Vector Machine (SVM), artificial neural network (Artificial Neural Network (ANN)), reinforcement learning (Reinforcement Learning), etc. may be generated (learned) through all kinds of machine learning methods known in the past or developed in the future.

특히, 본원의 일 실시예에 따르면, 관제 장치(100)는 복수의 발행된 스마트 컨트랙트 각각에 대하여 이상을 탐지할 수 있다. 나아가, 관제 장치(100)는 소정의 스마트 컨트랙트에 대한 이상이 탐지된 경우, 경고 및 알림 신호를 생성할 수 있다. 블록체인 네트워크 상에 배포되고 트랜잭션에 의해 다양한 형태로 변동되는 스마트 컨트랙트 각각의 상태를 사람이 확인하고 전체 스마트 컨트랙트를 감시하는 것은 실질적으로 불가능에 가까운 일이다. 따라서, 본원의 관제 장치(100)는 스마트 컨트랙트 각각의 상태 정보(변수 및 변수에 대응되는 상태값의 변화)를 획득하고, 기 학습된 인공 지능 알고리즘을 활용하여 여러 스마트 컨트랙트에 대한 이상을 즉각적으로 탐지할 수 있다.In particular, according to an embodiment of the present application, the control device 100 may detect an abnormality for each of a plurality of issued smart contracts. Furthermore, when an abnormality with respect to a predetermined smart contract is detected, the control device 100 may generate a warning and a notification signal. It is practically impossible for a person to check the status of each smart contract distributed on the blockchain network and change in various forms by transaction and monitor the entire smart contract. Therefore, the control device 100 of the present application acquires state information (variables and changes in state values corresponding to the variables) of each smart contract, and immediately detects abnormalities for several smart contracts using a previously learned artificial intelligence algorithm. Can be detected.

본원의 일 실시예에 따르면, 관제 장치(100)에 의해 생성된 경고 및 알림 신호는 해당 스마트 컨트랙트와 연계된 사용자(20) 및 개발자(30) 중 적어도 하나의 단말로 전송될 수 있다. 또한, 관제 장치(100)는 해당 스마트 컨트랙트와 연계된 사용자(20) 및 개발자(30) 중 적어도 하나의 단말뿐만 아니라, 블록체인 네트워크와 관련된 이해관계인(예를 들면, 정부 관계자 등)의 단말에 함께 경고 및 알림 신호를 전송하도록 동작할 수 있다.According to the exemplary embodiment of the present application, the warning and notification signal generated by the control device 100 may be transmitted to at least one terminal of the user 20 and the developer 30 associated with the corresponding smart contract. In addition, the control device 100 not only the terminal of at least one of the users 20 and the developer 30 associated with the smart contract, but also the terminal of a stakeholder (for example, a government official) related to the blockchain network. Together, they can act to send warning and notification signals.

도 7은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치가 복수의 발행된 스마트 컨트랙트 중 비정상적인 것으로 판단된 스마트 컨트랙트에 대한 이상을 탐지하는 것을 설명하기 위한 도면이다.7 is a view for explaining that the control device for a smart contract according to an embodiment of the present application detects an abnormality in a smart contract determined to be abnormal among a plurality of issued smart contracts.

도 7을 참조하면, 본원의 일 실시예에 따른 관제 장치(100)는 예시적으로 복수의 스마트 컨트랙트(Smart Contract 1 내지 Smart Contract 9) 각각의 소정의 변수(1)(예를 들어, Balance, Txs, Term)에 대한 상태값(2) 변화 추이를 입력으로 하는 기 학습된 인공 지능 알고리즘에 기초하여 소정의 스마트 컨트랙트에 대한 이상을 탐지할 수 있다. 도 7을 참조하면, 예시적으로 Smart Contract 5에 대한 상태값(2)의 변화 패턴이 비정상적인 것으로 판단될 수 있다.Referring to FIG. 7, the control device 100 according to an embodiment of the present application is illustratively a plurality of smart contracts (Smart Contract 1 to Smart Contract 9), each of a predetermined variable 1 (e.g., Balance, Txs, Term) can detect an abnormality in a predetermined smart contract based on a pre-learned artificial intelligence algorithm that inputs the state value (2) change trend. Referring to FIG. 7, as an example, it may be determined that a change pattern of the state value 2 for Smart Contract 5 is abnormal.

본원의 일 실시예에 따르면, 관제 장치(100)에 의해 수행되는 스마트 컨트랙트에 대한 상태 정보 획득, 획득된 상태 정보에 대한 시각화 및 스마트 컨트랙트에 대한 이상 탐지 중 적어도 하나의 프로세스는 기 설정된 모니터링 주기 마다 반복적으로 수행되는 것일 수 있다. 예를 들어, 관제 장치(100)와 연계된 블록체인 네트워크 상에 새로운 블록이 연결될 때마다 전술한 프로세스가 수행되도록 구현될 수 있다. According to an embodiment of the present application, at least one process of acquiring status information for a smart contract performed by the control device 100, visualizing the acquired status information, and detecting anomalies for a smart contract is performed at each preset monitoring period. It may be performed repeatedly. For example, it may be implemented so that the above-described process is performed whenever a new block is connected on a blockchain network linked to the control device 100.

도 8은 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 장치의 개략적인 구성도이다.8 is a schematic configuration diagram of a control device for a smart contract according to an embodiment of the present application.

도 8을 참조하면, 관제 장치(100)는, 변수 추출부(110), 상태 추출부(120), 매핑부(130), 표시부(140) 및 이상 탐지부(150)를 포함할 수 있다.Referring to FIG. 8, the control device 100 may include a variable extraction unit 110, a state extraction unit 120, a mapping unit 130, a display unit 140, and an abnormality detection unit 150.

변수 추출부(110)는, 발행된 스마트 컨트랙트의 소스코드를 파싱하여 해당 스마트 컨트랙트와 연계된 변수(1)를 추출할 수 있다.The variable extracting unit 110 may parse the source code of the issued smart contract to extract the variable 1 associated with the corresponding smart contract.

본원의 일 실시예에 따르면, 변수 추출부(110)는, 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리(AST)를 생성하고, 생성된 추상 구문 트리(AST)에 기초하여 스마트 컨트랙트와 연계된 변수(1) 각각의 데이터 유형(1a) 및 변수명(1b)을 추출할 수 있다.According to an embodiment of the present application, the variable extraction unit 110 generates an abstract syntax tree (AST) based on a parsing result of the source code, and links with a smart contract based on the generated abstract syntax tree (AST). The data type (1a) and variable name (1b) of each of the variables (1) can be extracted.

상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 스마트 컨트랙트와 연계된 상태값(2)을 추출할 수 있다.The state extraction unit 120 may extract a state value 2 associated with the smart contract based on the address information of the smart contract.

본원의 일 실시예에 따르면, 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터(2', Encoded data)를 획득하고, 부호화된 데이터(2')를 상태값(2)으로 변환할 수 있다. 다만, 이에만 한정되는 것은 아니며, 실시예에 따라 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 getStorageAt 함수를 통해 부호화된 데이터(2', Encoded data)를 획득하도록 동작할 수 있다. 또 다른 예로, 상태 추출부(120)는, Level DB를 통해 상태값(2)을 추출할 수 있다.According to an embodiment of the present application, the state extraction unit 120 acquires encoded data 2', Encoded data through the Blockchain API based on the address information of the smart contract, and receives the encoded data 2'. It can be converted into a state value (2). However, the present invention is not limited thereto, and according to an embodiment, the state extraction unit 120 may operate to obtain encoded data (2', Encoded data) through the getStorageAt function based on the address information of the smart contract. . As another example, the state extraction unit 120 may extract the state value 2 through the level DB.

매핑부(130)는, 추출된 변수(1) 및 상태값(2)을 매핑할 수 있다.The mapping unit 130 may map the extracted variable 1 and the state value 2.

표시부(140)는, 매핑된 변수(1) 및 상태값(2)을 시각화하여 표시할 수 있다.The display unit 140 may visualize and display the mapped variable 1 and the state value 2.

본원의 일 실시예에 따르면, 변수 추출부(110), 상태 추출부(120), 매핑부(130) 및 표시부(140)를 포괄하여 관찰부(Observer) 등으로 달리 지칭할 수 있다According to the exemplary embodiment of the present application, the variable extracting unit 110, the state extracting unit 120, the mapping unit 130, and the display unit 140 may be collectively referred to as an observation unit (Observer).

이상 탐지부(150)는, 기 학습된 인공 지능 알고리즘에 기초하여 적어도 하나 이상의 스마트 컨트랙트에 대하여 상태값(2)의 변화 패턴이 비정상적인 것으로 판단되는 경우 해당 스마트 컨트랙트의 이상을 탐지할 수 있다. 실시예에 따라 이상 탐지부(150)는 분석부(Analyzer) 등으로 달리 지칭될 수 있다.The abnormality detection unit 150 may detect an abnormality in the corresponding smart contract when it is determined that the change pattern of the state value 2 is abnormal for at least one smart contract based on a previously learned artificial intelligence algorithm. Depending on the embodiment, the abnormality detection unit 150 may be referred to differently as an analyzer or the like.

이하에서는 상기에 자세히 설명된 내용을 기반으로, 본원의 동작 흐름을 간단히 살펴보기로 한다.Hereinafter, based on the details described above, the operation flow of the present application will be briefly described.

도 9는 본원의 일 실시예에 따른 스마트 컨트랙트에 대한 관제 방법의 동작 흐름도이다.9 is a flowchart illustrating an operation of a control method for a smart contract according to an embodiment of the present application.

도 9에 도시된 스마트 컨트랙트에 대한 관제 방법은 앞서 관제 장치(100)에 의하여 수행될 수 있다. 따라서, 이하 생략된 내용이라고 하더라도 관제 장치(100)에 대하여 설명된 내용은 스마트 컨트랙트에 대한 관제 방법에 대한 설명에도 동일하게 적용될 수 있다.The control method for the smart contract shown in FIG. 9 may be performed by the control device 100 above. Accordingly, even if the contents are omitted below, the contents described with respect to the control device 100 may be equally applied to the description of the control method for the smart contract.

도 9를 참조하면, 단계 S910에서 변수 추출부(110)는, 발행된 스마트 컨트랙트의 소스코드를 파싱하여 스마트 컨트랙트와 연계된 변수(1)를 추출할 수 있다.Referring to FIG. 9, in step S910, the variable extracting unit 110 may extract the variable 1 associated with the smart contract by parsing the source code of the issued smart contract.

구체적으로, 단계 S910에서 변수 추출부(110)는, 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리(AST)를 생성할 수 있다. 또한, 변수 추출부(110)는 생성된 추상 구문 트리(AST)에 기초하여 스마트 컨트랙트와 연계된 변수(1) 각각의 데이터 유형(1a) 및 변수명(1b)을 추출할 수 있다.Specifically, in step S910, the variable extraction unit 110 may generate an abstract syntax tree (AST) based on the parsing result of the source code. In addition, the variable extracting unit 110 may extract the data type 1a and the variable name 1b of each variable 1 associated with the smart contract based on the generated abstract syntax tree AST.

다음으로, 단계 S920에서 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 스마트 컨트랙트와 연계된 상태값(2)을 추출할 수 있다.Next, in step S920, the state extraction unit 120 may extract the state value 2 associated with the smart contract based on the address information of the smart contract.

구체적으로, 단계 S920에서 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터(2', Encoded data)를 획득하고, 부호화된 데이터(2')를 상태값(2)으로 변환할 수 있다. 다만, 이에만 한정되는 것은 아니며, 실시예에 따라 단계 S920에서 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 getStorageAt 함수를 통해 부호화된 데이터(2', Encoded data)를 획득하도록 구현될 수 있다. 또 다른 예로, 단계 S920에서 상태 추출부(120)는, 스마트 컨트랙트의 주소 정보에 기초하여 Level DB를 통해 상태값(2)을 추출할 수 있다.Specifically, in step S920, the state extraction unit 120 acquires the encoded data 2', Encoded data through the Blockchain API based on the address information of the smart contract, and converts the encoded data 2'into the state value. It can be converted to (2). However, it is not limited thereto, and according to an embodiment, the state extraction unit 120 is implemented to obtain encoded data (2', Encoded data) through the getStorageAt function based on the address information of the smart contract. Can be. As another example, in step S920, the state extracting unit 120 may extract the state value 2 through the Level DB based on the address information of the smart contract.

다음으로, 단계 S930에서 매핑부(130)는, 추출된 변수(1) 및 상태값(2)을 매핑할 수 있다.Next, in step S930, the mapping unit 130 may map the extracted variable 1 and the state value 2.

다음으로, 단계 S940에서 표시부(140)는, 매핑된 변수(1) 및 상태값(2)을 시각화하여 표시할 수 있다.Next, in step S940, the display unit 140 may visualize and display the mapped variable 1 and the state value 2.

본원의 일 실시예에 따르면, 단계 S940에서 표시부(140)는, 매핑된 변수(1) 및 상태값(2)을 타임라인 형태로 표시하되, 타임라인 상에는 상태값(2)이 변화한 시점에 대응하는 지점이 상태값(2)이 유지된 영역과 구분되도록 표시될 수 있다.According to an embodiment of the present application, in step S940, the display unit 140 displays the mapped variable 1 and the state value 2 in the form of a timeline, but at the time when the state value 2 changes on the timeline. The corresponding point may be displayed to be distinguished from the region in which the state value 2 is maintained.

또한, 본원의 일 실시예에 따르면, 단계 S940에서 표시부(140)는, 소정의 변수(1)에 대한 시간에 따른 상태값(2) 변화를 나타낸 그래프 형태로 매핑된 변수(1) 및 상태값(2)을 표시할 수 있다.In addition, according to an embodiment of the present application, in step S940, the display unit 140, the variable 1 and the state value mapped in the form of a graph showing the change of the state value 2 over time with respect to the predetermined variable 1 (2) can be displayed.

다음으로, 단계 S950에서 이상 탐지부(150)는, 스마트 컨트랙트의 이상을 탐지할 수 있다.Next, in step S950, the abnormality detection unit 150 may detect an abnormality in the smart contract.

본원의 일 실시예에 따르면, 단계 S950은 복수의 발행된 스마트 컨트랙트 각각에 대하여 수행되는 것일 수 있다.According to an embodiment of the present application, step S950 may be performed for each of a plurality of issued smart contracts.

또한, 본원의 일 실시예에 따르면, 단계 S950에서 이상 탐지부(150)는, 기 학습된 인공 지능 알고리즘에 기초하여 상태값(2)의 변화 패턴이 비정상적인 것으로 판단되는 경우 이상을 탐지할 수 있다.In addition, according to an exemplary embodiment of the present disclosure, in step S950, the anomaly detection unit 150 may detect an anomaly when it is determined that the change pattern of the state value 2 is abnormal based on a previously learned artificial intelligence algorithm. .

다음으로, 단계 S960에서 이상 탐지부(160)는, 소정의 스마트 컨트랙트에 대한 이상이 탐지된 경우, 경고 및 알림 신호를 생성할 수 있다.Next, in step S960, the abnormality detection unit 160 may generate a warning and a notification signal when an abnormality with respect to a predetermined smart contract is detected.

상술한 설명에서, 단계 S910 내지 S960은 본원의 구현예에 따라서, 추가적인 단계들로 더 분할되거나, 더 적은 단계들로 조합될 수 있다. 또한, 일부 단계는 필요에 따라 생략될 수도 있고, 단계 간의 순서가 변경될 수도 있다.In the above description, steps S910 to S960 may be further divided into additional steps or may be combined into fewer steps, according to an embodiment of the present disclosure. In addition, some steps may be omitted as necessary, or the order between steps may be changed.

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

또한, 전술한 스마트 컨트랙트에 대한 관제 방법은 기록 매체에 저장되는 컴퓨터에 의해 실행되는 컴퓨터 프로그램 또는 애플리케이션의 형태로도 구현될 수 있다.In addition, the above-described control method for a smart contract may be implemented in the form of a computer program or application executed by a computer stored in a recording medium.

전술한 본원의 설명은 예시를 위한 것이며, 본원이 속하는 기술분야의 통상의 지식을 가진 자는 본원의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다.The foregoing description of the present application is for illustrative purposes only, and those of ordinary skill in the art to which the present application pertains will be able to understand that it can be easily modified into other specific forms without changing the technical spirit or essential features of the present application. Therefore, it should be understood that the embodiments described above are illustrative and non-limiting in all respects. For example, each component described as a single type may be implemented in a distributed manner, and similarly, components described as being distributed may also be implemented in a combined form.

본원의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본원의 범위에 포함되는 것으로 해석되어야 한다.The scope of the present application is indicated by the claims to be described later rather than the detailed description, and all changes or modified forms derived from the meaning and scope of the claims and their equivalent concepts should be interpreted as being included in the scope of the present application.

10: 블록체인 관제 시스템
20: 사용자
30: 개발자
100: 스마트 컨트랙트에 대한 관제 장치
110: 변수 추출부
120: 상태 추출부
130: 매핑부
140: 표시부
150: 이상 탐지부
1: 변수
1a: 데이터 유형
1b: 변수명
2: 상태값
2': 부호화된 데이터
10: Blockchain control system
20: user
30: Developer
100: control device for smart contract
110: variable extraction unit
120: state extraction unit
130: mapping unit
140: display
150: abnormality detection unit
1: variable
1a: data type
1b: variable name
2: status value
2': encoded data

Claims (13)

스마트 컨트랙트에 대한 관제 방법에 있어서,
발행된 스마트 컨트랙트의 소스코드를 파싱하여 상기 스마트 컨트랙트와 연계된 변수를 추출하는 단계;
상기 스마트 컨트랙트의 주소 정보에 기초하여 상기 스마트 컨트랙트와 연계된 상태값을 추출하는 단계;
추출된 상기 변수 및 상기 상태값을 매핑하는 단계; 및
매핑된 상기 변수 및 상기 상태값을 시각화하여 표시하는 단계,
를 포함하는, 스마트 컨트랙트 관제 방법.
In the control method for smart contracts,
Parsing the source code of the issued smart contract and extracting a variable associated with the smart contract;
Extracting a state value associated with the smart contract based on the address information of the smart contract;
Mapping the extracted variable and the state value; And
Visualizing and displaying the mapped variable and the state value,
Containing, smart contract control method.
제1항에 있어서,
상기 변수를 추출하는 단계는,
상기 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리를 생성하는 단계; 및
상기 추상 구문 트리에 기초하여 상기 스마트 컨트랙트와 연계된 변수 각각의 데이터 유형 및 변수명을 추출하는 단계,
를 포함하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 1,
The step of extracting the variable,
Generating an abstract syntax tree based on a result of parsing the source code; And
Extracting a data type and a variable name of each variable associated with the smart contract based on the abstract syntax tree,
That includes, smart contract control method.
제2항에 있어서,
상기 상태값을 추출하는 단계는,
상기 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터를 획득하는 단계; 및
상기 부호화된 데이터를 상기 상태값으로 변환하는 단계,
를 포함하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 2,
The step of extracting the state value,
Obtaining encoded data through a Blockchain API based on the address information of the smart contract; And
Converting the encoded data into the state value,
That containing, smart contract control method.
제3항에 있어서,
상기 표시하는 단계는,
매핑된 상기 변수 및 상기 상태값을 타임라인 형태로 표시하되,
상기 타임라인 상에는 상기 상태값이 변화한 시점에 대응하는 지점이 상기 상태값이 유지된 영역과 구분되도록 표시되는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 3,
The displaying step,
The mapped variable and the state value are displayed in the form of a timeline,
On the timeline, a point corresponding to a time point at which the state value is changed is displayed to be distinguished from an area in which the state value is maintained.
제3항에 있어서,
상기 표시하는 단계는,
소정의 변수에 대한 시간에 따른 상태값 변화를 나타낸 그래프 형태로 매핑된 상기 변수 및 상기 상태값을 표시하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 3,
The displaying step,
To display the variable and the state value mapped in the form of a graph showing a change in state value over time for a predetermined variable, smart contract control method.
제1항에 있어서,
상기 스마트 컨트랙트의 이상을 탐지하는 단계를 더 포함하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 1,
The smart contract control method further comprising the step of detecting an abnormality in the smart contract.
제6항에 있어서,
상기 이상을 탐지하는 단계는,
기 학습된 인공 지능 알고리즘에 기초하여 상기 상태값의 변화 패턴이 비정상적인 것으로 판단되는 경우 이상을 탐지하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 6,
The step of detecting the abnormality,
To detect an abnormality when it is determined that the change pattern of the state value is abnormal based on a pre-learned artificial intelligence algorithm.
제7항에 있어서,
상기 이상을 탐지하는 단계는,
복수의 발행된 스마트 컨트랙트 각각에 대하여 수행되는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 7,
The step of detecting the abnormality,
A smart contract control method that is performed for each of a plurality of issued smart contracts.
제8항에 있어서,
소정의 상기 스마트 컨트랙트에 대한 이상이 탐지된 경우, 경고 및 알림 신호를 생성하는 단계를 더 포함하는 것인, 스마트 컨트랙트 관제 방법.
The method of claim 8,
If an abnormality with the predetermined smart contract is detected, the method further comprising generating a warning and a notification signal.
스마트 컨트랙트에 대한 관제 장치에 있어서,
발행된 스마트 컨트랙트의 소스코드를 파싱하여 상기 스마트 컨트랙트와 연계된 변수를 추출하는 변수 추출부;
상기 스마트 컨트랙트의 주소 정보에 기초하여 상기 스마트 컨트랙트와 연계된 상태값을 추출하는 상태 추출부;
추출된 상기 변수 및 상기 상태값을 매핑하는 매핑부; 및
매핑된 상기 변수 및 상기 상태값을 시각화하여 표시하는 표시부,
를 포함하는, 스마트 컨트랙트 관제 장치.
In the control device for smart contracts,
A variable extraction unit that parses the source code of the issued smart contract and extracts a variable associated with the smart contract;
A state extraction unit extracting a state value associated with the smart contract based on the address information of the smart contract;
A mapping unit for mapping the extracted variable and the state value; And
A display unit that visualizes and displays the mapped variable and the state value,
Containing, smart contract control device.
제10항에 있어서,
상기 변수 추출부는,
상기 소스코드에 대한 파싱 결과에 기초하여 추상 구문 트리를 생성하고, 상기 추상 구문 트리에 기초하여 상기 스마트 컨트랙트와 연계된 변수 각각의 데이터 유형 및 변수명을 추출하는 것인, 스마트 컨트랙트 관제 장치.
The method of claim 10,
The variable extraction unit,
Generating an abstract syntax tree based on the parsing result of the source code, and extracting the data type and variable name of each variable associated with the smart contract based on the abstract syntax tree.
제11항에 있어서,
상기 상태 추출부는,
상기 스마트 컨트랙트의 주소 정보에 기초하여 Blockchain API를 통해 부호화된 데이터를 획득하고, 상기 부호화된 데이터를 상기 상태값으로 변환하는 것인, 스마트 컨트랙트 관제 장치.
The method of claim 11,
The state extraction unit,
Acquiring the encoded data through the Blockchain API based on the address information of the smart contract, and converting the encoded data into the state value, smart contract control device.
제12항에 있어서,
기 학습된 인공 지능 알고리즘에 기초하여 적어도 하나 이상의 스마트 컨트랙트에 대하여 상기 상태값의 변화 패턴이 비정상적인 것으로 판단되는 경우 해당 스마트 컨트랙트의 이상을 탐지하는 이상 탐지부를 더 포함하는 것인, 스마트 컨트랙트 관제 장치.
The method of claim 12,
If it is determined that the change pattern of the state value for at least one smart contract is abnormal based on a pre-learned artificial intelligence algorithm, the smart contract control device further comprises an abnormality detection unit for detecting an abnormality of the corresponding smart contract.
KR1020190132250A 2019-10-23 2019-10-23 Apparatus and method for surveilling smart contract KR102272008B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190132250A KR102272008B1 (en) 2019-10-23 2019-10-23 Apparatus and method for surveilling smart contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190132250A KR102272008B1 (en) 2019-10-23 2019-10-23 Apparatus and method for surveilling smart contract

Publications (2)

Publication Number Publication Date
KR20210048241A true KR20210048241A (en) 2021-05-03
KR102272008B1 KR102272008B1 (en) 2021-07-01

Family

ID=75910774

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190132250A KR102272008B1 (en) 2019-10-23 2019-10-23 Apparatus and method for surveilling smart contract

Country Status (1)

Country Link
KR (1) KR102272008B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836548A (en) * 2021-09-01 2021-12-24 广州大学 Data consistency guarantee method, system, equipment and storage medium of intelligent contract

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102004511B1 (en) * 2018-07-26 2019-10-01 (주)유니온소프트 A server and a payment computing device for payment at a store by electronic cash
KR102024377B1 (en) * 2018-10-08 2019-10-07 주식회사 에너지세븐 Method for providing blockchian based loan service using credit scoring to group inclduing individual

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102004511B1 (en) * 2018-07-26 2019-10-01 (주)유니온소프트 A server and a payment computing device for payment at a store by electronic cash
KR102024377B1 (en) * 2018-10-08 2019-10-07 주식회사 에너지세븐 Method for providing blockchian based loan service using credit scoring to group inclduing individual

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Bogdan Habic, "Debugging Ethereum transactions just got a whole lot easier"(2019.08.)* *
Pouyan Momeni et al, "Machine Learning Model for Smart Contracts Security Analysis"(2019.08.)* *
Santiago Bragagnolo et al, "SmartInspect: Solidity Smart Contract Inspector"(2018.03.)* *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836548A (en) * 2021-09-01 2021-12-24 广州大学 Data consistency guarantee method, system, equipment and storage medium of intelligent contract
CN113836548B (en) * 2021-09-01 2023-07-25 广州大学 Data consistency guarantee method, system and equipment of intelligent contract and storage medium

Also Published As

Publication number Publication date
KR102272008B1 (en) 2021-07-01

Similar Documents

Publication Publication Date Title
US20240086944A1 (en) Auto-encoder enhanced self-diagnostic components for model monitoring
AU2017228584B2 (en) Multi-data analysis based proactive defect detection and resolution
KR101631978B1 (en) Mapping dataset elements
CN100507870C (en) Automated test case verification that is loosely coupled with respect to automated test case execution
US9389849B2 (en) Test case pattern matching
US20170024828A1 (en) Systems and methods for identifying information related to payment card testing
US20140013308A1 (en) Application Development Environment with Services Marketplace
CN109901968A (en) A kind of automation page data method of calibration and device
Di Sorbo et al. Profiling gas consumption in solidity smart contracts
Pavlidis et al. A CASE tool to support automated modelling and analysis of security requirements, based on secure tropos
KR102088431B1 (en) Message based communicating method of test server and test server communicating based on message
Ferrari et al. Towards the practical mutation testing of AspectJ programs
KR102272008B1 (en) Apparatus and method for surveilling smart contract
US10628140B2 (en) Program code generation apparatus
US10719482B2 (en) Data comparison
CN117034299B (en) Intelligent contract safety detection system based on block chain
US20130275184A1 (en) Externalized decision management in business applications
CN109564507B (en) Data processing method, system and storage medium
US11971813B2 (en) Data driven testing automation using machine learning
Wortman et al. SMART: security model adversarial risk-based tool for systems security design evaluation
Constantinou et al. Identifying evolution patterns: a metrics‐based approach for external library reuse
KR20200075143A (en) Asset trading and traceability system based on block chain
US20200371899A1 (en) Static analysis of code coverage metrics provided by functional user interface tests using tests written in metadata
US20080195453A1 (en) Organisational Representational System
KR101843092B1 (en) Method for verifying multiple insurance computer system

Legal Events

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