# US 12,217,254 B2 · Method and system for controlling the performance of a contract using a distributed hash table and a peer-to-peer distributed ledger

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

- Number: US 12,217,254 B2
- Document ID: US12217254B2
- Status: Granted
- Kind: B2
- Application number: 16/097,222
- Filed: 2017-04-28
- Published: 2019-03-28
- Granted: 2025-02-04
- Earliest claimed: 2016-04-29
- Assignees: nChain Licensing AG
- Applicants: nChain Holdings Limited
- Inventors: Craig Steven Wright; Stephane Savanah
- Web page: https://patentgrep.com/patent/US12217254B2

## CPC

- G06Q 20/389: {Keeping log of transactions for guaranteeing non-repudiation of a transaction}
- G06F 21/00: Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F 21/602: {Providing cryptographic facilities or services}
- G06Q 20/02: involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
- G06Q 20/065: {using e-cash}
- G06Q 20/3678: {e-cash details, e.g. blinded, divisible or detecting double spending}
- G06Q 20/3827: {Use of message hashing}
- G06Q 20/3829: {involving key management}
- H04L 9/0643: {Hash functions, e.g. MD5, SHA, HMAC or f9 MAC}
- H04L 9/30: Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
- H04L 9/3247: {involving digital signatures}
- G06F 2221/2145: Inheriting rights or properties, e.g., propagation of permissions or restrictions within a hierarchy
- G06Q 2220/00: Business processing using cryptography
- H04L 2209/56: Financial cryptography, e.g. electronic payment or e-cash
- G06Q: INFORMATION 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
- 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

A computer-implemented method (100) and system (1) for controlling the performance of a smart contract. The method includes storing a contract on or in a computer-based repository. The contract is associated with a licence between a first user (U1) and a second user (U2). The method further includes receiving, over a communications network, a transaction comprising a transfer of a token from an agent (A) to the first user (U1) or the second user (U2). The transaction comprises metadata that includes an identifier indicative of a location where the contract is stored. The method further includes querying a peer-to-peer distributed ledger (i.e. blockchain) to determine whether the transaction comprises at least one unspent output (UTXO). The method further includes, responsive to querying the peer-to-peer distributed ledger, determining whether to modify performance of the contract. The blockchain may be the Bitcoin blockchain.

## Claims

### Claim 1

A computer-implemented method for controlling the performance of a contract, the method implemented by a processing resource, the method comprising:
storing a contract in a Distributed Hash Table (DHT) comprising a plurality of key-value pairs, the contract being associated with a contract of computer software between a first user (U1) and a second user (U2),
determining, by the processing resource, a key and a key value pair based on the computer software and the contract;
receiving at the processing resource over a communications network, a transaction comprising a transfer of a token from an agent (A) to the first user (U1) or the second user (U2), the transaction comprising metadata that includes an identifier indicative of a location in the DHT where the contract is stored;
querying, by the processing resource, a peer-to-peer distributed ledger to determine whether the transaction comprises at least one unspent output (UTXO) wherein querying a peer-to-peer distributed ledger comprises scanning the peer-to-peer distributed ledger to identify the at least one unspent output (UTXO) to determine whether the at least one unspent output (UTXO) has been spent or not; and
modifying, by the processing resource, performance of the contract, wherein the modifying comprises:
terminating the contract in the event that the at least one unspent output (UTXO) cannot be identified from the peer-to-peer distributed ledger, or
maintaining the contract in the event that the at least one unspent output (UTXO) is identified from the peer-to-peer distributed ledger, wherein the step of terminating the license comprises broadcasting a further transaction to spend the at least one unspent output (UTXO), wherein in the step of broadcasting the further transaction, the further transaction comprises an instruction to spend the at least one unspent output (UTXO) at a specified date and/or time, wherein the further transaction comprises:
an input that spends the at least one unspent output (UTXO); and
a redeem script comprising a signature, the metadata, an agent public key associated with the agent, and a first user public key associated with the first users.

### Claim 2 (depends on 1)

The method of claim 1, wherein the transaction further comprises a deterministic redeem script address.

### Claim 3 (depends on 2)

The method of claim 2, wherein the redeem script address is a pay-to-script-hash (P2SH) address.

### Claim 4 (depends on 1)

The method according to claim 1, wherein the contract defines:
at least one condition, the at least one condition relating to operation of the contract as between the first user (U1) and the second user (U2); and
at least one action whose performance is dependent upon the evaluation of the condition.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the metadata comprises:
an address or representation of an address of where the contract is stored in the computer-based repository; and/or
a hash of the contract.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the step of querying the peer-to-peer distributed ledger further comprises:
checking whether the contract has been terminated by determining whether the at least one unspent output (UTXO) is present in a list of unspent transaction outputs for the peer-to-peer distributed ledger.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the contract comprises a Deterministic Finite Automation (DFA) to implement the contract.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the Deterministic Finite Automation (DFA) is defined using a codification scheme.

### Claim 9 (depends on 1)

The method according to claim 1, further comprising the step of renewing the contract by performing the steps of:
generating a sub-key relating to a previous key associated with the contract;
generating a further redeem script comprising the sub-key, the location of the contract, and a hash of the contract; and
paying a quantity of a cryptocurrency (C) to the further redeem script.

### Claim 10 (depends on 1)

The method according to claim 1, further comprising the step of generating a sub-contract derived from the contract, wherein the sub-contract is associated with a deterministic address and is generated by performing the steps of:
using a new public key derived using a seed;
storing the sub-contract in or on the computer-based repository with a reference to the contract;
broadcasting a sub-contract transaction to the peer-to-peer distributed ledger, the sub-contract transaction including the reference to the contract; and
adding, to the metadata associated with the contract, a reference to the sub-contract.

### Claim 11 (depends on 1)

The method of claim 1, wherein the contract between the first user (U1) and the second user (U2) relates to one or more of:
the computer software; and
digital media, including music, videos, and electronic books.

### Claim 12 (depends on 1)

The method of claim 1, wherein the peer-to-peer distributed ledger is a blockchain.

### Claim 13 (depends on 9)

The method of claim 9, wherein the cryptocurrency is bitcoin.

### Claim 14

A non-transitory computer-readable storage medium comprising machine-readable instructions which, when executed by a processing device, cause the processing device to:
store a contract in a Distributed Hash Table (DHT) comprising a plurality of key-value pairs, the contract being associated with a contract for computer software between a first user (U1) and a second user (U2),
determining, by the processing resource, a key and a key value pair based on the computer software and the license;
receive at the processing device over a communications network, a transaction comprising a transfer of a token from an agent (A) to the first user (U1) or the second user (U2), the transaction comprising metadata that includes an identifier indicative of a location in the DHT where the contract is stored;
query, by the processing device, a peer-to-peer distributed ledger to determine whether the transaction comprises at least one unspent output (UTXO) wherein querying a peer-to-peer distributed ledger comprises scanning the peer-to-peer distributed ledger to identify the at least one unspent output (UTXO) to determine whether the at least one unspent output (UTXO) has been spent or not; and
modifying, by the processing device, performance of the contract, wherein the modifying comprises:
terminating the contract in the event that the at least one unspent output (UTXO) cannot be identified from the peer-to-peer distributed ledger, or
maintain the contract in the event that the at least one unspent output (UTXO) is identified from the peer-to-peer distributed ledger, wherein the step of terminating the license comprises broadcasting a further transaction to spend the at least one unspent output (UTXO), wherein in the step of broadcasting the further transaction, the further transaction comprises an instruction to spend the at least one unspent output (UTXO) at a specified date and/or time, wherein the further transaction comprises:
an input that spends the at least one unspent output (UTXO); and
a redeem script comprising a signature, the metadata, an agent pubic key associated with the agent, and a first user public key associated with the first user.

### Claim 15

A computer system for controlling the performance of a contract, the system comprising a processing device configured to:
store a contract in a Distributed Hash Table (DHT) comprising a plurality of key-value pairs, the contract being associated with a contract of computer software between a first user (U1) and a second user (U2),
determining, by the processing resource, a key and a key value pair based on the computer software and the contract;
receive, over a communications network, a transaction comprising a transfer of a token from an agent (A) to the first user (U1) or the second user (U2), the transaction comprising metadata that includes an identifier indicative of a location in the DHT where the contract is stored;
query a peer-to-peer distributed ledger to determine whether the transaction comprises at least one unspent output (UTXO); and
modifying performance of the contract, wherein the modifying comprises:
terminating the contract in the event that the at least one unspent output (UTXO) cannot be identified from the peer-to-peer distributed ledger, or
maintain the contract in the event that the at least one unspent output (UTXO) is identified from the peer-to-peer distributed ledger, wherein the step of terminating the license comprises broadcasting a further transaction to spend the unspent output (UTXO), wherein in the step of broadcasting the further transaction, the further transaction comprises an instruction to spend the at least one unspent output (UTXO) at a specified date and/or time, wherein the further transaction comprises:
an input that spends the at least one unspent output (UTXO); and
a redeem script comprising a signature, the metadata, an agent public key associated with the agent, and a first user public key associated with the first user.
