HTLC with proof of elapsed time
View Patent ↗An example operation may include one or more of generating a hashed timelock contract (HTLC) of an asset and storing the HTLC in a storage structure, where the HTLC requires proof of a condition by a receiver within a predetermined amount of time for the receiver to unlock the asset, executing, via a processing device, a sequential computation a predetermined number of steps and generating proof of a computational load based on an output of the serial computation, determining that the condition for the client to unlock the HTLC has expired, and transmitting a request for a refund of the asset which comprises the proof of the computational load as proof of elapsed time to the storage structure.
1 . An apparatus, comprising:
a memory that comprises a storage structure; and
a processor configured to:
generate a hashed timelock contract (HTLC) of an asset;
store the HTLC in the storage structure, wherein
the HTLC comprises an instruction that:
requires a proof of a condition by a receiver of the asset within a predetermined amount of time for a sender to reclaim the asset, and
indicates a predetermined number of steps of a sequential computation, corresponding to the predetermined amount of time;
execute the sequential computation comprising the predetermined number of steps, wherein the execution of the sequential computation comprises execution of a serial algorithm that cannot be parallelized until the serial algorithm has been executed the predetermined number of steps;
generate a proof of a computational load as a proof of elapsed time, based on an output of the sequential computation, wherein the computational load indicates the predetermined amount of time required for the sender to reclaim the asset;
determine, based on the proof of the computational load, that the condition to unlock the HTLC has expired; and
transmit, based on the determination that the condition to unlock the HTLC has expired, a request for a refund of the asset which comprises the proof of the computational load as the proof of the elapsed time to the storage structure.
2 . The apparatus of claim 1 , wherein the processor is further configured to:
receive a random seed value from the receiver; and
iteratively execute the serial algorithm that starts with the random seed value provided by the receiver.
3 . The apparatus of claim 1 , wherein the processor is further configured to:
receive a random seed value from a blockchain ledger; and
iteratively execute the serial algorithm that starts with the random seed value provided by the blockchain ledger.
4 . The apparatus of claim 1 , wherein the execution of the sequential computation comprises identification of a chunk of data on which to perform the sequential computation based on public parameters that are posted via the storage structure.
5 . The apparatus of claim 1 , wherein the storage structure comprises a blockchain, and the transmission of the request for the refund further comprises transmission of a blockchain transaction proposal with the request for the refund and the proof of the computational load to a blockchain peer computer of the blockchain.
6 . The apparatus of claim 1 , wherein the processor is further configured to re-execute the sequential computation that comprises execution of a subset of steps with respect to the predetermined number of steps to generate a verification proof.
7 . The apparatus of claim 6 , wherein the processor is further configured to verify the computational load based on a comparison of the proof of the computational load to the verification proof.
8 . A computer-implemented method, comprising:
generating a hashed timelock contract (HTLC) of an asset;
storing the HTLC in a storage structure, wherein
the HTLC comprises an instruction that:
requires a proof of a condition by a receiver of the asset within a predetermined amount of time for the receiver to unlock the asset, and
indicates a predetermined number of steps of a sequential computation, corresponding to the predetermined amount of time;
executing, via a processing device, the sequential computation comprising the predetermined number of steps, wherein the executing of the sequential computation comprises executing, via the processing device, a serial algorithm that cannot be parallelized until the serial algorithm has been executed the predetermined number of steps;
generating a proof of a computational load as a proof of elapsed time, based on an output of the sequential computation, wherein the computational load indicates the predetermined amount of time required for a sender to reclaim the asset;
determining, based on the proof of the computational load, that the condition for the receiver to unlock the HTLC has expired; and
transmitting, based on the determining that the condition to unlock the HTLC has expired, a request for a refund of the asset.
9 . The computer-implemented method of claim 8 , further comprising receiving a random seed value from one or more of the receiver and a blockchain ledger, wherein the executing comprises iteratively executing the serial algorithm starting with the random seed value.
10 . The computer-implemented method of claim 8 , wherein the executing of the sequential computation comprises identifying a chunk of data on which to perform the sequential computation based on public parameters that are posted via the storage structure.
11 . The computer-implemented method of claim 8 , wherein the transmitting of the request for the refund comprises transmitting a blockchain transaction proposal with the request for the refund and the proof of the computational load to a blockchain peer computer of a blockchain, and wherein the storage structure comprises the blockchain.
12 . The computer-implemented method of claim 8 , further comprising re-executing the sequential computation that comprises executing a subset of steps with respect to the predetermined number of steps to generate a verification proof.
13 . The computer-implemented method of claim 12 , further comprising verifying the computational load based on a comparison of the proof of the computational load to the verification proof.
14 . A computer storage device comprising instructions, that when executed by a processor, cause the processor to perform:
generating a hashed timelock contract (HTLC) of an asset;
storing the HTLC in a storage structure, wherein
the HTLC comprises an instruction that:
requires a proof of a condition by a receiver within a predetermined amount of time for the receiver to unlock the asset, and
indicates a predetermined number of steps of a sequential computation, corresponding to the predetermined amount of time;
executing, via a processing device, the sequential computation comprising the predetermined number of steps, wherein the executing of the sequential computation comprises executing, via the processing device, a serial algorithm that cannot be parallelized until the serial algorithm has been executed the predetermined number of steps;
generating a proof of a computational load as a proof of elapsed time, based on an output of the sequential computation, wherein the computational load indicates the predetermined amount of time required for a sender to reclaim the asset;
determining, based on the proof of the computational load, that the condition for the receiver to unlock the HTLC has expired; and
transmitting, based on the determining that the condition to unlock the HTLC has expired, a request for a refund of the asset.
15 . The computer storage device of claim 14 , wherein the instructions further cause the processor to perform receiving a random seed value from one or more of the receiver and a blockchain ledger, and the executing of the serial algorithm comprises iteratively executing the serial algorithm starting with the random seed value.
16 . The computer storage device of claim 14 , wherein the executing of the sequential computation comprises identifying a chunk of data on which to perform the sequential computation based on public parameters that are posted via the storage structure.
17 . The computer storage device of claim 14 , wherein the transmitting of the request for the refund comprises transmitting a blockchain transaction proposal with the request for the refund and the proof of the computational load to a blockchain peer computer of a blockchain, and wherein the storage structure comprises the blockchain.