US-12619629-B2 - Intelligent method to combine multiple blockchain based smart contracts leveraging generative artificial intelligence
Abstract
Aspects of the disclosure relate to using machine learning models to merge smart contracts. A computing system may receive a prompt to merge smart contracts. Based on inputting the prompt into a generative artificial intelligence model configured to parse prompts, smart contract data may be retrieved from a blockchain stored in a distributed ledger platform. Based on inputting the smart contract data into the generative artificial intelligence model, smart contract clusters may be generated. Based on at least one of the smart contract clusters meeting performance criteria, merged smart contracts that meet the performance criteria may be generated. Furthermore, one or more blocks comprising the merged smart contracts may be generated.
Inventors
- Shailendra Singh
Assignees
- BANK OF AMERICA CORPORATION
Dates
- Publication Date
- 20260505
- Application Date
- 20231006
Claims (20)
- 1 . A computing system for merging smart contracts, the computing system comprising: a distributed ledger system comprising a blockchain, wherein the blockchain comprises one or more blocks comprising a plurality of smart contracts; one or more processors; and memory storing computer-readable instructions that, when executed by the one or more processors, cause the computing system to: receive one or more prompts comprising a prompt to merge at least two smart contracts of the plurality of smart contracts; retrieve, from the one or more blocks of the blockchain, based on inputting the one or more prompts into one or more generative artificial intelligence (generative AI) models configured to parse the one or more prompts, smart contract data for the plurality of smart contracts; generate, based on inputting the smart contract data into the one or more generative AI models, a plurality of smart contract clusters comprising two or more of the plurality of smart contracts; determine whether at least one of the plurality of smart contract clusters meets one or more performance criteria; based on at least one of the plurality of smart contract clusters meeting the one or more performance criteria, generate, one or more merged smart contracts comprising the at least one of the plurality of smart contract clusters that meet the one or more performance criteria; and generate, one or more blocks of the blockchain, wherein each of the blocks of the blockchain comprises at least one of the one or more merged smart contracts.
- 2 . The computing system of claim 1 , wherein the memory stores additional computer-readable instructions to generate the plurality of smart contract clusters that, when executed by the one or more processors, further cause the computing system to: generate a plurality of abstract syntax trees (ASTs) corresponding to the plurality of smart contracts; and determine the plurality of smart contract clusters based on one or more similarities between the plurality of ASTs corresponding to the plurality of smart contracts.
- 3 . The computing system of claim 1 , wherein the memory stores additional computer-readable instructions to determine whether at least one of the plurality of smart contract clusters meets the one or more performance criteria that, when executed by the one or more processors, further cause the computing system to: generate a plurality of confidence values corresponding to the plurality of smart contract clusters; and determine the one or more merged smart contracts based on the plurality of smart contract clusters corresponding to the plurality of confidence values that exceed a confidence value threshold.
- 4 . The computing system of claim 1 , wherein the one or more generative AI models are configured to parse the one or more prompts based on performance of natural language processing operations on the one or more prompts.
- 5 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more interoperability criteria, and wherein meeting the one or more interoperability criteria comprises determining that the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters are interoperable.
- 6 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more error rate criteria, and wherein meeting the one or more error rate criteria comprises determining that an error rate of the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters does not exceed an error rate threshold.
- 7 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more response time criteria, and wherein meeting the one or more response time criteria comprises determining that a response time of the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters does not exceed a response time threshold.
- 8 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more throughput criteria, and wherein meeting the one or more throughput criteria comprises determining that a throughput of the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters exceeds a throughput threshold.
- 9 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more gas consumption criteria, and wherein meeting the one or more gas consumption criteria comprises determining that a gas consumption of the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters does not exceed a gas consumption threshold.
- 10 . The computing system of claim 1 , wherein the one or more performance criteria comprise one or more block confirmation time criteria, and wherein meeting the one or more block confirmation time criteria comprises determining that a block confirmation time of the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters does not exceed a block confirmation time threshold.
- 11 . The computing system of claim 1 , wherein the memory stores additional computer-readable instructions that, when executed by the one or more processors, further cause the computing system to: access smart contract training data comprising a plurality of historical smart contracts; generate, based on inputting the smart contract training data into the one or more generative AI models, a plurality of merged historical smart contracts; determine a similarity between the plurality of merged historical smart contracts and a plurality of ground-truth merged smart contracts; generate, based on the similarity between the plurality of merged historical smart contracts and the plurality of ground-truth merged smart contracts, a smart contract merger accuracy of the one or more generative AI models; and modify a weighting of a plurality of smart contract parameters of the one or more generative AI models based on the smart contract merger accuracy, wherein the weighting of the plurality of smart contract parameters that increase the smart contract merger accuracy is increased, and wherein the weighting of the plurality of smart contract parameters that decrease the smart contract merger accuracy is decreased.
- 12 . The computing system of claim 11 , wherein the smart contract merger accuracy is based on an amount of similarity between the plurality of merged historical smart contracts and the plurality of ground-truth merged smart contracts.
- 13 . The computing system of claim 1 , wherein the smart contract data for each of the plurality of smart contracts comprises a smart contact name, a smart contract version, a smart contract author, a smart contract compiler environment, smart contract source code, an application binary interface (ABI), a compiler setting, or a smart contract date of creation.
- 14 . The computing system of claim 1 , wherein the one or more generative AI models comprise one or more generative pretrained transformer (GPT) models.
- 15 . A method of merging smart contracts, the method comprising: receiving, by a computing device comprising one or more processors, one or more prompts comprising a prompt to merge at least two smart contracts of a plurality of smart contracts; retrieving, by the computing device, from one or more blocks of a blockchain, based on inputting the one or more prompts into one or more generative artificial intelligence (generative AI) models configured to parse the one or more prompts, smart contract data for the plurality of smart contracts; generating, by the computing device, based on inputting the smart contract data into the one or more generative AI models, a plurality of smart contract clusters comprising two or more of the plurality of smart contracts; determining, by the computing device, whether at least one of the plurality of smart contract clusters meets one or more performance criteria; based on at least one of the plurality of smart contract clusters meeting the one or more performance criteria, generating, by the computing device, one or more merged smart contracts comprising the at least one of the plurality of smart contract clusters that meet the one or more performance criteria; and generating, by the computing device, one or more blocks of the blockchain, wherein each of the one or more blocks of the blockchain comprises at least one of the one or more merged smart contracts.
- 16 . The method of claim 15 , further comprising: generating, by the computing device, a plurality of abstract syntax trees (ASTs) corresponding to the plurality of smart contracts; and determining, by the computing device, the plurality of smart contract clusters based on one or more similarities between the plurality of ASTs corresponding to the plurality of smart contracts.
- 17 . The method of claim 15 , further comprising: generating, by the computing device, a plurality of confidence values corresponding to the plurality of smart contract clusters; and determining, by the computing device, the one or more merged smart contracts based on the plurality of smart contract clusters corresponding to the plurality of confidence values that exceed a confidence value threshold.
- 18 . The method of claim 15 , wherein the one or more generative AI models are configured to parse the one or more prompts based on performance of natural language processing operations on the one or more prompts.
- 19 . The method of claim 15 , wherein the one or more performance criteria comprise one or more interoperability criteria, and wherein meeting the one or more interoperability criteria comprises determining that the two or more of the plurality of smart contracts in each of the plurality of smart contract clusters are interoperable.
- 20 . One or more non-transitory computer-readable comprising instructions that, when executed by a computing platform comprising at least one processor, a communication interface, and memory, cause the computing platform to: receive one or more prompts comprising a prompt to merge at least two smart contracts of a plurality of smart contracts; retrieve, from one or more blocks of a blockchain, based on inputting the one or more prompts into one or more generative artificial intelligence (generative AI) models configured to parse the one or more prompts, smart contract data for the plurality of smart contracts; generate, based on inputting the smart contract data into the one or more generative AI models, a plurality of smart contract clusters comprising two or more of the plurality of smart contracts; determine whether at least one of the plurality of smart contract clusters meets one or more performance criteria; based on at least one of the plurality of smart contract clusters meeting one or more performance criteria, generate, one or more merged smart contracts comprising the at least one of the plurality of smart contract clusters that meet the one or more performance criteria; and generate, one or more blocks of the blockchain, wherein each of the one or more blocks of the blockchain comprises at least one of the one or more merged smart contracts.
Description
TECHNICAL FIELD Some aspects of the disclosure relate to using machine learning models to automatically merge smart contracts. In particular, some aspects of the disclosure pertain to processing smart contracts stored in a blockchain and using a generative artificial intelligence model to merge the smart contracts based on received prompts. BACKGROUND Smart contracts may be used for a variety of purposes including the performance of financial transactions. These financial transactions may vary and may comprise multiple steps, each of which may need to be performed in order to complete the transaction. In some cases a single smart contract may perform these steps, while in other cases, different steps may be performed by different smart contracts. Smart contracts may be stored in a blockchain, which in the case of proof-of-work system may use a significant amount of computational resources and energy. As a result, a greater number of smart contracts may result in a greater use of computational resources and energy. Further, the task of attempting to optimize smart contracts may be time consuming and require significant amounts of computational resources as well as manual intervention on the part of a usually small group of individuals who are qualified to examine particular sets of smart contracts. Such manual intervention and use of computational resources may result in significant costs and use of time. As a result, attempting to optimize smart contracts may present challenges. SUMMARY Aspects of the disclosure provide technical solutions to improve the effectiveness with which smart contracts may be processed and merged. In accordance with one or more embodiments of the disclosure, a computing system for merging smart contracts may comprise: a distributed ledger system that may comprise a blockchain. The blockchain may comprise one or more blocks comprising a plurality of smart contracts. The computing system may comprise one or more processors; and memory storing computer-readable instructions that, when executed by the one or more processors, cause the computing system to receive one or more prompts that may comprise a prompt to merge at least two smart contracts of the plurality of smart contracts. The computing system may retrieve, from the one or more blocks of the blockchain, based on inputting the one or more prompts into one or more generative artificial intelligence (Generative AI) models configured to parse the one or more prompts, smart contract data for the plurality of smart contracts. The computing system may generate, based on inputting the smart contract data into the one or more generative AI models, a plurality of smart contract clusters may comprise two or more of the plurality of smart contracts. The computing system may determine whether at least one of the plurality of smart contract clusters meets one or more performance criteria. The computing system may, based on at least one of the plurality of smart contract clusters meeting one or more performance criteria, generate, one or more merged smart contracts may comprise the at least one of the plurality of smart contract clusters that meet the one or more performance criteria. The computing system may generate, one or more blocks of the blockchain. Each of the blocks of the blockchain may comprise at least one of the one or more merged smart contracts. In one or more implementations, the memory may store additional computer-readable instructions to generate the plurality of smart contract clusters that, when executed by the one or more processors, further cause the computing system to generate a plurality of abstract syntax trees (ASTs) corresponding to the plurality of smart contracts; and determine the plurality of smart contract clusters based on one or more similarities between the plurality of ASTs corresponding to the plurality of smart contracts. In one or more implementations, the memory may store additional computer-readable instructions to determine whether at least one of the plurality of smart contract clusters meets one or more performance criteria that, when executed by the one or more processors, further cause the computing system to: generate a plurality of confidence values corresponding to the plurality of smart contract clusters; and determine the one or more merged smart contracts based on the plurality of smart contract clusters corresponding to the plurality of confidence values that exceed a confidence value threshold. In one or more implementations, the memory may store additional computer-readable instructions that, when executed by the one or more processors, further cause the computing system to access smart contract training data may comprise a plurality of historical smart contracts. The computing system may generate, based on inputting the smart contract training data into the one or more generative AI models, a plurality of merged historical smart contracts. The computing system may determine a similari