Using self-regulating functions to implement blockchain-based token attribution with reduced computational complexity
A method includes receiving, from a source user account associated with a source digital wallet of a source blockchain, a request to perform a cross-chain operation from the source blockchain to a destination blockchain. The source blockchain is associated with a source token contract that stores a delta value indicative of a difference between a total number of tokens having an attribution property in circulation of the source blockchain and a number of tokens having the attribution property in circulation of the source blockchain that are accounted for by a vault of a primary blockchain. The attribution property identifies a token issuer. The method further includes causing a cross-chain message including a transaction payload to be generated based at least in part on the delta value, and causing the transaction payload to be applied to the destination blockchain.
1 . A method comprising:
receiving, by at least one processing device, a request to perform a cross-chain operation from a source blockchain of a plurality of local blockchains to a destination blockchain of the plurality of local blockchains, wherein the source blockchain is associated with a source token contract that stores a delta value indicative of a difference between a total number of tokens having an attribution property in circulation of the source blockchain and a number of tokens having the attribution property in circulation of the source blockchain that are accounted for by a vault of a primary blockchain, wherein the attribution property identifies a token issuer, and wherein the vault stores a total number of tokens having the attribution property in circulation across the plurality of local blockchains; and
performing, by the at least one processing device, the cross-chain operation with an associated space complexity that, based on use of the delta value for token reattribution, is sublinear with respect to a total number of token issuers, including:
causing a cross-chain message comprising a transaction payload to be generated based at least in part on the delta value; and
causing the transaction payload to be applied to the destination blockchain.
2 . The method of claim 1 , wherein:
the source token contract further stores a source token balance of tokens, of a source digital wallet, having the attribution property within the source digital wallet;
the cross-chain operation is a cross-chain transfer operation to transfer, from the source token balance to a destination digital wallet of the destination blockchain, a transfer amount of tokens having the attribution property;
causing the cross-chain message to be generated further comprises debiting, from the source token balance, the transfer amount of tokens having the attribution property to obtain a debited amount of tokens, and adding the debited amount of tokens to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited amount of tokens to a destination token balance maintained by a destination token contract of the destination blockchain.
3 . The method of claim 2 , wherein:
the destination digital wallet is associated with a second attribution property different from the attribution property; and
the method further comprises causing, by the at least one processing device, reattribution of: each token having the attribution property to the second attribution property, or each token having the second attribution property to the attribution property.
4 . The method of claim 2 , wherein:
the source token contract further stores a delta tracker value indicative of a difference between a total token deficit value across each attribution property that exists on the source blockchain and a total token surplus value across each attribution property that exists on the source blockchain; and
causing the cross-chain message to be generated further comprises debiting, from the delta tracker value, at least a portion of the difference having a magnitude equal to a magnitude of the delta value.
5 . The method of claim 1 , wherein:
the source token contract further stores a delta tracker value indicative of a difference between a total token deficit value across each attribution property that exists on the source blockchain and a total token surplus value across each attribution property that exists on the source blockchain;
the cross-chain operation is a delta tracker value synchronization operation to transfer, to the destination blockchain, at least a portion of the difference having a magnitude equal to a magnitude of the delta value;
causing the cross-chain message to be generated further comprises debiting, from the delta tracker value, at least a portion of the difference to obtain a debited delta tracker value, and adding the debited delta tracker value to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited delta tracker value and the delta value to a destination token contract of the destination blockchain.
6 . The method of claim 1 , wherein:
the delta value is a positive delta value indicative of a token surplus of tokens having the attribution property;
the destination blockchain is the primary blockchain;
the cross-chain operation is a remint operation to cause the vault to remint at least a portion of the token surplus;
causing the cross-chain message to be generated further comprises debiting, from the delta value, at least a portion of the token surplus to obtain a debited delta value, and adding the debited delta value to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited delta value to the vault to update a global circulation of tokens having the attribution property.
7 . The method of claim 6 , wherein:
the source token contract further stores a set of negative delta values, each negative delta value of the set of negative delta values being indicative of a respective token deficit of tokens having a respective additional attribution property different from the attribution property corresponding to the positive delta value;
causing the cross-chain message to be generated further comprises debiting, from the set of negative delta values, one or more negative delta values having a combined negative delta value having a magnitude equal to the positive delta value; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the one or more negative delta values to the vault to update one or more respective global circulation of tokens, each respective global circulation of tokens corresponding to tokens having the respective additional attribution property.
8 . The method of claim 1 , wherein the associated space complexity to perform the cross-chain operation is constant with respect to the total number of token issuers.
9 . The method of claim 1 , wherein the source token contract comprises a smart contract.
10 . A system comprising:
a memory; and
a processing device, operatively coupled to a memory, to perform operations comprising:
receiving a request to perform a cross-chain operation from a source blockchain of a plurality of local blockchains to a destination blockchain of the plurality of local blockchains, wherein the source blockchain is associated with a source token contract that stores a delta value indicative of a difference between a total number of tokens having an attribution property in circulation of the source blockchain and a number of tokens having the attribution property in circulation of the source blockchain that are accounted for by a vault of a primary blockchain, wherein the attribution property identifies a token issuer, and wherein the vault stores a total number of tokens having the attribution property in circulation across the plurality of local blockchains; and
performing the cross-chain operation with an associated space complexity that, based on use of the delta value for token reattribution, is sublinear with respect to a total number of token issuers, including:
causing a cross-chain message comprising a transaction payload to be generated based at least in part on the delta value;
causing the transaction payload to be applied to the destination blockchain.
11 . The system of claim 10 , wherein:
the source token contract further stores a source token balance of tokens, of a source digital wallet, having the attribution property within the source digital wallet;
the cross-chain operation is a cross-chain transfer operation to transfer, from the source token balance to a destination digital wallet of the destination blockchain, a transfer amount of tokens having the attribution property;
causing the cross-chain message to be generated further comprises debiting, from the source token balance, the transfer amount of tokens having the attribution property to obtain a debited amount of tokens, and adding the debited amount of tokens to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited amount of tokens to a destination token balance maintained by a destination token contract of the destination blockchain.
12 . The system of claim 11 , wherein:
the destination digital wallet is associated with a second attribution property different from the attribution property; and
the operations further comprise causing reattribution of: each token having the attribution property to the second attribution property, or each token having the second attribution property to the attribution property.
13 . The system of claim 11 , wherein:
the source token contract further stores a delta tracker value indicative of a difference between a total token deficit value across each attribution property that exists on the source blockchain and a total token surplus value across each attribution property that exists on the source blockchain; and
causing the cross-chain message to be generated further comprises debiting, from the delta tracker value, at least a portion of the difference having a magnitude equal to a magnitude of the delta value.
14 . The system of claim 10 , wherein:
the source token contract further stores a delta tracker value indicative of a difference between a total token deficit value across each attribution property that exists on the source blockchain and a total token surplus value across each attribution property that exists on the source blockchain;
the cross-chain operation is a delta tracker value synchronization operation to transfer, to the destination blockchain, at least a portion of the difference having a magnitude equal to a magnitude of the delta value;
causing the cross-chain message to be generated further comprises debiting, from the delta tracker value, at least a portion of the difference to obtain a debited delta tracker value, and adding the debited delta tracker value to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited delta tracker value and the delta value to a destination token contract of the destination blockchain.
15 . The system of claim 10 , wherein:
the delta value is a positive delta value indicative of a token surplus of tokens having the attribution property;
the destination blockchain is the primary blockchain;
the cross-chain operation is a remint operation to cause the vault to remint at least a portion of the token surplus;
causing the cross-chain message to be generated further comprises debiting, from the delta value, at least a portion of the token surplus to obtain a debited delta value, and adding the debited delta value to the transaction payload; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the debited delta value to the vault to update a global circulation of tokens having the attribution property.
16 . The system of claim 15 , wherein:
the source token contract further stores a set of negative delta values, each negative delta value of the set of negative delta values being indicative of a respective token deficit of tokens having a respective additional attribution property different from the attribution property corresponding to the positive delta value;
causing the cross-chain message to be generated further comprises debiting, from the set of negative delta values, one or more negative delta values having a combined negative delta value having a magnitude equal to the positive delta value; and
causing the transaction payload to be applied to the destination blockchain further comprises crediting the one or more negative delta values to the vault to update one or more respective global circulation of tokens, each respective global circulation of tokens corresponding to tokens having the respective additional attribution property.
17 . The system of claim 10 , wherein the associated space complexity to perform the cross-chain operation is constant with respect to the total number of token issuers.
18 . The system of claim 10 , wherein the source token contract comprises a smart contract.