JP2020042795A - Uncertainty factor detector for smart contract, method and storage medium - Google Patents

Uncertainty factor detector for smart contract, method and storage medium Download PDF

Info

Publication number
JP2020042795A
JP2020042795A JP2019137888A JP2019137888A JP2020042795A JP 2020042795 A JP2020042795 A JP 2020042795A JP 2019137888 A JP2019137888 A JP 2019137888A JP 2019137888 A JP2019137888 A JP 2019137888A JP 2020042795 A JP2020042795 A JP 2020042795A
Authority
JP
Japan
Prior art keywords
ledger
detection device
uncertainty factor
smart contract
uncertainty
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
JP2019137888A
Other languages
Japanese (ja)
Inventor
恩策 周
En Ce Zhou
恩策 周
ピ・ビンフォン
Bing-Feng Pi
俊 孫
Shun Son
俊 孫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of JP2020042795A publication Critical patent/JP2020042795A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

To provide an uncertainty factor detector for smart contracts, a method, and a medium.SOLUTION: An uncertainty factor detector for smart contract 100 includes an analysis unit 101 and a detection unit 102. The analysis unit 101 converts the smart contract to an abstract syntax tree, and scans the abstract syntax tree and acquires the execution path of ledger operation and ledger write operation. The detection unit 102 detects whether any uncertainty factor is included in the ledger operation on the execution path.SELECTED DRAWING: Figure 1

Description

本開示は、ブロックチェーンの技術分野に関し、特に、スマート・コントラクトのための不確定性要因(Uncertainty Factor)の検出装置及び方法に関する。   The present disclosure relates to the technical field of blockchain, and more particularly, to an apparatus and method for detecting an uncertainty factor for a smart contract.

この部分では、本開示に関連する背景情報が記載されるが、それは、必ずしも従来技術でない。   This section provides background information related to the present disclosure, but it is not necessarily prior art.

今のところ、ハイパーレジャー(Hyper ledger)が最も流行っている、コンソーシアムブロックチェーン(Consortium Blockchain)に適したブロックチェーン・フラットフォームであり、その特徴は、開発者に有利であり、企業は、自身のニーズに応じて、複雑な業務のアプリケーションを開発することができる。ハイパーレジャーでは、スマート・コントラクトを書くコアな言語がGo言語であり、また、ハイパーレジャーでは、スマート・コントラクトにより生成される取引において一連のノードの裏書き(Endorsement)が必要となり、裏書き段階では、各ノードが生成する台帳のRWSet(Read/Write Set)が不一致の場合、取引の失敗を来すことがある。よって、Go言語で書かれるスマート・コントラクトの、各裏書きノード上の実行結果の一致性を確保する必要があり、即ち、不確定性を含むことができない。   At present, Hyperledger is the most popular blockchain and flat form suitable for the Consortium Blockchain. Its features are advantageous to developers, and companies have their own Complex business applications can be developed according to needs. In Hyperledger, Go language is the core language for writing smart contracts. In Hyperledger, transactions generated by smart contracts require endorsement of a series of nodes. If the RWSet (Read / Write Set) of the ledger generated by each node does not match, the transaction may fail. Therefore, it is necessary to ensure the consistency of the execution results on each endorsement node of the smart contract written in Go language, that is, cannot include uncertainty.

しかし、開発者は、通常、スマート・コントラクトのコード又は取引の不確定性問題を無視し、取引の失敗を引き起こしやすいスマート・コントラクト・コードを書いてしまう恐れがある。   However, developers typically ignore smart contract code or transaction uncertainty issues and may write smart contract code that is prone to transaction failure.

また、スマート・コントラクトにより生成される取引は、即時に有効になるのでなく、裏書き手順(模擬実行)、取引並べ替え手順、台帳提出手順を経る必要があり、また、台帳提出手順のみにおいては、コード中の台帳に対しての修正が有効になる。従来では、プログラマは、開発過程において、通常、1つの状態値を修正し、該状態値を台帳へ書き戻し、また、該状態値を再び読み取るときに修正後の状態値を取得し得ると思う。実際には、裏書き段階において台帳へ書き戻される状態値がすぐに有効になるのでなく、再び読み取った状態値が依然として一回目に読み取ったものと同じ値であるため、取引の不確定性を引き起こしやすく、即ち、取引の実行結果は、開発者の予期と不一致になる可能性がある。よって、従来では、このようなコード又は取引の不確定性を検出し得るツールが望ましい。   Also, the transactions generated by the smart contract must go through endorsement procedures (simulated execution), transaction sorting procedures, and ledger submission procedures, instead of being immediately effective. Then, the correction to the ledger in the code becomes effective. Conventionally, during a development process, a programmer would typically modify one state value, write the state value back to the ledger, and get the modified state value when reading back the state value. . In practice, the status values written back to the ledger during the endorsement phase do not take effect immediately, but the status values read again are still the same as those read at the first time. It is easy to cause, that is, the result of executing the transaction may be inconsistent with the developer's expectations. Thus, conventionally, a tool that can detect such code or transaction uncertainty is desirable.

本開示の目的は、上述のような問題を解決し得る技術案を提供し、特に、スマート・コントラクトのための不確定性要因検出装置及び方法を提供することにある。   An object of the present disclosure is to provide a technical solution that can solve the above-described problem, and in particular, to provide an uncertainty factor detection device and method for smart contract.

本開示の一側面によれば、スマート・コントラクトのための不確定性要因検出装置が提供され、それは、分析ユニットであって、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析するためのもの;及び、検出ユニットであって、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出するためのものを含み、そのうち、前記分析ユニットは、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する。   According to one aspect of the present disclosure, there is provided an uncertainty factor detection device for a smart contract, which is an analysis unit for analyzing a traversal path of the smart contract ledger operation. And a detection unit for detecting whether the ledger operation includes an uncertainty factor with respect to the traversal route, wherein the analysis unit has a branch structure in the traversal route. When it is determined that the traversal route is included, the traversal route is extended.

本開示の他の側面によれば、スマート・コントラクトのための不確定性要因検出方法が提供され、それは、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析し;及び、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出することを含み、そのうち、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する。   According to another aspect of the present disclosure, there is provided an uncertainty factor detection method for a smart contract, which analyzes a traversal path of a ledger operation of the smart contract; Detecting whether the ledger operation includes an uncertainty factor. If it is determined that the traversal route includes a branch structure, the traversal route is extended.

本開示の他の側面によれば、プログラムプロダクトが提供され、該プログラムプロダクトは、その中にマシン可読指令コードが含まれおり、そのうち、前記指令コードは、コンピュータにより読み取られて実行されるときに、前記コンピュータに、本開示によるスマート・コントラクトのための不確定性要因検出方法を実行させることができる。   According to another aspect of the present disclosure, there is provided a program product, wherein the program product includes a machine-readable command code, wherein the command code is read and executed by a computer. And causing the computer to execute the uncertainty factor detection method for smart contract according to the present disclosure.

本開示の他の側面によれば、マシン可読記憶媒体が提供され、その中に本開示によるプログラムプロダクトが含まれている。   According to another aspect of the present disclosure, there is provided a machine-readable storage medium, including a program product according to the present disclosure.

本開示によるスマート・コントラクトのための不確定性検出装置及び方法は、スマート・コントラクトの開発者の効率を大幅に向上させることができ、また、コントラクト実行過程においてコードの不確定性による裏書きの失敗を減らすことができるとともに、取引の不確定性の発生を低減することもできる。   An apparatus and method for detecting uncertainty for a smart contract according to the present disclosure can greatly improve the efficiency of a developer of a smart contract, and can endorse due to uncertainty of code during a contract execution process. Failures can be reduced and the occurrence of transaction uncertainties can be reduced.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出装置のブロック図である。FIG. 2 is a block diagram of an uncertainty factor detecting device for a smart contract according to an embodiment of the present disclosure; 本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出装置の分析ユニットが経路拡張を行うことを示す図である。FIG. 4 is a diagram illustrating that an analysis unit of the uncertainty factor detection device for smart contract performs path expansion according to an embodiment of the present disclosure; 本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出装置の検出ユニットが検出を行うことを示す図である。FIG. 4 is a diagram illustrating that a detection unit of an uncertainty factor detection device for smart contract performs detection according to an embodiment of the present disclosure; 本開示の一実施例における取引の不確定性を示す図である。FIG. 4 is a diagram illustrating uncertainty of a transaction according to an embodiment of the present disclosure. 本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出案全体の構成図である。FIG. 4 is a configuration diagram of an entire uncertainty factor detection plan for a smart contract according to an embodiment of the present disclosure; 本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法のフローチャートである。4 is a flowchart of a method for detecting an uncertainty factor for a smart contract according to an embodiment of the present disclosure; 本開示の実施例におけるスマート・コントラクトのための不確定性要因検出装置及び方法を実現し得る汎用コンピュータの構成図である。FIG. 1 is a configuration diagram of a general-purpose computer that can implement an uncertainty factor detection device and method for a smart contract in an embodiment of the present disclosure.

以下、添付した図面を参照しながら、本開示を実施するための好適な形態を詳細に説明する。なお、このような実施形態は、例示に過ぎず、本開示を限定するものでない。   Hereinafter, preferred embodiments for carrying out the present disclosure will be described in detail with reference to the accompanying drawings. Note that such an embodiment is merely an example and does not limit the present disclosure.

本開示の技術案をより良く理解し得るために、以下、本開示のスマート・コントラクトのための不確定性要因検出装置及び検出方法について詳しく説明する。   Hereinafter, in order to better understand the technical solution of the present disclosure, an uncertainty factor detecting device and a detecting method for a smart contract according to the present disclosure will be described in detail.

本開示の一実施例によれば、スマート・コントラクトのための不確定性要因検出装置が提供され、それは、分析ユニットであって、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析するもの;及び、検出ユニットであって、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出するものを含み、そのうち、前記分析ユニットは、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する。   According to one embodiment of the present disclosure, there is provided an uncertainty factor detection device for a smart contract, which is an analysis unit for analyzing a traversal path of the ledger operation of the smart contract. And a detection unit for detecting whether the ledger operation includes an uncertainty factor with respect to the traversal route, wherein the analysis unit includes a branching structure in the traversal route. When it is determined that the traversal route is present, the traversal route is extended.

図1は、本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出装置100を示す。図1に示すように、本開示によるスマート・コントラクトのための不確定性要因検出装置100は、分析ユニット101及び検出ユニット102を含んでも良い。   FIG. 1 illustrates an uncertainty factor detection apparatus 100 for a smart contract in one embodiment of the present disclosure. As shown in FIG. 1, the uncertainty factor detection device 100 for a smart contract according to the present disclosure may include an analysis unit 101 and a detection unit 102.

分析ユニット101は、スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析する。例えば、本開示の一実施例によれば、分析ユニット101は、まず、スマート・コントラクトを抽象構文木(AST)に変換する。その後、例えば、深さ優先トラバーサル(Depth First Traversal)アルゴリズムを用いて前記ASTに対して走査(Traversal)を行い、前記台帳操作(例えば、台帳読み取り操作(即ち、台帳を読み取る操作)及び台帳書き込み操作(即ち、台帳に書き込む操作))のトラバーサル経路、即ち、実行経路を取得する。ここで、当業者が理解すべきは、深さ優先トラバーサル・アルゴリズムは、例示に過ぎず、本開示は、これに限定されない。当業者は、従来技術中の任意の他の周知の走査方法を採用しても良い。   The analysis unit 101 analyzes the traversal route of the ledger operation of the smart contract. For example, according to one embodiment of the present disclosure, analysis unit 101 first converts the smart contract into an abstract syntax tree (AST). Thereafter, the AST is scanned (traversal) using, for example, a depth-first traversal algorithm, and the ledger operation (eg, ledger reading operation (ie, ledger reading operation) and ledger writing operation) is performed. (I.e., the operation of writing to the ledger)), the traversal route, that is, the execution route is acquired. Here, it should be understood by those skilled in the art that the depth-first traversal algorithm is merely an example, and the present disclosure is not limited to this. One skilled in the art may employ any other known scanning method in the prior art.

その後、前記分析ユニット101が前記ASTに対して構文分析を行うときに、行に跨る語句、例えば、if、switch、forなどの文が存在する場合があり、このような語句の間に台帳操作コードが無いとき、これらの行に跨る語句について、深さ優先トラバーサル・アルゴリズムは、通常、1行目のみの情報を記録する。しかし、記録されない語句の間の情報には、台帳操作対象の変数に対しての修正が存在する可能性があるので、具体的な台帳操作対象に変化があるかを判断するときに、これらの行に跨る語句の間(内部)の全ての語句を記録する必要がある。即ち、これらの行に跨る語句に対して内部拡張を行う必要がある。   Thereafter, when the analysis unit 101 performs a syntax analysis on the AST, there may be words extending across lines, for example, sentences such as if, switch, for, and the like. In the absence of code, for words that span these lines, the depth-first traversal algorithm typically records only the first line of information. However, since information between phrases that are not recorded may have corrections to the ledger operation target variables, when determining whether there is a change in the specific ledger operation target, It is necessary to record all the phrases between (inside) the phrases across the lines. That is, it is necessary to perform internal expansion on the words extending over these lines.

本開示の一実施例によれば、前記分析ユニット101は、前記台帳操作のトラバーサル経路に分岐構造、即ち、行に跨る語句、例えば、if、switch、forなどの文が含まれるかを判断するように構成されても良い。前記トラバーサル経路に分岐構造が含まれている場合、前記トラバーサル経路を拡張する。   According to an embodiment of the present disclosure, the analysis unit 101 determines whether the traversal path of the ledger operation includes a branch structure, that is, a word that extends across lines, for example, a sentence such as if, switch, for, or the like. It may be configured as follows. If the traversal route includes a branch structure, the traversal route is extended.

具体的には、まず、前記分析ユニット101は、構文分析により、抽出した、行に跨る語句、例えば、if、switch、forなどの文の開始位置を記録する。その後、全ての台帳操作に関連する実行経路においてこれらの行に跨る語句の1行目が含まれるかを判断する。これらの行に跨る語句の1行目が含まれている場合、該1行目をその対応する範囲内の全ての行に置き換える。   Specifically, first, the analysis unit 101 records, by syntactic analysis, an extracted word that extends across lines, for example, a start position of a sentence such as if, switch, or for. Thereafter, it is determined whether or not the first line of the phrase extending over these lines is included in the execution path related to all ledger operations. When the first line of a phrase extending over these lines is included, the first line is replaced with all lines within the corresponding range.

例えば、図2に示すように、台帳操作関数GetState(K1)の実行経路にif分岐構造を表す1行目L3が含まれており、台帳操作関数GetState(K1)のL10行を実行するときに、L3行は、既に実行されている。しかし、このときに、台帳操作関数GetState(K1)の実行経路は、L1、L2、L3、L9、L10のみである。L3行が表すif分岐構造の内部、例えば、L5行に台帳の操作対象変数への修正が生じる場合(例えば、状態更新操作PutState(K1、V1)が行われるとき)、不確定性リスクの発生を引き起こす可能性がある。よって、L3行が表すif分岐条件の他の範囲を実行経路に拡張する必要がある。図2に示すように、L3行が表すif分岐条件の他の範囲は、L3、L4、L5、L6、L7、L8である。よって、拡張後の台帳操作関数GetState(K1)の拡張後の実行経路は、L1、L2、L3、L4、L5、L6、L7、L8、L9、L10である。このような拡張方法を採用することにより、後続の制御流分析時に、if分岐条件の内部のコードを無視することができない。   For example, as shown in FIG. 2, the execution path of the ledger operation function GetState (K1) includes the first line L3 representing the if branch structure, and the L10 line of the ledger operation function GetState (K1) is executed. , Line L3 has already been executed. However, at this time, the execution path of the ledger operation function GetState (K1) is only L1, L2, L3, L9, and L10. Uncertainty risk occurs when a modification to a ledger operation variable occurs in the if branch structure represented by the L3 line, for example, the L5 line (for example, when a state update operation PutState (K1, V1) is performed). Can cause Therefore, it is necessary to extend another range of the if branch condition represented by the L3 line to the execution path. As shown in FIG. 2, the other ranges of the if branch condition represented by the L3 row are L3, L4, L5, L6, L7, and L8. Therefore, the extended execution path of the extended ledger operation function GetState (K1) is L1, L2, L3, L4, L5, L6, L7, L8, L9, L10. By adopting such an extension method, the code inside the if branch condition cannot be ignored in the subsequent control flow analysis.

続いて、検出ユニット102は、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出しても良い。本開示の一実施例によれば、前記不確定性要因は、コード不確定性要因及び取引不確定性要因を含んでも良い。   Subsequently, the detection unit 102 may detect whether the ledger operation includes an uncertainty factor with respect to the traversal route. According to an embodiment of the present disclosure, the uncertainty factor may include a code uncertainty factor and a transaction uncertainty factor.

また、Go言語標準ライブラリでは、抽象構文木(AST)に対して深さ走査(トラバーサル)を行うツールが提供されているが、トラバーサル経路情報を記録することができない。よって、本開示の一実施例によれば、前記分析ユニット101は、さらに、前記トラバーサル経路を記録するために、前記ASTの走査のための標準ライブラリを修正するように構成されても良い。   The Go language standard library provides a tool for performing a depth scan (traversal) on an abstract syntax tree (AST), but cannot record traversal path information. Thus, according to one embodiment of the present disclosure, the analysis unit 101 may be further configured to modify a standard library for scanning the AST to record the traversal path.

例えば、本開示の実施例によれば、前記ASTに対して深さ走査を行うときに、前記分析ユニット101は、構文分析により、台帳操作コード(例えば、PutState()及びGetState())を検出し、台帳操作コードを検出したときに、該台帳操作コードに対応する具体的な実行経路も同時に記録することができる。   For example, according to an embodiment of the present disclosure, when performing a depth scan on the AST, the analysis unit 101 detects a ledger operation code (eg, PutState () and GetState ()) by syntax analysis. When a ledger operation code is detected, a specific execution path corresponding to the ledger operation code can be recorded at the same time.

<コード不確定性の検出>
本開示の一実施例によれば、不確定性要因は、コード不確定性要因を含む。コード不確定性要因は、例えば、Go言語自身による不確定性要因、例えば、乱数生成、グローバル変数、タイムスタンプ、キーと値のペアのデータ構造の走査、及び対象アドレスなどを含む。コード不確定性要因は、さらに、外部呼び出し、例えば、ネットワークサービス、外部ライブラリ呼び出し、及びシステム命令などを含んでも良い。また、コード不確定性要因は、さらに、Fabric実行メカニズムによる不確定性、例えば、クロス・チャンネル・チェーン・コード(chaincode)呼び出し及びレンジ(range)・クエリ・リスクなどを含んでも良い。なお、当業者が理解すべきは、このようなコード不確定性要因は、例示に過ぎず、本開示は、これに限定されない。
<Detection of code uncertainty>
According to one embodiment of the present disclosure, the uncertainty factor includes a code uncertainty factor. The code uncertainty factors include, for example, uncertainty factors by the Go language itself, such as random number generation, global variables, time stamps, scanning of key-value pair data structures, and target addresses. Code uncertainty factors may further include external calls, such as network services, external library calls, and system instructions. Also, the code uncertainty factors may further include uncertainties due to the Fabric execution mechanism, such as cross channel chaincode calls and range query risks. It should be understood by those skilled in the art that such a code uncertainty factor is merely an example, and the present disclosure is not limited thereto.

本開示は、スマート・コントラクトのためのコード不確定性検出装置を提供する。   The present disclosure provides a code uncertainty detection device for smart contracts.

本開示によるスマート・コントラクトのためのコード不確定性検出装置は、分析ユニットであって、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析するもの;及び、検出ユニットであって、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出するものを含み、そのうち、前記分析ユニットは、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張し、また、前記検出ユニットは、さらに、前記トラバーサル経路について、バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断するように構成される。   An apparatus for detecting code uncertainty for a smart contract according to the present disclosure is an analysis unit that analyzes a traversal path of a ledger operation of the smart contract; For the route, including detecting whether the ledger operation includes an uncertainty factor, among which the analysis unit determines that the traversal route includes a branch structure when the traversal route is included. The detection unit is further configured to determine whether the ledger operation target and value include a code uncertainty factor in a backtracking manner for the traversal route.

ここで、分析ユニットに関連する構成は、上述の実施例における分析ユニット101の構成と同じであるため、詳しい説明が省略される。   Here, since the configuration related to the analysis unit is the same as the configuration of the analysis unit 101 in the above-described embodiment, a detailed description is omitted.

本開示の一実施例によれば、前記検出ユニットは、さらに、前記トラバーサル経路について、バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断するように構成されても良い。具体的には、前記検出ユニット102は、全ての台帳操作の操作対象を抽出し、その後、バックトラッキングの方式で該台帳操作に対応する実行経路上の操作対象(変数)に不確定性因子が含まれるかを分析することができる。含まれている場合、コード不確定性リスクが発生し得ると判定する。具体的なプロセスは、図3に示す通りである。そのうち、行76は、見つけた台帳操作、即ち、PutState()を表し、該台帳操作PutState()は、2つの可能な実行経路(実線で示される)を有する。その後、該台帳操作PutState()の操作対象K1及びV1を抽出する。そして、バックトラッキングの方式(破線でバックトラッキング経路を示す)で、該台帳操作PutState()に対応する実行経路中の操作対象K1及びV1に不確定性因子が含まれるかを分析する。操作対象に不確定性因子が含まれるかを判断するときに、本開示では、少なくとも3種類のフォーマットの操作対象、例えば、変数、定数、定数と変数との組合せの分析をサポートし得る。しかし、定数は、直接比較することができるため、ここでは、その詳しい説明が省略される。換言すると、ここでは、変数のみを抽出し、実行経路に対してバックトラッキング分析を行うときに、該変数に係る部分に不確定性リスクが含まれるかを判断しても良い。なお、当業者が理解すべきは、このような検出プロセスは、例示に過ぎず、本開示は、上述のようなプロセスにおけるステップ及びその順序に限定されない。   According to an embodiment of the present disclosure, the detection unit may further determine whether the ledger operation target and the value include a code uncertainty factor in a backtracking manner for the traversal route. It may be configured. More specifically, the detection unit 102 extracts the operation targets of all ledger operations, and thereafter, an uncertainty factor is assigned to the operation target (variable) on the execution path corresponding to the ledger operation by a backtracking method. You can analyze whether it is included. If it is included, it is determined that a code uncertainty risk may occur. The specific process is as shown in FIG. Among them, line 76 represents the found ledger operation, PutState (), which has two possible execution paths (indicated by solid lines). After that, the operation objects K1 and V1 of the ledger operation PutState () are extracted. Then, it is analyzed whether or not the operation objects K1 and V1 in the execution path corresponding to the ledger operation PutState () include an uncertainty factor by a back tracking method (a back tracking path is indicated by a broken line). When determining whether an operating object includes an uncertainty factor, the present disclosure may support analysis of operating objects in at least three different formats, for example, variables, constants, and combinations of constants and variables. However, since the constants can be directly compared, detailed description thereof is omitted here. In other words, here, when only variables are extracted and backtracking analysis is performed on the execution path, it may be determined whether or not a portion related to the variables includes an uncertainty risk. It should be understood by those skilled in the art that such a detection process is merely an example, and the present disclosure is not limited to the steps and the order in the processes as described above.

本開示の一実施例によれば、前記台帳操作は、台帳読み取り操作及び台帳書き込み操作を含んでも良い。もちろん、当業者が理解すべきは、このような台帳読み取り操作及び台帳書き込み操作は、例示に過ぎず、本開示は、これに限定されない。   According to one embodiment of the present disclosure, the ledger operation may include a ledger reading operation and a ledger writing operation. Of course, those skilled in the art should understand that such ledger reading operation and ledger writing operation are merely examples, and the present disclosure is not limited thereto.

本開示による制御流分析に基づくスマート・コントラクト不確定性検出装置を用いることにより、実行経路を拡張することでスマート・コントラクトのコード不確定性リスクを有効に検出し、また、該リスクの所在する行を記録することができる。よって、ハイパーレジャーにおいてスマート・コントラクトにより生成される取引における裏書きの失敗を減らすことができる。   By using the smart contract uncertainty detection device based on control flow analysis according to the present disclosure, it is possible to effectively detect the code uncertainty risk of the smart contract by extending the execution path and to determine the location of the risk. Lines can be recorded. Therefore, failure of endorsement in the transaction generated by the smart contract in the hyper ledger can be reduced.

<取引不確定性の検出>
スマート・コントラクトの実行が裏書き段階で行われ、また、裏書き段階では、台帳に対して更新操作が行われないので、1つのコントラクトにおいて1つの特定の台帳状態に対して、先に修正を行い、それから読み取るという操作を行うときに、開発者の読み取った内容が依然として修正前のものと同じである可能性があるため、取引の不確定性のリスクを来しやすい。本開示では、このような不確定性リスクを「RYWリスク」(“Read-Your-Write Risk”)と言い、具体的には、図4に示す通りである。
<Detection of transaction uncertainty>
Since the execution of the smart contract is performed at the endorsement stage, and at the endorsement stage, no update operation is performed on the ledger, so that one contract can be modified first for one specific ledger state. When performing an operation of performing and then reading, there is a possibility that the contents read by the developer may still be the same as those before the correction, so that the risk of transaction uncertainty is likely to occur. In the present disclosure, such an uncertainty risk is referred to as “RYW risk” (“Read-Your-Write Risk”), and is specifically as shown in FIG.

1つの取引では、台帳の操作対象K1及び値V1について、開発者が「K1=V1」を書き込んだ場合、前述のように、スマート・コントラクトにより生成される取引は、すぐに有効になるのでなく、即ち、該書き込みは、即時に有効にならず、台帳データベースには、K1が依然としてV0に等しい。この場合、開発者がK1の値を取得する必要があるときに、「K1=V1」でなく、「K1=V0」を得るため、取引の不確定性を引き起こすことができる。   In one transaction, if the developer writes “K1 = V1” for the ledger's operation target K1 and value V1, as described above, the transaction generated by the smart contract will not be effective immediately. That is, the write does not take effect immediately, and in the ledger database K1 is still equal to V0. In this case, when the developer needs to obtain the value of K1, it obtains “K1 = V0” instead of “K1 = V1”, which can cause an uncertainty of the transaction.

よって、本開示は、スマート・コントラクトのための取引不確定性検出装置を提供する。   Thus, the present disclosure provides a transaction uncertainty detection device for smart contracts.

スマート・コントラクトのための取引不確定性検出装置は、前述の分析ユニット101及び検出ユニット102を含み、以上では、前記分析ユニット101について既に詳細に説明しているから、ここでは、その詳しい記載を省略する。   The transaction uncertainty detection device for the smart contract includes the above-described analysis unit 101 and the detection unit 102. Since the analysis unit 101 has been described in detail above, a detailed description thereof will be given here. Omitted.

本開示の一実施例によれば、検出ユニット102が、前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、前記台帳読み取り操作でエンド(end)する実行経路において、バックトラッキングの方式で、該実行経路に前記台帳書き込み操作が発生したかを判断することを含んでも良い。   According to one embodiment of the present disclosure, detecting whether the ledger operation includes the transaction uncertainty factor by the detection unit 102 is performed in an execution path ending in the ledger reading operation. The method of tracking may include determining whether the ledger write operation has occurred on the execution path.

具体的には、検出ユニット102は、全ての台帳読み取り操作(GetState())について、その前の実行経路に台帳書き込み操作(PutState())が含まれるかを分析しても良い。そのうちの1つの実行経路における台帳読み取り操作の前に台帳書き込み操作が含まれており、且つその操作の対象が同じ台帳状態(変数)である場合、さらに台帳書き込み操作及び台帳読み取り操作の前に該変数に修正があったかを判断する。該変数に修正がない場合、台帳読み取り操作及び台帳書き込み操作の対象が同じ台帳状態であることを示し、この場合、取引不確定性リスク即ちRYWリスクが発生したと判定する。   Specifically, the detection unit 102 may analyze whether or not the ledger write operation (PutState ()) is included in the previous execution path for all ledger read operations (GetState ()). If a ledger write operation is included before a ledger read operation in one of the execution paths, and the operation target is the same ledger state (variable), the ledger write operation and the ledger read operation are further performed before the ledger write operation and the ledger read operation. Determine whether the variable has been modified. If the variable is not corrected, it indicates that the target of the ledger reading operation and the ledger writing operation are in the same ledger state, and in this case, it is determined that the transaction uncertainty risk, that is, the RYW risk has occurred.

要するに、本開示は、制御流分析に基づくスマート・コントラクト不確定性要因の検出案を提供する。図5に示すように、まず、スマート・コントラクトを抽象構文木(AST)に変換し、その後、深さ走査アルゴリズムを最適化することで、それがトラバーサル経路(即ち、実行経路)を記録し得るようにさせる。そして、最適化後の深さ走査アルゴリズムを用いて、ASTに対して走査を行うことで、全ての台帳操作(台帳読み取り操作及び台帳書き込み操作)を見つけると同時に、各台帳操作の実行経路を記録する。また、ASTに対して構文分析を行うときに、行に跨る幾つかの語句の範囲、例えば、if、switch、forなどの文に係る範囲を抽出し、こられの行に跨る語句の範囲情報を用いて実行経路を拡張する。   In summary, the present disclosure provides a scheme for detecting smart contract uncertainty factors based on control flow analysis. As shown in FIG. 5, first, the smart contract is converted into an abstract syntax tree (AST), which can then record the traversal path (ie, execution path) by optimizing the depth traversal algorithm So that Then, by scanning the AST using the optimized depth scanning algorithm, all ledger operations (ledger reading operation and ledger writing operation) are found, and the execution path of each ledger operation is recorded. I do. Also, when syntactic analysis is performed on the AST, a range of several phrases extending over a line, for example, a range relating to a sentence such as if, switch, for, etc. is extracted, and the range information of the phrase extending over these lines is extracted. To extend the execution path.

続いて、スマート・コントラクトのコード不確定性検出について、まず、前記ASTに対して構文分析を行い、その後、台帳操作の実行経路においてバックトラッキングの方式で、台帳操作の対象及び値にコード不確定性要因が含まれるかを判断し、また、取引不確定性検出について、まず、台帳読み取り操作でエンドする全ての実行経路を分析し、該経路に台帳書き込み操作が発生したかを判断し、台帳書き込み操作及び台帳読み取り操作の対象が同じ台帳対象(変数)であり、且つ該対象が台帳書き込み操作と台帳読み取り操作との間に修正されたことがない場合、取引不確定性リスク即ちRYWリスクリスクが発生したと判断する。   Next, regarding the code uncertainty detection of the smart contract, first, the syntax analysis is performed on the AST, and then the code uncertainty is determined in the ledger operation target and value by the back tracking method in the ledger operation execution path. Gender factor is included, and for transaction uncertainty detection, first, all execution paths ending with the ledger reading operation are analyzed, and it is determined whether ledger writing operation has occurred on the ledger. If the target of the write operation and the ledger read operation are the same ledger target (variable) and the target has not been modified between the ledger write operation and the ledger read operation, the transaction uncertainty risk, that is, the RYW risk risk Is determined to have occurred.

本開示によるスマート・コントラクトのための不確定性検出装置を用いることにより、スマート・コントラクトの開発者の効率を大幅に向上させることができ、また、コントラクト実行過程においてコード不確定性による裏書きの失敗を減らすことができるとともに、取引不確定性の発生を低減することもできる。   By using the uncertainty detection device for smart contract according to the present disclosure, the efficiency of the smart contract developer can be greatly improved, and endorsement due to code uncertainty during the contract execution process can be achieved. Failures can be reduced, and the occurrence of transaction uncertainty can be reduced.

以下、図6をもとに、本開示による実施例のスマート・コントラクトのための不確定性要因検出方法を説明する。図6に示すように、本開示の実施例におけるスマート・コントラクトのための不確定性要因検出方法は、ステップS610でスタートする。   Hereinafter, an uncertainty factor detection method for a smart contract according to an embodiment of the present disclosure will be described with reference to FIG. As shown in FIG. 6, the uncertainty factor detection method for a smart contract according to the embodiment of the present disclosure starts in step S610.

ステップS610では、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析し、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する。   In step S610, the traversal route of the ledger operation of the smart contract is analyzed, and when it is determined that the traversal route includes a branch structure, the traversal route is extended.

続いて、ステップS620では、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出する。   Subsequently, in step S620, it is detected whether the ledger operation includes an uncertainty factor for the traversal route.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法は、さらに、前記スマート・コントラクトを抽象構文木に変換し;及び前記抽象構文木の走査のための標準ライブラリを、前記トラバーサル経路を記録し得るように修正することを含む。   The method for detecting uncertainty factors for a smart contract in one embodiment of the present disclosure further comprises: converting the smart contract into an abstract syntax tree; and Including modifying the traversal path so that it can be recorded.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記不確定性要因は、コード不確定性要因及び取引不確定性要因を含む。   In the method for detecting an uncertainty factor for a smart contract according to an embodiment of the present disclosure, the uncertainty factor includes a code uncertainty factor and a transaction uncertainty factor.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記台帳操作に前記コード不確定性要因が含まれるかの検出は、バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断することを含む。   In the method for detecting an uncertainty factor for a smart contract according to an embodiment of the present disclosure, the detection of whether or not the code uncertainty factor is included in the ledger operation is performed in a backtracking manner, and the object of the ledger operation is And determining whether the value includes a code uncertainty factor.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記台帳操作は、台帳読み取り操作及び台帳書き込み操作を含む。   In the uncertainty factor detecting method for a smart contract according to an embodiment of the present disclosure, the ledger operation includes a ledger reading operation and a ledger writing operation.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記台帳操作に前記取引不確定性要因が含まれるかの検出は、前記台帳読み取り操作でエンドする実行経路において、バックトラッキングの方式で、該実行経路に前記台帳書き込み操作が発生したかを判断することを含む。   In the uncertainty factor detection method for a smart contract according to an embodiment of the present disclosure, the detection of whether the ledger operation includes the transaction uncertainty factor is performed in an execution path ending with the ledger reading operation, Determining whether or not the ledger write operation has occurred in the execution path in a backtracking manner.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記台帳読み取り操作及び前記台帳書き込み操作の対象は、同じ台帳対象の変数である。   In the method of detecting an uncertainty factor for a smart contract according to an embodiment of the present disclosure, the ledger reading operation and the ledger writing operation are performed on the same ledger target variable.

本開示の一実施例におけるスマート・コントラクトのための不確定性要因検出方法では、前記台帳操作に前記取引不確定性要因が含まれるかの検出は、さらに、前記台帳書き込み操作及び前記台帳読み取り操作の前に前記台帳対象の変数が修正されたかを判断することを含む。   In the uncertainty factor detecting method for a smart contract according to an embodiment of the present disclosure, the detection of whether the ledger operation includes the transaction uncertainty factor may further include the ledger writing operation and the ledger reading operation. Before determining whether the ledger target variable has been modified.

本開示によるスマート・コントラクトのための不確定性検出方法を用いることにより、スマート・コントラクトの開発者の効率を大幅に向上させることができ、また、コントラクト実行過程においてコード不確定性による裏書きの失敗を減らすことができるとともに、取引不確定性の発生を低減することもできる。   By using the uncertainty detection method for smart contracts according to the present disclosure, the efficiency of a smart contract developer can be greatly improved, and endorsement due to code uncertainty during the contract execution process can be achieved. Failures can be reduced, and the occurrence of transaction uncertainty can be reduced.

本開示の実施例におけるスマート・コントラクトのための不確定性要因検出方法における上述のステップの各種の具体的な実施方式は、前に既に詳細に説明されているがため、ここでは、その詳しい記載を割愛する。   Various specific implementations of the above steps in the method of detecting uncertainty factors for smart contracts in the embodiment of the present disclosure have been described in detail previously, and will not be described here. Omit.

また、明らかのように、本開示によるスマート・コントラクトのための不確定性要因検出方法の各操作プロセスは、各種のマシン可読記憶媒体に含まれているコンピュータ実行可能なプログラムにより実現することもできる。   Also, as will be apparent, each operating process of the uncertainty factor detection method for a smart contract according to the present disclosure can be implemented by a computer-executable program included in various machine-readable storage media. .

さらに、本開示の目的は、次のような方式で実現されても良く、即ち、上述の実行可能なプログラムコードを含む記憶媒体を直接又は間接的にシステム又は機器に提供し、該システム又は機器中のコンピュータ又は中央処理ユニット(CPU)は、上述のプログラムコードを読み取って実行することである。このときに、該システム又は機器はプログラムを実行し得る機能を有すれば良い。なお、本開示の実施方式は、プログラムに限定されず、また、該プログラムは、任意の形式のものであっても良く、例えば、オブジェクトプログラム、インタプリタ実行のプログラム、又は、オペレーティングシステムに提供するスクリプトプログラムなどであっても良い。   Further, the object of the present disclosure may be realized in the following manner, that is, a storage medium including the above-described executable program code is directly or indirectly provided to a system or an apparatus, and the system or the apparatus is provided. The inside computer or central processing unit (CPU) is to read and execute the above program code. At this time, the system or the device only needs to have a function of executing the program. Note that the implementation method of the present disclosure is not limited to a program, and the program may be in any form, for example, an object program, a program for executing an interpreter, or a script provided to an operating system. It may be a program or the like.

これらのマシン可読記憶媒体は、各種の記憶デバイス、記憶ユニット、半導体記憶装置、ディスクユニット、例えば、光、磁気、及び光磁気ディスク、及び、記憶情報を記憶し得る他の媒体などを含んでも良いが、これに限定されない。   These machine-readable storage media may include various storage devices, storage units, semiconductor storage devices, disk units, such as optical, magnetic, and magneto-optical disks, and other media that can store stored information. However, the present invention is not limited to this.

また、コンピュータがインターネット上のウェブサイトにアクセスし、本開示によるコンピュータプログラムコードをダウンロードしてインストールし、その後、該プログラムを実行することにより、本開示による技術案を実現することもできる。   Further, the technical solution according to the present disclosure can be realized by a computer accessing a website on the Internet, downloading and installing the computer program code according to the present disclosure, and then executing the program.

なお、上述の一連の処理は、ソフトウェア及び/又はファームウェアにより実現されても良い。ソフトウェア及び/又はファームウェアにより実現される場合、記憶媒体又はネットワークから、専用ハードウェアを有するコンピュータ、例えば、図7に示す汎用コンピュータ1300に、該ソフトウェアを構成するプログラムをインストールし、該コンピュータは、各種のプログラムがインストールされているときに、各種の機能を実行することができる。   Note that the above-described series of processing may be realized by software and / or firmware. When realized by software and / or firmware, a program having the software is installed from a storage medium or a network into a computer having dedicated hardware, for example, a general-purpose computer 1300 shown in FIG. When the program is installed, various functions can be executed.

本開示の実施例におけるスマート・コントラクトのための不確定性要因検出装置及び方法を実現し得る汎用コンピュータの構成図である。   FIG. 1 is a configuration diagram of a general-purpose computer that can implement an uncertainty factor detection device and method for a smart contract in an embodiment of the present disclosure.

図7では、中央処理装置(CPU)1301は、ROM 1302に記憶されているプログラム又は記憶部1308からRAM 1303にロードされているプログラムに基づいて各種の処理を行う。RAM 1303では、さらに、CPU 1301が各種の処理などを実行するときに必要なデータを記憶しても良い。CPU 1301、ROM 1302、及びRAM 1303は、バス1304により互いに接続される。入力/出力インターフェース1305もバス1304に接続される。   In FIG. 7, a central processing unit (CPU) 1301 performs various processes based on a program stored in a ROM 1302 or a program loaded from a storage unit 1308 into a RAM 1303. The RAM 1303 may further store data required when the CPU 1301 executes various processes. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other by a bus 1304. An input / output interface 1305 is also connected to the bus 1304.

また、次のような部品は、入力/出力インターフェース1305に接続され、即ち、入力部606(キーボード、マウスなどを含む)、出力部1307(表示器、例えば、CRT、LCDなど、及びスピーカーなどを含む)、記憶部1308(ハードディスクなどを含む)、及び通信部1309(ネットワーク・インターフェース・カード、例えば、LANカード、モデムなどを含む)というような部品である。通信部1309は、ネットワーク、例えば、インターネットを経由して通信処理を行う。なお、必要に応じて、ドライブ1310を入力/出力インターフェース1305に接続させても良い。取り外し可能な媒体1311、例えば、磁気ディスク、光ディスク、光磁気ディスク、半導体記憶器などは、必要に応じて、ドライブ1310にセットされ、その中から読み出されたコンピュータプログラムが必要に応じて記憶部1308にインスタールされるようにさせることができる。   In addition, the following components are connected to the input / output interface 1305, that is, the input unit 606 (including a keyboard, a mouse, and the like), the output unit 1307 (a display, for example, a CRT, an LCD, and the like, a speaker, and the like). And a communication unit 1309 (including a network interface card, for example, a LAN card, a modem, etc.). The communication unit 1309 performs communication processing via a network, for example, the Internet. Note that the drive 1310 may be connected to the input / output interface 1305 as needed. A removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor storage device is set in the drive 1310 as necessary, and a computer program read out of the storage device is stored in the storage unit as needed. 1308 can be installed.

また、本開示は、さらに、マシン可読指令コードを含むプログラムプロダクトを提供する。このような指令コードは、マシンにより読み取られて実行されるときに、上述の本開示の実施形態における方法を実行することができる。それ相応に、このようなプログラムプロダクトをキャリー(carry)する、例えば、磁気ディスク(フロッピーディスク(登録商標)を含む)、光ディスク(CD-ROM及びDVDを含む)、光磁気ディスク(MD(登録商標)を含む)、及び半導体記憶器などの各種記憶媒体も、本開示に含まれる。   In addition, the present disclosure further provides a program product including a machine-readable command code. Such instruction codes, when read and executed by a machine, may perform the methods in the embodiments of the present disclosure described above. Accordingly, such program products carry, for example, magnetic disks (including floppy disks (registered trademark)), optical disks (including CD-ROMs and DVDs), magneto-optical disks (MD (registered trademark)). ), And various storage media such as semiconductor storage devices are also included in the present disclosure.

上述の記憶媒体は、例えば、磁気ディスク、光ディスク、光磁気ディスク、半導体記憶器などを含んでも良いが、これらに限定されない。   The above-described storage medium may include, for example, a magnetic disk, an optical disk, a magneto-optical disk, and a semiconductor storage device, but is not limited thereto.

また、本開示の上述の方法の各操作(処理)は、各種のマシン可読記憶媒体に記憶されているコンピュータ実行可能なプログラムの方式で実現することもできる。   Further, each operation (process) of the above-described method of the present disclosure can be realized by a method of a computer-executable program stored in various machine-readable storage media.

また、以上の実施例などに関し、さらに以下のように付記を開示する。   Further, with respect to the above embodiments and the like, additional notes are disclosed as follows.

(付記1)
スマート・コントラクトのための不確定性要因検出装置であって、
分析ユニットであって、前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析するもの;及び
検出ユニットであって、前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出するものを含み、
前記分析ユニットは、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する、検出装置。
(Appendix 1)
An uncertainty factor detection device for a smart contract,
An analysis unit that analyzes a traversal route of the ledger operation of the smart contract; and a detection unit that detects whether the ledger operation includes an uncertainty factor for the traversal route. Including
The detection device, wherein the analysis unit expands the traversal route when determining that the traversal route includes a branch structure.

(付記2)
付記1に記載の検出装置であって、
前記分析ユニットは、さらに、
前記スマート・コントラクトを抽象構文木に変換し;及び
前記抽象構文木の走査のための標準ライブラリを、前記トラバーサル経路を記録するために修正する、検出装置。
(Appendix 2)
The detection device according to claim 1, wherein
The analysis unit further comprises:
A detection device for converting the smart contract into an abstract syntax tree; and modifying a standard library for scanning the abstract syntax tree to record the traversal path.

(付記3)
付記1又は2に記載の検出装置であって、
前記不確定性要因は、コード不確定性要因及び取引不確定性要因を含む、検出装置。
(Appendix 3)
The detection device according to Supplementary Note 1 or 2, wherein
The detection device, wherein the uncertainty factor includes a code uncertainty factor and a transaction uncertainty factor.

(付記4)
付記3に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記コード不確定性要因が含まれるかを検出することは、
バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断することを含む、検出装置。
(Appendix 4)
The detection device according to claim 3, wherein
The detection unit detects whether the ledger operation includes the code uncertainty factor,
A detection device, comprising: determining whether a target and a value of the ledger operation include a code uncertainty factor by a back tracking method.

(付記5)
付記4に記載の検出装置であって、
前記台帳操作は、台帳読み取り操作及び台帳書き込み操作を含む、検出装置。
(Appendix 5)
The detection device according to claim 4, wherein
The detection device, wherein the ledger operation includes a ledger reading operation and a ledger writing operation.

(付記6)
付記5に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、
前記台帳読み取り操作でエンドする実行経路において、バックトラッキングの方式で、該実行経路に前記台帳書き込み操作が発生したかを判断することを含む、検出装置。
(Appendix 6)
The detection device according to claim 5, wherein
The detection unit detects whether the ledger operation includes the transaction uncertainty factor,
A detection device, comprising: determining whether the ledger write operation has occurred on the execution path in an execution path ending with the ledger reading operation by a back tracking method.

(付記7)
付記6に記載の検出装置であって、
前記台帳読み取り操作及び前記台帳書き込み操作は、同じ台帳対象に対して行われる、検出装置。
(Appendix 7)
The detection device according to claim 6, wherein
A detection device, wherein the ledger reading operation and the ledger writing operation are performed on the same ledger object.

(付記8)
付記7に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、さらに、
前記台帳書き込み操作及び前記台帳読み取り操作の前に前記台帳対象の変数が修正されたかを判断することを含む、検出装置。
(Appendix 8)
The detection device according to claim 7, wherein
Wherein the detecting unit detects whether the ledger operation includes the transaction uncertainty factor,
A detection device, comprising: determining whether a variable of the ledger has been corrected before the ledger writing operation and the ledger reading operation.

(付記9)
付記7に記載の検出装置であって、
前記台帳対象の類型は、括定数、変数、及び、定数と変数との組合せを含む、検出装置。
(Appendix 9)
The detection device according to claim 7, wherein
The detection device, wherein the type of ledger object includes a general constant, a variable, and a combination of a constant and a variable.

(付記10)
スマート・コントラクトのための不確定性要因検出方法であって、
前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析し;及び
前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出することを含み、
前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する、検出方法。
(Appendix 10)
An uncertainty factor detection method for smart contracts,
Analyzing the traversal path for the ledger operation of the smart contract; and detecting, for the traversal path, whether the ledger operation includes an uncertainty factor;
A detection method for expanding the traversal route when it is determined that the traversal route includes a branch structure.

(付記11)
付記10に記載の検出方法であって、さらに、
前記スマート・コントラクトを抽象構文木に変換し;及び
前記抽象構文木の走査のための標準ライブラリを、前記トラバーサル経路を記録するために修正することを含む、検出方法。
(Appendix 11)
The detection method according to supplementary note 10, further comprising:
A method for detecting, comprising: converting the smart contract into an abstract syntax tree; and modifying a standard library for traversing the abstract syntax tree to record the traversal path.

(付記12)
付記10又は11に記載の検出方法であって、
前記不確定性要因は、コード不確定性要因及び取引不確定性要因を含む、検出方法。
(Appendix 12)
The detection method according to Supplementary Note 10 or 11, wherein
The detection method, wherein the uncertainty factor includes a code uncertainty factor and a transaction uncertainty factor.

(付記13)
付記12に記載の検出方法であって、
前記台帳操作に前記コード不確定性要因が含まれるかを検出することは、
バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断することを含む、検出方法。
(Appendix 13)
The detection method according to supplementary note 12, wherein
Detecting whether the ledger operation includes the code uncertainty factor,
A detection method, comprising: determining whether a target and a value of the ledger operation include a code uncertainty factor by a back tracking method.

(付記14)
付記13に記載の検出方法であって、
前記台帳操作は、台帳読み取り操作及び台帳書き込み操作を含む、検出方法。
(Appendix 14)
The detection method according to supplementary note 13, wherein
The detection method, wherein the ledger operation includes a ledger reading operation and a ledger writing operation.

(付記15)
付記14に記載の検出方法であって、
前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、
前記台帳読み取り操作でエンドする実行経路において、バックトラッキングの方式で、該実行経路に前記台帳書き込み操作が発生したかを判断することを含む、検出方法。
(Appendix 15)
The detection method according to supplementary note 14, wherein
Detecting whether the ledger operation includes the transaction uncertainty factor,
A detection method, comprising: determining whether the ledger write operation has occurred on the execution path in the execution path ending with the ledger reading operation by a back tracking method.

(付記16)
付記15に記載の検出方法であって、
前記台帳読み取り操作及び前記台帳書き込み操作は、同じ台帳対象に対して行われる、検出方法。
(Appendix 16)
The detection method according to supplementary note 15, wherein
A detection method, wherein the ledger reading operation and the ledger writing operation are performed on the same ledger object.

(付記17)
付記16に記載の検出方法であって、
前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、さらに、
前記台帳書き込み操作及び前記台帳読み取り操作の前に前記台帳対象の変数が修正されたかを判断することを含む、検出方法。
(Appendix 17)
The detection method according to Supplementary Note 16, wherein
Detecting whether the ledger operation includes the transaction uncertainty factor,
A detection method, comprising: determining whether the ledger target variable has been corrected before the ledger writing operation and the ledger reading operation.

(付記18)
付記16に記載の検出方法であって、
前記台帳対象の類型は、定数、変数、及び、定数と変数との組合せを含む、検出装置。
(Appendix 18)
The detection method according to Supplementary Note 16, wherein
The detection device, wherein the type of ledger object includes a constant, a variable, and a combination of a constant and a variable.

(付記19)
コンピュータに、付記10-18のうちの任意の1項に記載の検出方法を実行させるためのプログラム。
(Appendix 19)
A program for causing a computer to execute the detection method according to any one of supplementary notes 10-18.

(付記20)
付記19に記載のプログラムを記憶したコンピュータ読み取り可能な記憶媒体。
(Appendix 20)
A computer-readable storage medium storing the program according to supplementary note 19.

以上、本開示の好ましい実施形態を説明したが、本開示はこの実施形態に限定されず、本開示の趣旨を離脱しない限り、本開示に対するあらゆる変更は、本開示の技術的範囲に属する。   Although the preferred embodiment of the present disclosure has been described above, the present disclosure is not limited to this embodiment, and any changes to the present disclosure belong to the technical scope of the present disclosure unless departing from the spirit of the present disclosure.

Claims (10)

スマート・コントラクトのための不確定性要因検出装置であって、
前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析する分析ユニット;及び
前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出する検出ユニットを含み、
前記分析ユニットは、前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する、検出装置。
An uncertainty factor detection device for a smart contract,
An analysis unit for analyzing a traversal route of the ledger operation of the smart contract; and a detection unit for detecting whether the ledger operation includes an uncertainty factor for the traversal route,
The detection device, wherein the analysis unit expands the traversal route when determining that the traversal route includes a branch structure.
請求項1に記載の検出装置であって、
前記分析ユニットは、さらに、
前記スマート・コントラクトを抽象構文木に変換し;及び
前記抽象構文木の走査のための標準ライブラリを、前記トラバーサル経路を記録するために修正する、検出装置。
The detection device according to claim 1,
The analysis unit further comprises:
A detection device for converting the smart contract into an abstract syntax tree; and modifying a standard library for scanning the abstract syntax tree to record the traversal path.
請求項1又は2に記載の検出装置であって、
前記不確定性要因は、コード不確定性要因及び取引不確定性要因を含む、検出装置。
The detection device according to claim 1 or 2,
The detection device, wherein the uncertainty factor includes a code uncertainty factor and a transaction uncertainty factor.
請求項3に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記コード不確定性要因が含まれるかを検出することは、
バックトラッキングの方式で、前記台帳操作の対象及び値にコード不確定性要因が含まれるかを判断することを含む、検出装置。
The detection device according to claim 3,
The detection unit detects whether the ledger operation includes the code uncertainty factor,
A detection device, comprising: determining whether a target and a value of the ledger operation include a code uncertainty factor by a back tracking method.
請求項4に記載の検出装置であって、
前記台帳操作は、台帳読み取り操作及び台帳書き込み操作を含む、検出装置。
The detection device according to claim 4,
The detection device, wherein the ledger operation includes a ledger reading operation and a ledger writing operation.
請求項5に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、
前記台帳読み取り操作でエンドする実行経路において、バックトラッキングの方式で、該実行経路に前記台帳書き込み操作が発生したかを判断することを含む、検出装置。
The detection device according to claim 5,
The detection unit detects whether the ledger operation includes the transaction uncertainty factor,
A detection device, comprising: determining whether the ledger write operation has occurred on the execution path in an execution path ending with the ledger reading operation by a back tracking method.
請求項6に記載の検出装置であって、
前記台帳読み取り操作及び前記台帳書き込み操作は、同じ台帳対象に対して行われる、検出装置。
The detection device according to claim 6,
A detection device, wherein the ledger reading operation and the ledger writing operation are performed on the same ledger object.
請求項7に記載の検出装置であって、
前記検出ユニットが、前記台帳操作に前記取引不確定性要因が含まれるかを検出することは、さらに、
前記台帳書き込み操作及び前記台帳読み取り操作の前に前記台帳対象の変数が修正されたかを判断することを含む、検出装置。
The detection device according to claim 7,
Wherein the detecting unit detects whether the ledger operation includes the transaction uncertainty factor,
A detection device, comprising: determining whether a variable of the ledger has been corrected before the ledger writing operation and the ledger reading operation.
スマート・コントラクトのための不確定性要因検出方法であって、
前記スマート・コントラクトの台帳操作について、そのトラバーサル経路を分析し;及び
前記トラバーサル経路について、前記台帳操作に不確定性要因が含まれるかを検出することを含み、
前記トラバーサル経路に分岐構造が含まれていると判断したときに、前記トラバーサル経路を拡張する、検出方法。
An uncertainty factor detection method for smart contracts,
Analyzing the traversal path for the ledger operation of the smart contract; and detecting, for the traversal path, whether the ledger operation includes an uncertainty factor;
A detection method for expanding the traversal route when it is determined that the traversal route includes a branch structure.
プログラムを記憶しているコンピュータ読み取り可能な記憶媒体であって、
前記プログラムは、コンピュータに、請求項9に記載の検出方法を実行させるためのものである、記憶媒体。
A computer-readable storage medium storing a program,
10. A storage medium for causing a computer to execute the detection method according to claim 9.
JP2019137888A 2018-09-11 2019-07-26 Uncertainty factor detector for smart contract, method and storage medium Pending JP2020042795A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811056017.3A CN110889574A (en) 2018-09-11 2018-09-11 Uncertainty factor detection device, method and medium for intelligent contract
CN201811056017.3 2018-09-11

Publications (1)

Publication Number Publication Date
JP2020042795A true JP2020042795A (en) 2020-03-19

Family

ID=69745438

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019137888A Pending JP2020042795A (en) 2018-09-11 2019-07-26 Uncertainty factor detector for smart contract, method and storage medium

Country Status (2)

Country Link
JP (1) JP2020042795A (en)
CN (1) CN110889574A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210158463A1 (en) * 2019-11-27 2021-05-27 International Business Machines Corporation Formal Verification of Smart Contracts

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666216B (en) * 2020-06-05 2024-01-23 中国银行股份有限公司 Intelligent contract analysis method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101788970B (en) * 2009-01-24 2013-03-13 群联电子股份有限公司 Data string transmitting method, system and controller thereof
CN102231134A (en) * 2011-07-29 2011-11-02 哈尔滨工业大学 Method for detecting redundant code defects based on static analysis
CN102567200A (en) * 2011-12-14 2012-07-11 北京航空航天大学 Parallelization security hole detecting method based on function call graph
US10095878B2 (en) * 2015-06-02 2018-10-09 ALTR Solutions, Inc. Internal controls engine and reporting of events generated by a network or associated applications
CN105976231A (en) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 Asset management method based on intelligent block chain contracts and nodes
CN106296359A (en) * 2016-08-13 2017-01-04 深圳市樊溪电子有限公司 Credible electric power networks transaction platform based on block chain technology
CN108073513A (en) * 2017-04-21 2018-05-25 富士通株式会社 The apparatus and method tested the intelligent contract based on block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210158463A1 (en) * 2019-11-27 2021-05-27 International Business Machines Corporation Formal Verification of Smart Contracts
US11587189B2 (en) * 2019-11-27 2023-02-21 International Business Machines Corporation Formal verification of smart contracts

Also Published As

Publication number Publication date
CN110889574A (en) 2020-03-17

Similar Documents

Publication Publication Date Title
US10459695B2 (en) Correction of code errors using machine learning
US9594553B2 (en) Identifying semantic differences between source code versions
US9280442B1 (en) System and method for generating coverage reports for software unit tests
US9898387B2 (en) Development tools for logging and analyzing software bugs
US8516442B2 (en) Graphical user interface metadata evolution tool
JP5415557B2 (en) User script code conversion for debugging
US11372751B2 (en) Autonomous self-healing test automation
US20130159975A1 (en) Detecting a broken point in a web application automatic test case
JP2019053729A (en) Test method and test apparatus of smart contract
NL2029881A (en) Methods and apparatus for automatic detection of software bugs
US8898649B2 (en) Application program analysis method, analysis system and recording medium for identifying a contributing factor for an invalid operation of an application program
US20160124795A1 (en) Evaluation method and apparatus
JP2020042795A (en) Uncertainty factor detector for smart contract, method and storage medium
US10839124B1 (en) Interactive compilation of software to a hardware language to satisfy formal verification constraints
US11030074B2 (en) Code update based on detection of change in runtime code during debugging
US10656922B2 (en) Systems and methods for providing an application transformation tool
US20230409976A1 (en) Rewriting method and information processing apparatus
US11861332B2 (en) String localization for universal use
CN111796832B (en) Hot patch file generation method, device, equipment and storage medium
JP6878707B2 (en) Test equipment, test methods and test programs
KR101534493B1 (en) Source code security weakness detection apparatus and method based on structure conversion
JP6955162B2 (en) Analytical equipment, analysis method and analysis program
JP5516277B2 (en) Test case relation extraction method, test case relation extraction device, and test case relation extraction program
US11740895B2 (en) Generation of software program repair explanations
WO2022249256A1 (en) Api detection device, api detection method, and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220407

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230322

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230404

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20231010