The Intersection of Blockchain and Artificial Intelligence

There is currently great interest and excitement about artificial intelligence (AI) and machine learning. There is also great interest and excitement about blockchain / distributed ledger technology (DLT). Do these two fields have any overlap? Is there any way in which they are related or can be combined? Yes. There are several ways in which AI can be used to help DLT, and several ways in which DLT can be used to help AI. AI can help ledger security, development efficiency, and ease of use. And DLT can help AI by managing training data provenance, training data permissions, and micropayment royalties to training data owners.

AI systems can help ledger security by scanning the source code and looking for bugs. It may sometimes flag a "bug" that isn't one, and it may sometimes miss a bug that is actually there. But even if it is only sometimes correct, it can still aid people in finding such bugs. It can also be used to generate test cases to help find bugs during testing. These can be done both for the code of the smart contracts running on top of the ledger, and for the code of the ledger itself. And it can also be used for checking related software, such as wallet software, or other applications that use the ledger.

In the fairly near future, I expect AI will make large improvements in formal methods, by improving automated proof assistants. In formal methods, instead of a person simply reading the code and looking for bugs, they actually write a math proof that the code is correct. This can include proving that it meets its specification. But it can also go further, and prove global properties such as "no input to this smart contract can ever move an ERC-20 token from one account to another unless it is generated using knowledge of the associated private key". In other words, it can mathematically prove the absence of entire classes of bugs.

These proofs are usually too difficult for a human to do by hand, but a proof assistant is software that helps by filling in some of the details of the proof. For example, it is possible to write a proof with the Coq proof assistant, where the human only types in the major steps of the proof, similar to what would be published in a math journal, and then Coq fills in the thousands of missing steps in between, by writing the small proof that goes from each human step to the next. Today, this requires the human to give it many hints, which can be difficult to do. But AI may actually be able to automate much of this, possibly using generative AI combined with reinforcement learning. It may soon be possible for a human to use a proof assistant like Coq to prove formal correctness almost as easily as they could have simply written a human-readable proof. When that day comes, the role of formal methods proofs in software engineering may expand enormously. This will affect not only the smart contracts and the ledger code, but even help reduce bugs in the compiler, the runtime system, the operating system, and the layout of gates in the CPU itself.

AI can also make software engineers more efficient. There are generative AI tools that currently write sections of code. They often make errors that the human must then fix. But even so, it is often faster and easier to use the tool than to write everything from scratch.

Generative AI can also be useful in software that people use to access ledgers. Today, a user can move cryptocurrency or tokens using wallet software on their phone. But they must enter all the details of the transactions, and may make mistakes that are costly. It could be that a faster and easier system could enable a user to simply talk to the phone and say what they want in ordinary language, and then have a generative AI create the transaction to send to the ledger. Then the system can show the transaction to the user, and get their approval before submitting it. That last step is crucial, because AI often makes mistakes. But it can still be faster and easier than having to construct the transaction from scratch.

In the other direction, ledgers can help AI. Current AI machine learning relies on vast amounts of training data. This can include pictures and written text. Most of it is created by humans who own copyrights on it, and who may not want it to be used without their permission. In addition, errors in the training data can create flaws in the final AI, so it is important to know the source of the data - its provenance - in order to know whether to trust it.

Ledgers can be used to manage the provenance information, by storing it immutably and permanently in the ledger. This can be done on many blockchains by submitting a transaction that also contains its normal data plus additional information to be stored. It can be done on Hedera using the Hedera Consensus Service, which is like a notary public service, whose entire purpose is to allow arbitrary information to be stored publicly and immutably, with a consensus timestamp. This is fast (10,000 transactions per second) and with a cost that is low and predictable (a ten-thousandth of a US dollar).

Ledgers can also be used to manage permissions. A user can officially record in the ledger that they give permission to use specific data for AI training, with specific conditions. Such as requiring a certain level of royalty payments each time the final AI is sold or is used. They could then later store different permissions. New AI systems would have to use the latest permissions from a given user from given data. But there would also be an immutable record of the history of how that user changed permissions over time.

Finally, ledgers could be used to manage micropayments of royalties. If an AI is trained on data from many people, then a small fee charged to buy or use the AI could be split among a large number of people who contributed data. Each person might be given a very small amount. But that is possible, because cryptocurrency allows values to be transferred that are a very small fraction of a cent. And over time, the royalties for a popular AI system could add up to a significant value.

While on the surface AI and DLT seem to be largely unrelated, each can help and enhance the other. It will be interesting to see how both of these fields develop over time, and how combinations of the two grow even more.


About the Author

Authored by Dr. Leemon Baird, inventor of the hashgraph algorithm, co-founder of Hedera, co-CEO of Swirlds Labs

  • Blockchain
  • AI

Recommended

    • AI
    • Blockchain
    Blockchain and artificial intelligence – competition or convergence ahead?
    December 06, 2023
    • Cryptoassets
    • Bitcoin
    • Blockchain
    • DeFi
    • Smart Contracts
    Open Access Blockchain Courses
    November 16, 2022
    • DeFi
    • Blockchain
    100% decentralized DeFi does not exist (yet)
    December 14, 2022