# US 2020/0287708 A1 · Static analysis of smart contract determinism

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

- Number: US 2020/0287708 A1
- Document ID: US20200287708A1
- Status: Published application
- Kind: A1
- Application number: 16/808,322
- Filed: 2020-03-03
- Published: 2020-09-10
- Earliest claimed: 2019-03-04
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Futoshi Iwama; Takaaki Tateishi; Shin Saito; Shunichi Amano; Sachiko Yoshihama
- Web page: https://patentgrep.com/patent/US20200287708A1

## CPC

- H04L 9/0637: {Modes of operation, e.g. cipher block chaining [CBC], electronic codebook [ECB] or Galois/counter mode [GCM]}
- H04L 9/3242: {involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC}
- G06F 11/327: {Alarm or error message display}
- G06F 21/64: Protecting data integrity, e.g. using checksums, certificates or signatures
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3692: {for test results analysis}
- H04L 9/50: {using hash chains, e.g. blockchains or hash trees}
- H04L 2209/26: Testing cryptographic entity, e.g. testing integrity of encryption key or encryption algorithm
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Smart contract code is verified by storing smart contract code, identifying a type system for verifying a determinism of the smart contract code based on a first set of security-level values and a second set of security level values, and verifying the determinism of the smart contract code by taking the first set of security-level values as deterministic values and the second set of security level values as non-deterministic values.

## Claims

### Claim 1

A computer-implemented method, comprising:
storing smart contract code;
verifying a determinism of the smart contract code by applying a type system to the smart contract code based on a first set of security level values and a second set of security level values; and
wherein the verifying comprises applying the first set of security level values as deterministic values to the smart contract code and applying the second set of security level values as non-deterministic values to the smart contract code.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the determinism of the smart contract code is verified by introducing determinism degrees for the deterministic values and the non-deterministic values.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the determinism of the smart contract code is verified by introducing list data types that represent a determinism degree of an element, a size, and an arrangement.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the determinism of the smart contract code with a for-loop statement is verified by introducing control data types having values that vary over a range of a set of values used by the for-loop.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein the determinism of the smart contract code with for-loop statements is verified based on a deterministic order of values used in the smart contract code.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein the determinism of the smart contract code with an annotation is verified by referring the annotation.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein the smart contract code is to be deployed in a node in a blockchain network.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, further comprising:
issuing an alert in response to the smart contract code being verified as non-deterministic.

### Claim 9

An apparatus, comprising:
a processor; and
memory, wherein the processor and memory are communicably coupled to one another;
wherein the processor is configured to:
store smart contract code;
verify a determinism of the smart contract code by applying a type system to the smart contract code based on a first set of security level values and a second set of security level values; and
wherein the processor applies the first set of security level values as deterministic values to the smart contract code and applies the second set of security level values as non-deterministic values to the smart contract code.

### Claim 10 (depends on 9)

The apparatus of claim 9, wherein the determinism of the smart contract code is verified by introducing determinism degrees for the deterministic values and the non-deterministic values.

### Claim 11 (depends on 9)

The apparatus of claim 9, wherein the determinism of the smart contract code is verified by introducing list data types that represent a determinism degree of an element, a size, and an arrangement.

### Claim 12 (depends on 9)

The apparatus of claim 9, wherein the determinism of the smart contract code with for-loop statement is verified by introducing control data types having values that vary over a range of a set of values used by the for-loop.

### Claim 13 (depends on 9)

The apparatus of claim 9, wherein the determinism of the smart contract code with for-loop statements is verified based on a deterministic order of values used in the smart contract code.

### Claim 14 (depends on 9)

The apparatus of claim 9, wherein the determinism of the smart contract code with an annotation is verified by referring the annotation.

### Claim 15

A non-transitory computer-readable medium comprising instructions that when read by a processor cause the processor to perform a method comprising:
storing smart contract code;
verifying a determinism of the smart contract code by applying a type system to the smart contract code based on a first set of security level values and a second set of security level values; and
wherein the verifying comprises applying the first set of security level values as deterministic values to the smart contract code and the second set of security level values as non-deterministic values to the smart contract code.

### Claim 16 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the determinism of the smart contract code is verified by introducing determinism degrees for the deterministic values and the non-deterministic values.

### Claim 17 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the determinism of the smart contract code is verified by introducing list data types that represent a determinism degree of an element, a size, and an arrangement.

### Claim 18 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the determinism of the smart contract code with for-loop statement is verified by introducing control data types having values that vary over a range of a set of values used by the for-loop.

### Claim 19 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the determinism of the smart contract code with for-loop statements is verified based on a deterministic order of values used in the smart contract code.

### Claim 20 (depends on 15)

The non-transitory computer readable medium of claim 15, wherein the determinism of the smart contract code with an annotation is verified by referring the annotation.
