## 2 Stairway to Integration
### The Roadmaps  
The first roadmap depicts the steps involved in bringing the agent abstraction to the blockchain along the computational dimension--in particular, taking smart contracts as the reference abstraction to receive agent-oriented features (Figure 2). As discussed above, the first step is about endowing smart contracts with their own flow of control, so as to enable the pro-activeness that differentiates agents from, for instance, objects in object-oriented programming. In practice, encapsulation of control flow enables smart contracts to start computing in the absence of stimuli coming from off-chain entities--namely, without the need of some blockchain client to invoke them (it is worth clarifying here that even in the case of a smart contract being invoked by another one, in a sort of \"call chain\", the start of the chain always originates from an off-chain entity). Steps 2 to 4 are all about perception of events, hence reactiveness to events, and could have been put in any order. They stem from the characteristic of agents of being situated in an environment (either physical or computational) [31], which includes the space-time fabric as well as the context of action in terms of resources and properties affected. Step 5 deals with another peculiar trait of agency, often recognised as the most important one: goal-orientedness, which is the ability of directing an inner decision making process towards achievement of implicit (goal-driven) or explicit (goal-governed) goals [32]. Goals are the driving force that directs an agent's pro-activeness, as agents are expected to actively pursue the goals ascribed to them without the need of being continuously stimulated--as happens instead in the case of object-orientation with service/method/function invocation, where services/objects are purely reactive entities that provide functionalities. As an illustrative example, having goal-driven smart contracts would amount to having smart contracts capable of actively monitoring the blockchain to pro-actively take action as soon as some specific condition or event is detected. Step 6 directly follows: once agents are endowed with goals, they may be expected to carefully plan their course of actions towards achievement of such goals. In the blockchain realm, this would amount at letting smart contracts figure out by themselves what actions are needed to achieve some desired effect, such as validation of the state of the blockchain after a set of transactions, or ordering of off-chain entities interactions to avoid conflicts. The last step in the stairway requires inference, intended as the ability to autonomously synthesize novel information, plans, or even goals, depending on contextual information and learnt experience. Such an ability resembles human intelligence; hence, we regard it as the latter steps towards a full notion of agency. Figure 2: Roadmap to exploration of agent-to-blockchain integration focused on the computational dimension. Transferring inference to the domain of blockchain and smart contracts requires a bit of imagination; nevertheless, we may envision smart contracts that upon inspection of the history of transactions recorded in the blockchain are able of summarizing such information to save storage space, or smart contracts that dynamically restrict the policy for transactions validation when they detect a surge in abnormal requests. The expected practical benefits of actually walking the stairway are manifold: parallelism in on-chain processing (step 1); time-aware policies such as scheduling of periodic payments (step 2); reactiveness to off-chain events without resorting to oracles (step 4); ability to adapt actions and processes to current state of the blockchain (step 5). However, many open issues should also be addressed both conceptually and technically.