Exponential Technologies Convergence: Can AI help Shaping a New Breed of DLTs?

Alfredo Favenza
OvertheBlock
Published in
13 min readNov 13, 2020

This is the first issue of Overtheblock’s Tech Convergence Series, whose aim is to explore the opportunities lying at the intersection of exponential technologies such as Artificial Intelligence (AI), Distributed Ledger Technologies (DLTs), and the Internet of Things (IoT). In this post, we focus on how AI may help fueling a new generation of DLTs

Fig. 1 AI and DLT opportunities for convergence

Trustworthy and explainable AI, DLT fairness, decentralized data economies, AI-based consensus mechanisms, and smart oracles: new paradigms are stemming from the intersection of Artificial Intelligence and Distributed Ledger Technologies. Framing the complexity and grasping the value of such a disruptive technological convergence is not trivial. However, as already witnessed in other fields, we may discover that the whole turns out to be greater than the sum of its parts.

AI and DLTs are knocking at your door. According to the IDC Worldwide Artificial Intelligence Spending Guide [1], global AI investments are forecasted to double over the next four years, growing from $50.1 billion in 2020 to more than $110 billion in 2024 (IDC). Similarly, the steady increase of the investment in blockchain startups ($3.9 billion in 2017, $7.4 billion in 2018) is showcasing blockchain as one of the significant tech-trend which is expected to have a profound impact on the economy and governance over the next 10–15 years [2]. The World Economic Forum predicts that by 2025, up to 10% of the world’s GDP may be stored on a blockchain [3].

AI and DLTs operate at the two extremes of the centralization-decentralization spectrum. AI works in a highly centralized fashion, while DLTs promotes full decentralization. While neither approach is superior in principle, both of them present pros and cons. Hence, a combined adoption of such technologies may allow enjoying the best of both worlds while reducing their downsides.

On a very high level, the cooperation between AI and DLT may be depicted as a combination of “capital that learns”, through the deployment of intelligent agents and automated decision making at a scale and “the trust technology” leveraging transparency and immutability present in blocks of ordered transactions which update the status of a shared ledger.

Fig. 2 AI and DLT mutual value proposition

However, it is anything but simple to frame the complexity laying at the intersection of AI and DLT: from identifying technologies’ strengths and weaknesses to a clear comprehension of how the different building blocks underlying these two technologies could interact and create value.

This post of the Tech Convergence Series will be framing AI and DLT technologies by proposing two high-level stacks to be used as a stepping stone to understanding possible convergence opportunities. Subsequently, the discussion will focus on how AI features can be leveraged to empower a new breed of DLTs.

DLT Stack

A distributed ledger is an append-only store of distributed transactions across many nodes in a network, which provides auditing and ensuring long-lasting integrity. Therefore, a blockchain is a DLT implementation. It is structured into a linked list of blocks of ordered transactions, both cryptographically signed and secure, that operates without a central (trusted) authority in an adversarial environment [4],[5].

Different solutions of a DLT stack have been proposed by both the academic world and the industry. These visions mainly focus on creating DLT stacks from a technological perspective, where modules, protocols, and solutions are grouped in broad layers (e.g., infrastructure, network, applications). For example, studies on such technological stacks have been proposed by Deloitte [6] and Outlier Ventures [7]. Our main goal differs from those practical solutions; we mainly focused on a stack in which each layer represents an irreplaceable building block of a modern DLT solution. A similar, more straightforward, and less intuitive solution has been proposed by Radix [8].

Indeed, our vision of the DLT stack arises from the abstraction of the common traits of the different possible implementations of the DLT. As shown in Fig. 3, the six levels are arranged to include the needs of the complex solutions for diverse contexts, such as public or private deployments, various levels of I/O accessibility to the ledger and role-based permissions, and finding a balance for the trilemma among scalability, security, and decentralization.

Fig. 3 DLT Stack

P2P Network of Nodes. A network of physical or virtual machines (peers) maintaining a local copy of the ledger communicating over the internet (TCP/IP protocol). Peers are equally privileged, equipotent participants in the application. They share resources without a centralized administrative system or control in an untrusted environment.

Transaction & Block Models. The representation of the distributed ledger data structure is replicated across several nodes on the P2P network. Regardless of transactional taxonomy and block-level characteristics, we assume that the model is a cryptographically secure linked list of blocks where each block contains an ordered list of transactions.

Consensus Mechanism. A network protocol that defines rights, responsibilities, and means of communication, verification, validation, and consensus across the nodes in the network. This layer includes ensuring authorization and authentication of new transactions, appending new blocks, incentive mechanisms (if needed), and similar aspects [4].

Scripting & Smart Contract (On-chain Logic). Smart contracts are programs (code) deployed as data in the ledger and executed throughout sending transactions to the network. Smart contracts can hold and transfer digital assets managed by the DLT and can invoke other smart contracts. Smart contract code is deterministic and immutable once deployed. This layer also includes not Turing-complete scripting systems for transactions (e.g., Bitcoin Script) [4].

Token. Tokens allow to digitally represent (tokenize) fungible (i.e., money) and non-fungible (i.e., work of arts) assets. The tokens can be used to represent shares in a company, the right to benefit from future earnings, grant voice power for voting systems, uniquely represent real-world assets, and many others. The tokens can be created and exchanged, usually using smart contracts. If you would like to learn more about tokens, check out Overtheblock’s series on tokenomics.

Off-chain Logic. In a DLT-based system, different architectural decisions that must be made regarding which piece of information might be stored on-chain and for what reason. The off-chain data and logic layer includes all parts of the data, and computation kept off-chain. As for the data, usual practices are to store large or private sets of data off-chain (e.g., replicated databases, sidechain, cloud) and to keep hashes, metadata, and small-sized public data on-chain. For logic, due to the “closed-world” logic (i.e., smart contracts can usually only examine state stored on the ledger), to interact with the external world, oracles are invoked to bring the external state into the ledger.

AI Stack

Artificial Intelligence deals with the study and implementation of “Intelligent agents”, autonomous entities that perceive their environment (directly or passively) and take actions that maximize the chance of successfully achieving a goal [9], [10], [11], [12]. AI needs to acquire and stock large and heterogeneous datasets, clean this data to extract meaningful information, and use this information to train models to allow them to make accurate predictions. If we want to represent the key elements of artificial intelligence as a technological stack, we can identify four layers which can enable the creation of new intelligent service relying on big data and learning models (Fig. 4):

Fig. 4 AI Stack

Data Infrastructure. Hardware resources, physical or virtualized, which are made available for the storage of data (e.g., Hadoop, big data storage, etc.) and subsequent processing (VMs Containers, CPUs, GPUs, etc.).

Data Fusion. Software tools to interface with the storage and processing resources (e.g., SQL, NoSql, Spark, etc.). They provide the functionalities to implement raw data cleaning and labeling to provide quality datasets to the upper layer of learning models.

Algorithms and Models. Tools and libraries of algorithms to train the learning models on the provided datasets. Examples: features selection, Models, Training (e.g., supervised, unsupervised, reinforcement, etc.), TensorFlow, Caffe, Torch, Scikit-learn, CNTK.

Agents and services. Applications that leverage the results of the models’ analysis to perform data analysis operations (e.g., NLP, Image processing, prediction, classification, clustering).

AI for DLT

After providing an overview of the core components of the AI and DLT stacks, in this section, we take into exam the possible convergences.

Fig. 5 Overview of all the possible convergences between AI and DLT at the intersections of the technology stacks

Fig. 5 shows all the intersections, considering two possible directions: AI supporting DLTs (green) and vice versa (orange). We do this by crossing the different layers of the two technological stacks to identify all the possible areas and topics of convergence.

Let us now dive deep into every convergence opportunity in which AI can assist or solve different issues related to DLT.

Fig. 6 Areas and topics of convergence where AI can enhance DLT

AI-based Static Source Code Analysis

As well-reported in the report by INFOSEC [13], a blockchain can be attacked in different ways, either from the theoretical blockchain protocol (e.g., 51% attacks), blockchain network (e.g., Sybil attack), blockchain nodes (e.g., DoS, injection), and smart contracts (e.g., reentrancy, access control vulnerabilities, frauds and, many others). Static security analysis is performed without executing programs. Through reinforcement learning and neural networks, the AI-based models and services can help in many layers of our DLT stack: the P2P network (e.g., system faults, network fragmentation, bugs), the transaction and block model (e.g., bug identification, opcode analysis, formal and static verification), consensus protocols (e.g., game-theoretic incentive mechanisms and the study of new fair mining techniques), and smart contracts (e.g., functionality classification, fraud detection, and vulnerabilities).

Automated Referee and Governance

The near-future vision for DLT platforms and systems resides in individuals, communities, IoT devices, and smart contracts that interact and record transactions on intercommunicated decentralized networks. The AI can help solve the potential disputes happening on-chain (or off-chain), reporting the distributed ledger results. This automated protocol governance could be data-driven, unbiased, and more accepted than arbitrations today [14]. The AI can be tightly integrated with the DLT protocol, ensuring a strictly coupled approach for obtaining more robust, ethical, and smarter consensus mechanisms. An ML-based system can assist users in using complex on-chain smart contracts mechanisms to change some governance parameters (e.g., voting mechanisms, block producing).

Proof-of-Useful-Work

During the last years, plenty of consensus mechanisms [15] have been released. Every consensus mechanism has its pros and cons. One of the most famous examples is the energy waste derived from the Proof-of-Work (PoW), which dilutes the blockchain’s value and hinders its further application. The literature has proposed some approaches to fight this and other issues leveraging AI-based consensus mechanisms (which we grouped under the name Proof-of-Useful-Work). For example, a Proof-of-Deep-Learning (PoDL) such that a valid proof for a new block can be generated if and only if a proper deep learning model is produced. A Proof-of-Kernel (PoK) where only a subset of nodes participates in the hash computation. ML’s system governance parameters, such as the ideal number of miners or the mining difficulty level, are regularly updated [16].

AI-Aided Development

Smart contract development is a reasonably new field with a lack of extensive literature in software engineering. Newcomers and experienced developers have difficulties developing secure smart contracts in the first place. Leveraging AI-based tools for automatically check code vulnerabilities, wrong patterns, and advising best practices, through reinforcement and supervised learning can revolutionize the adoption and deployment of secure decentralized application.

DLT Fairness

As we mentioned above, under “Automated Referee and Governance”, the DLT decisions can be made from a multitude of diverse individuals, groups, and autonomous agents (on/off-chain). The AI can be seen as a promising technology for building legally compliant, secure, and fair DLT protocols due to the advances in the study of explainable AI (XAI), making models and agents less obscure. In that case, more fair game-theoretic incentive mechanisms can be developed, and the protocol code can be verified in order to check its compliance with regulations (e.g., GDPR).

Secure Game Theory

Game theory in blockchain technology has a dual role to play, both inward and outward. Inward is to apply the principles of the theory to the blockchain protocol. Outward is to integrate the strategic decision-making model with the business’ process [17]. Using reinforcement learning approaches, which has already shown promising results for DLT protocol security analysis in simulation settings for optimal mining strategies, appears as a promising method to analyze the security of game theoretically complex smart contracts in simulations. This could include, for example, decentralized token exchanges [14].

Reinforced Selfish Mining

A selfish mining strategy consists of a miner that delays the new block’s publication to waste the mining power of honest miners currently working on another fork of the blockchain. In the literature, several works using reinforcement learning have replicated selfish mining attacks in a testing environment using agents that discover how to gain large mining rewards to find new insights about blockchain protocol security. This AI-based approach must lead to finding new insights about blockchain protocol security and the potential to detect new, previously unknown attacks in complex scenarios, such as in cases with multiple partially cooperating agents and developing new game-theoretic settings concerning the DLT protocol [18].

Agent-based Smart Contract Security

Also worth mentioning is the possibility of invalidating smart contracts used for illegal activities through agents trained through active reinforcement learning approaches. Agents learn to manipulate contracts’ data field and subsequently invalidate a substantial share of the studied criminal smart contracts. We think combining pattern recognition to these approaches can lead to a completed AI-oriented approach for smart contract classification and behaviour verification [14].

AI Oracles

The smart contracts can be seen as an isolated piece of code triggered by agents (human, devices, and other smart contracts) through sending a transaction. The smart contract itself cannot trigger or communicate outside of the DLT environment due to its nature. To build a robust decentralized application capable of dealing with the real external world’s complexity, a one-way AI agent [19] can be used to automate the gathering and verification of real-world data and then to send a transaction with the information payload to querying a smart contract. Consequently, this will enable a new pathway to interact with data outside of the immediate blockchain environment.

Take-home concepts

DLTs and AI are both following a very steep hype curve. We will probably witness a progressive convergence between these two technologies, producing a new wave of creative destruction in many industries. It is thus essential to understand how to take advantage of the opportunities arising from this technological trajectory.

As for the advantages that AI could bring to DLTs, our analysis highlights innovation opportunities in mixing algorithms and models (e.g., Machine Learning, Deep Learning, etc.), making smart contracts smarter and, overall, making the DLT more secure, legally compliant, and capable of addressing users’ needs. In addition, oracles could enhance the capabilities of smart contracts, providing them with a third eye on the outside world’s conditions to make more appropriate decisions. Finally, a debated point of discussion concerns the environmental impact of DLTs leveraging a Proof-of-Work consensus algorithm. With this mechanism, the DLT consumes energy to perform the mining process and guarantees the network nodes’ consensus. AI could aid DLT by providing new AI-based consensus mechanisms that can use this energy to improve AI models to solve relevant societal and environmental issues.

References:

[1] IDC, “Worldwide Artificial Intelligence Spending Guide”, 2020.

[2] Publications Office of the European Union, “Blockchain Now And Tomorrow”, 2019.

[3] World Economic Forum, “Deep Shift Technology Tipping Points and Societal Impact”, 2015.

[4] X. Xiwei, I. Weber, and, M. Staples, (2018), “Architecture for Blockchain Applications”, Blockchain Architecture Design, 14–58.

[5] M. Rauchs, A. Glidden, B. Gordon, G. C. Pieters, M. Recanatini, F. Rostand, K. Vagneur, and B. Zheng Zhang, “Distributed Ledger Technology Systems: A Conceptual Framework”, 2019.

[6] Deloitte, “Blockchain Technology Stack”, 2017.

[7] Outlier Ventures, “The Convergence Stack”, 2019.

[8] Radix, “Introduction to DLT Stack”, 2019.

[9] D. Poole, A. Mackworth, R. Goebel, “Computational Intelligence: A Logical Approach”, 1998, Oxford University, ISBN 978–0–19–510270–3.

[10] S. J. Russell, P. Norvig, “Artificial Intelligence: A Modern Approach” (2nd ed.), 2003, Prentice Hall, ISBN 0–13–790395–2.

[11] N. Nilsson, “Artificial Intelligence: A New Synthesis”, 1998, Morgan Kaufmann, ISBN 978–1–55860–467–4.

[12] S. Legg, M. Hutter, “A Collection of Definitions of Intelligence”, 2007.

[13] INFOSEC Institute, “Attacks on Blockchain”, 2020.

[14] K. D. Pandl, S. Thiebes, M. Schmidt-Kraepelin, and A. Sunyaev, “On the Convergence of Artificial Intelligence and Distributed Ledger Technology: A Scoping Review and Future Research Agenda”, 2020.

[15] Blockgenic, “Different Blockchain Consensus Mechanisms”, 2018.

[16] L.-N. Lundbæk , D. Janes Beutel, M. Huth, S. Jackson, L. Kirk, and R. Steiner, ‘‘Proof of kernel work: A democratic low-energy consensus for distributed access-control protocols,’’ Roy. Soc. Open Sci., vol. 5, no. 8, Aug. 2018, Art. no. 180422.

[17] 366pi, “Application Of Game Theory For Blockchain Security”.

[18] C. Hou, M. Zhou, Y. Ji, P. Daian, F. Tramer, G. Fanti and A. Juels, “SquirRL: Automating Attack Discovery on Blockchain Incentive Mechanisms with Deep Reinforcement Learning, 2020.

[19] J. Najera, “Blockchain Oracles”, 2018.

Please cite this post as follows: A. Favenza, G. Corrias, E. Ferro, “Exponential Technologies Convergence: Can AI help Shaping a New Breed of DLTs?”, Overtheblock Innovation Observatory, 2020. Retrievable at: https://medium.com/overtheblock/exponential-technologies-convergence-can-ai-help-shaping-a-new-breed-of-dlts-a9850e70c597

OverTheBlock is a LINKS Foundation’s initiative carried out by a team of innovation researchers under the directorship of Enrico Ferro. The aim is to promote a broader awareness of the opportunities offered by the advent of exponential technologies in reshaping the way we conduct business and govern society.

We are chain agnostic, value-oriented, and open to discussion.

💬 Get in touch

📧 Never miss an insight, subscribe to our Newsletter

--

--

Alfredo Favenza
OvertheBlock

Innovation Technologist, Blockchain Expert at Blockchain Innovation Observatory — LINKS Foundation www.overtheblock.io