Activity Contexts: Improving Modularity in Blockchain-based Smart Contracts using Context-oriented Programming
Smart contracts formalize and automate interactions among and between individuals and systems in an executable way. They are analogous to objects in object-oriented programming, but their state is replicated across numerous participants in a network and messages sent to the object are relayed to all network participants, allowing everyone to keep its replica up-to-date. Originally introduced in the mid-1990s, their recent surge in popularity is linked to a rising interest in blockchain-backed, general-purpose smart contract platforms.
Manging contract-specific state and behavior associated with the interacting parties and shared objects is a modularity challenge in smart contracts. Due to the decentralized deployment and execution model, code of already existing objects cannot be amended. Each smart contract needs to manage object-specific state and behavior itself, often leading to a single monolithic mediator.
We aim at re-instating separation of concerns by allowing programmers to modularly express instance-specific state and behavior within the scope of a so called Activity Context. Activity Contexts are first-class entities that collect these modular adaptations and jointly overlay them over instances that participate in the activity modeled by the smart contract.
We demonstrate the benefits of Activity Contexts by refactoring an exemplary smart contract and discuss their trade-offs compared to traditional object-oriented decomposition and context-oriented layers.
Mon 16 JulDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
11:00 - 12:30
|Activity Contexts: Improving Modularity in Blockchain-based Smart Contracts using Context-oriented Programming|
|A Simple Context-Oriented Programming Extension to an FRP Language for Small-Scale Embedded Systems|
Takuo Watanabe Tokyo Institute of TechnologyLink to publication DOI
|Cross-cutting Commentary: Narratives for Multi-party Mechanisms and Concerns|