# US 2020/0349054 A1 · Sidechain testing system for improving security and stability of smart contract

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0349054 A1
- Document ID: US20200349054A1
- Status: Published application
- Kind: A1
- Application number: 16/774,016
- Filed: 2020-01-28
- Published: 2020-11-05
- Earliest claimed: 2019-05-05
- Assignees: Huazhong University of Science and Technology
- Applicants: Huazhong University of Science and Technology
- Inventors: Weiqi Dai; Hai Jin; Deqing Zou; Bingcheng Zhao
- Web page: https://patentgrep.com/patent/US20200349054A1

## CPC

- G06F 11/3656: {using a specific debug interface}
- H04L 9/3239: {involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- H04L 9/00: {Cryptographic mechanisms or cryptographic} arrangements for secret or secure communications; Network security protocols
- H04L 9/008: {involving homomorphic encryption}
- H04L 9/0637: {Modes of operation, e.g. cipher block chaining [CBC], electronic codebook [ECB] or Galois/counter mode [GCM]}
- H04L 9/3265: {using certificate chains, trees or paths; Hierarchical trust model}
- H04L 9/50: {using hash chains, e.g. blockchains or hash trees}
- H04L 63/00: {Network architectures or network communication protocols for network security (cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00; network architectures or network communication protocols for wireless network security H04W12/00; security arrangements for protecting computers or computer systems against unauthorised activity G06F21/00)}
- H04L 63/1433: {Vulnerability analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

The present disclosure involves a sidechain testing system and method for improving security and stability of a smart contract.

## Claims

### Claim 1

A sidechain testing system for improving security and stability of a smart contract, at least a part of modules of the system being arranged on blockchain nodes of a blockchain network and being configured to connect the blockchain network, for discovering a vulnerability of the smart contract, the sidechain testing system comprises:
a first module, used to connect the blockchain network and to receive the smart contract promulgated by a first account,
the sidechain testing system being characterized in that:
a second account decides whether to participate in a test for the smart contract when it acquires the smart contract through the first module, a third account, when it has acquired the smart contract, forks a mainchain so as to form a sidechain and deploys the smart contract on the sidechain;
wherein, the system further comprises:
a second module, being used to, when the second account decides to participate in the test of the smart contract, transfer a part or all of assets of the second account from the mainchain to the sidechain and generate a corresponding mirror image account, so that the second account is able to, independent of the mainchain, perform the test against the smart contract on the sidechain, and is configured to permit the third account to conduct mining on the sidechain;
a third module, being used to receive the vulnerability of the smart contract promulgated by the mirror image account during the test and to receive a vote made when a total call frequency of the smart contract reaches a preset value; and being configured to promulgate the vulnerability and the vote to a fourth module;
the fourth module, being configured to perform data interaction with the third modules of plural said mirror image accounts and being configured to, based on information about the plural said mirror image accounts, determine whether it is appropriate to deploy the smart contract onto the mainchain;
a supervision module, being used to receive requests from the mirror image accounts during the sidechain tests for the smart contract, so as to allow data interaction between the first account and the mirror image accounts with an access permission granted by the supervision module; and/or allow data interaction between the plural mirror image accounts with an access permission granted by the supervision module; and
a sidechain creation module, in which when the second account decides to participate in the test for the smart contract, the sidechain creation module at least creates at least one said sidechain based on information about the second account, so that the mirror image account is able to perform the test on its corresponding sidechain.

### Claim 2 (depends on 1)

The sidechain testing system of claim 1, wherein when the second account promulgates a Vote request to the supervision module, the second account promulgates its vote to the fourth module through the third module,
in which the third module is configured to acquire a vote value that represents voting intention of the second account at a voting node, and, according to a homomorphic public key generated by a counting node using a homomorphic encryption algorithm, to encrypt each said vote value so as to generate an encrypted value, and then to transmit the encrypted value to the fourth module.

### Claim 3 (depends on 2)

The sidechain testing system of claim 2, wherein the system further comprises a promulgate module,
before the smart contract is deployed to the sidechain of each said second account, the first account selects suitable said second accounts through a promulgate module of the system based on a list of the second accounts acquired from the first module, and sends information about the selected second accounts to the second module and the sidechain creation module through the promulgate module,
in which, after the sidechain creation module creates the sidechains based on the second accounts selected by the first account, the second module, based on the second accounts selected by the first account, transfers the assets of the suitable second accounts from the mainchain to the sidechains and grants the suitable second accounts with permission to conduct the tests on the sidechains.

### Claim 4 (depends on 3)

The sidechain testing system of claim 3, wherein when the supervision module receives a Quit request promulgated by the mirror image account, a settlement module in the system settles assets of the mirror image accounts during the tests and the second module transfers the settled assets of the mirror image accounts from the sidechains to the mainchain, after which the second module freezes the mirror image accounts on their corresponding sidechains.

### Claim 5 (depends on 4)

The sidechain testing system of claim 4, wherein when the supervision module receives a Revoke-Test request promulgated by the first account, the settlement module, based on contribution indexes of all the mirror image accounts during the tests for the smart contract, distributes rewards to asset accounts of the second accounts, and the second module transfers the asset accounts of the second accounts to the asset accounts of the second accounts in the mainchain, after which the sidechain creation module revokes the sidechains.

### Claim 6 (depends on 5)

The sidechain testing system of claim 5, wherein when the total call frequency of the smart contract reaches the preset value, the supervision module freezes the sidechains, and the third module prompts the second accounts to vote.

### Claim 7

A sidechain testing method for improving security and stability of a smart contract, for discovering a vulnerability of the smart contract, the method comprising:
a second account deciding whether to participate in a test for the smart contract when it acquires the smart contract through the first module, a third account, when it has acquired the smart contract, forks a mainchain so as to form a sidechain and deploys the smart contract on the sidechain;
when the second account decides to participate in the test of the smart contract, a second module transferring a part or all of assets of the second account from the mainchain to the sidechain and generating a corresponding mirror image account, so that the second account is able to, independent of the mainchain, perform the test against the smart contract on the sidechain, and is able to permit the third account to conduct mining on the sidechain;
a third module promulgating the vulnerability of the smart contract promulgated by the mirror image account during the test and a vote made when a total call frequency of the smart contract reaches a preset value to a fourth module;
the fourth module, based on information about the plural said mirror image accounts, determining whether it is appropriate to deploy the smart contract onto the mainchain;
wherein the fourth module is able to perform data interaction with the third modules of plural said mirror image accounts;
a supervision module receiving requests from the mirror image accounts during the sidechain tests for the smart contract, so as to allow data interaction between the first account and the mirror image accounts with an access permission granted by the supervision module; and/or allowing data interaction between the plural mirror image accounts with an access permission granted by the supervision module; and
a sidechain creation module, in which when the second account decides to participate in the test for the smart contract, the sidechain creation module creating at least one said sidechain based on information about the second account, so that the mirror image account is able to perform the test on its corresponding sidechain.
