Blockchain interoperability system
The present disclosure describes a blockchain interoperability system. The system includes one or more memories and one or more processors communicatively coupled to the one or more memories. The one or more processors, individually or collectively, receive a request for a destination token on a destination blockchain, determine, based on one or more data structures, a first blockchain on which an intermediate token can be converted into the destination token, convert, on the first blockchain, the intermediate token into the destination token, and bridge the destination token from the first blockchain to the destination blockchain.
1 . A computer system, comprising:
one or more processors; and
one or more memories storing program code that is executable by the one or more processors for causing the one or more processors to perform operations including:
receiving a request for a destination token on a destination blockchain;
based on receiving the request, determining a location of a user who submitted the request;
determining, based on the location of the user, a blockchain path through a plurality of blockchains to obtain the destination token;
generating a batch instruction based on the determined blockchain path, wherein the batch instruction includes a plurality of portions for performing a plurality of blockchain operations on the plurality of blockchains within the blockchain path to obtain the destination token;
submitting the batch instruction to a blockchain system for executing the plurality of blockchain operations;
after submitting the batch instruction to the blockchain system, detecting an error with the execution of a particular blockchain operation among the plurality of blockchain operations;
in response to detecting the error, generating an adjusted batch instruction that resolves the error with the particular blockchain operation, wherein the adjusted batch instruction is generated by modifying a particular portion of the batch instruction corresponding to the particular blockchain operation; and
submitting the adjusted batch instruction for execution by the blockchain system.
2 . The computer system of claim 1 , wherein the operations further comprise:
determining, based on one or more data structures, a blockchain on which an intermediate token can be on-ramped, the blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to on-ramp the intermediate token onto the blockchain.
3 . The computer system of claim 1 , wherein the operations further comprise:
determining, based on one or more data structures, a blockchain on which an intermediate token can be converted into the destination token, the blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to convert the intermediate token into the destination token on the blockchain.
4 . The computer system of claim 1 , wherein the operations further comprise:
determining, based on one or more data structures, a blockchain on which an intermediate token can be bridged from a first blockchain to a second blockchain, the first blockchain and the second blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to bridge the intermediate token from the first blockchain to the second blockchain.
5 . The computer system of claim 1 , wherein the operations further comprise:
authenticating a blockchain operation of the plurality of blockchain operations to be performed on a blockchain of the plurality of blockchains based on (i) a signing key, (ii) a signature, (iii) a hashing algorithm, or (iv) an address.
6 . The computer system of claim 1 , wherein the operations further comprise:
providing a gas token for converting an intermediate token into the destination token on a blockchain of the plurality of blockchains.
7 . The computer system of claim 1 , wherein the operations further comprise:
determining the blockchain path through the plurality of blockchains based on one or more predefined data structures.
8 . The computer system of claim 7 , wherein the one or more data structures is a table.
9 . A method comprising:
receiving, by one or more processors, a request for a destination token on a destination blockchain;
based on receiving the request, determining, by the one or more processors, a location of a user who submitted the request;
determining, by the one or more processors and based on the location of the user, a blockchain path through a plurality of blockchains to obtain the destination token;
generating, by the one or more processors, a batch instruction based on the determined blockchain path, wherein the batch instruction includes a plurality of portions for performing a plurality of blockchain operations on the plurality of blockchains within the blockchain path to obtain the destination token;
submitting, by the one or more processors, the batch instruction to a blockchain system for executing the plurality of blockchain operations;
after submitting the batch instruction to the blockchain system, detecting, by the one or more processors, an error with the execution of a particular blockchain operation among the plurality of blockchain operations;
in response to detecting the error, generating, by the one or more processors, an adjusted batch instruction that resolves the error with the particular blockchain operation, wherein the adjusted batch instruction is generated by modifying a particular portion of the batch instruction corresponding to the particular blockchain operation; and
submitting, by the one or more processors, the adjusted batch instruction for execution by the blockchain system.
10 . The method of claim 9 , further comprising:
determining, based on one or more data structures, a blockchain on which an intermediate token can be on-ramped, the blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to on-ramp the intermediate token onto the blockchain.
11 . The method of claim 9 , further comprising:
determining, based on one or more data structures, a blockchain on which an intermediate token can be converted into the destination token, the blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to convert the intermediate token into the destination token on the blockchain.
12 . The method of claim 9 , further comprising:
determining, based on one or more data structures, a blockchain on which an intermediate token can be bridged from a first blockchain to a second blockchain, the first blockchain and the second blockchain being included in the plurality of blockchains; and
generating the batch instruction to include a sub-instruction configured to bridge the intermediate token from the first blockchain to the second blockchain.
13 . The method of claim 9 , further comprising:
authenticating a blockchain operation of the plurality of blockchain operations to be performed on a blockchain of the plurality of blockchains based on (i) a signing key, (ii) a signature, (iii) a hashing algorithm, or (iv) an address.
14 . The method of claim 9 , further comprising:
providing a gas token for converting an intermediate token into the destination token on a blockchain of the plurality of blockchains.
15 . The method of claim 9 , further comprising:
determining the blockchain path through the plurality of blockchains based on one or more predefined data structures.
16 . The method of claim 15 , wherein the one or more data structures is a list.
17 . A non-transitory computer-readable medium storing program code that is executable by one or more processors for causing the one or more processors to perform operations including:
receiving a request for a destination token on a destination blockchain;
based on receiving the request, determining a location of a user who submitted the request;
determining, based on the location of the user, a blockchain path through a plurality of blockchains to obtain the destination token;
generating a batch instruction based on the determined blockchain path, wherein the batch instruction includes a plurality of portions for performing a plurality of blockchain operations on the plurality of blockchains within the blockchain path to obtain the destination token;
submitting the batch instruction to a blockchain system for executing the plurality of blockchain operations;
after submitting the batch instruction to the blockchain system, detecting an error with the execution of a particular blockchain operation among the plurality of blockchain operations;
in response to detecting the error, generating an adjusted batch instruction that resolves the error with the particular blockchain operation, wherein the adjusted batch instruction is generated by modifying a particular portion of the batch instruction corresponding to the particular blockchain operation; and
submitting the adjusted batch instruction for execution by the blockchain system.
18 . The non-transitory computer-readable medium of claim 17 , wherein the plurality of blockchain operations includes an on-ramping operation for on-ramping an intermediate token.
19 . The non-transitory computer-readable medium of claim 17 , wherein the plurality of blockchain operations includes a conversion operation for converting an intermediate token to another token.
20 . The non-transitory computer-readable medium of claim 17 , wherein the plurality of blockchain operations includes a bridging operation for bridging an intermediate token from a first blockchain to a second blockchain.