Smart Contract Design Patterns

Index Description Alternative Names Platform Language Mapping with OpenSCV References
1.Security
1.1 Secure External Calls
Securing interactions between multiple contracts, protecting against vulnerabilities in contract-to-contract communication.
1.1.1 Checks Effects Interaction
This pattern guides smart contract function development and mitigates the risk of introducing reentrancy vulnerabilities by enforcing the order in which operations are performed. A reentrancy vulnerability exists when an external contract maliciously reenters the calling contract (i.e., the contract initially executing) during execution, potentially altering its state or control flow in unintended ways. This pattern specifies that functions should first check all preconditions to validate inputs, ensure authorization, and verify the current state of the contract, protecting against invalid operations. Next, functions should apply effects by securely updating their internal state, such as adjusting balances or recording changes. Finally, the function should perform interactions with external contracts, such as transferring Ether or invoking external functions, only after ensuring that the contract’s state is fully updated and consistent. This order, along with the fulfillment of the preconditions, prevents the external contract from re-entering and altering the state of the calling contract during execution, enforcing the correct flow. The importance of this pattern is quite evident, as the corresponding vulnerability has been exploited in historical incidents, such as the DAO hack, where the lack of proper order enforcement in operations allowed an attacker to exploit the system state through recursive calls, leading to $60 million worth of Ether at the time. By ensuring that all debits and credits are recorded before any further transactions begin, the Checks Effects Interaction pattern provides a defense against such vulnerabilities. - Ethereum Solidity 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes, 1.2 Malicious Fallback Function, 1.3.1 Improper Check of External Call Return Value, 1.3.2 Improper Exception Handling of External Calls

1.1.1 Checks Effects Interaction

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Trojanowska, Natalia, et al. "Secure decentralized application development of blockchain-based games." 2020 IEEE 39th International Performance Computing and Communications Conference (IPCCC). IEEE, 2020.

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

Argañaraz, Mauro, et al. "Detection of vulnerabilities in smart contracts specifications in ethereum platforms." 9th Symposium on Languages, Applications and Technologies (SLATE 2020). Vol. 83. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Britten, Daniel, Vilhelm Sjöberg, and Steve Reeves. "Using coq to enforce the checks-effects-interactions pattern in DeepSea smart contracts." FMBC 2021. 2021.

Fahmideh, Mahdi, et al. "Engineering blockchain-based software systems: Foundations, survey, and future directions." ACM Computing Surveys 55.6 (2022): 1-44.

1.1.2 Mutex
The main idea behind this pattern is to address the threat of reentrancy attacks by employing a mechanism of mutual exclusion (i.e., a mutex). It ensures that a contract function cannot be re-entered or exploited while still executing by utilizing a boolean variable as a lock. This lock is activated before an external call is made and deactivated once the call is completed, effectively aborting any reentrant calls attempting to execute during the locked state. This pattern mirrors the traditional concept of mutexes, where mutual exclusion restricts concurrent access to shared resources, thereby maintaining the integrity of the contract’s state. This approach may help in scenarios where recursive calls or callbacks could modify the state of the parent contract before the original function is completed, a vulnerability exploited in reentrancy attacks. As a security measure, the Mutex pattern is a straightforward means to protect control flow with minimal negative consequences, such as increased gas costs, complexity, or development overhead. Alternative strategies exist and can also be considered. Reentrancy guard, NoReentrancy, NoReentrant, locking, Guarded Update Ethereum Solidity 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes, 1.4 Improper locking during external calls

1.1.2 Mutex

s

1.1.2 Mutex

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Fahmideh, Mahdi, et al. "Engineering blockchain-based software systems: Foundations, survey, and future directions." ACM Computing Surveys 55.6 (2022): 1-44.

1.1.3 Pull Payment
This is an approach to mitigate the risks associated with direct fund transfers in smart contracts, particularly the possibility of failure or vulnerability to reentrancy attacks when a contract sends funds to another party. In traditional "push" payment models, the sending contract initiates a transfer, which involves making an external call to the receiving contract. Such calls inherently hand over control to the receiving contract, potentially allowing malicious reentrant calls that could exploit incomplete state updates or disrupt the contract’s execution. To address these challenges, the Pull Payment pattern decouples the transfer action from the contract’s core logic by enabling recipients to withdraw funds at their convenience rather than the sender pushing the funds. This approach minimizes the attack surface by isolating each external call and shifting the responsibility for initiating withdrawals to the user, aiming to minimize scenarios where the contract might be forced into unintended states due to failed operations or malicious interactions. This pattern may be helpful in scenarios such as micropayments or bidirectional payment channels. For instance, on a blockchain-based crowdfunding platform, contributors’ funds could be stored in a contract until the project creator withdraws them. This ensures that if an external interaction fails, the funds remain safely within the contract, preventing loss or unintended behavior. pull over push, withdrawal contract Ethereum Solidity 1.2 Malicious Fallback Function

1.1.3 Pull Payment

1.1.3 Pull Payment

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Wöhrer, Maximilian, and Uwe Zdun. "Domain specific language for smart contract development." 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

1.1.4 Limit External Calls
Refers to the practice of minimizing the frequency and/or total number of calls to external smart contracts due to inherent costs and associated security risks. Each call to an external contract introduces overhead in the form of gas fees and exposes the system to potential vulnerabilities, such as reentrancy attacks or unexpected execution failures. This pattern advocates for the use of single, multi-purpose functions that can handle multiple tasks or return various pieces of data in one call, rather than having multiple functions, each performing a separate action or returning a single piece of data. As an example, a decentralized finance (DeFi) platform might use this pattern to minimize the number of external calls required to execute complex financial transactions, thereby reducing gas costs and potential attack vectors. - - - 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes, 1.3.3 Improper Check of Low-Level Call Return Value

1.1.4 Limit External Calls

1.1.4 Limit External Calls

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.2 Secure Credit Transfer
Enhancing the security of credit transfer mechanisms in financial transactions.
1.2.1 Secure ether transfer
The Secure Ether Transfer pattern is designed to ensure safe Ether transfer within the Ethereum blockchain, addressing the risks of excessive gas forwarding and reentrancy attacks. It offers three methods for transferring Ether: send, transfer, and call. Send and transfer are higher-level functions with built-in gas limits that protect against malicious contract activity by restricting the amount of gas to be used, whereas call is a low-level function that forwards all remaining gas, ensuring that the gas forwarded does not exceed safe thresholds and preventing reentrancy attacks or other unintended behaviors that could result from forwarding excessive gas to an invoked contract. As an example, in a smart contract used for crowdfunding, the Secure Ether Transfer pattern ensures that refunds or payouts are executed without exposing the contract to the aforementioned typical risks. - - - 4.3.3 Wrong use of Transfer Credit Function

1.2.1 Secure ether transfer

References

Guida, Luca, and Florian Daniel. "Supporting reuse of smart contracts through service orientation and assisted development." 2019 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). IEEE, 2019.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.3 Secure Programming Practices
Preventing insecure coding practices and compensating for programming language vulnerabilities that could lead to system security issues.
1.3.1 Randomness
This pattern addresses the challenge of generating random numbers securely within blockchain-based systems that operate in a deterministic environment, i.e., where the output of a function must be the same for all nodes given the same input to maintain consensus. This deterministic nature poses obstacles to achieving true randomness, as predictable or insufficiently random values can lead to security vulnerabilities that can be exploited to manipulate outcomes in applications such as lotteries, games, and auctions. To mitigate the insufficient randomness risks, the Randomness pattern often relies on oracles, which provide random values generated off-chain or on-chain techniques like leveraging block hashes from not-yet-mined blocks. For example, a lottery smart contract might query an off-chain oracle service to ensure secure and unbiased randomness. Although on-chain methods, such as using future block hashes, are more convenient, they are generally considered less secure due to potential manipulation by miners or attackers with substantial computational power. The implementation of the Randomness pattern ensures that the generation of random numbers is reusable and modular. Randomisation Ethereum Solidity 5.1 Bad Randomness

1.3.1 Randomness

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Argañaraz, Mauro, et al. "Detection of vulnerabilities in smart contracts specifications in ethereum platforms." 9th Symposium on Languages, Applications and Technologies (SLATE 2020). Vol. 83. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.j

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

1.4 Flow Control
Managing program execution flow to prevent unauthorized or malicious alterations.
1.4.1 Guard Check
Regulates control flow to enhance security by ensuring that all predefined conditions on the contract’s state and function inputs are verified before execution proceeds so that expected behavior is assured. In practice, this allows the blocking of unauthorized actions or reduces the likelihood of activating residual faults in the code with consequences in the control flow of the code. Guard checks can include mechanisms such as user authentication, validation of input data, or compliance with conditions that must hold for the function to execute correctly. In practice, they can validate user inputs, verify the contract’s state, enforce invariants, and ensure compliance with logical constraints. They may also discard unacceptable conditions, thereby avoiding vulnerabilities or unintended outcomes. For example, these checks could prevent an unauthorized user from accessing privileged functions or stop a transaction if the contract state does not meet predefined criteria. The utility of this pattern extends to various scenarios, such as user authentication, data validation, or verifying the integrity of responses from other contracts. guard-check - - 5.2.1 Improper Input Validation, 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes

1.4.1 Guard Check

References

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.4.2 Escrow
The Escrow design pattern is focused on transaction management by mediating the transfer of tokens between two parties through a neutral third-party contract called the escrow. In this pattern, tokens are first transferred to the escrow smart contract, which serves as a trusted intermediary to hold the funds until predetermined payment conditions are met (e.g., coupons, insurance payouts, social welfare benefits). This mechanism ensures that the seller delivers the promised product or service and that the buyer completes the payment accordingly, mitigating the risk of failure to comply with the agreement. The escrow contract’s logic includes verification steps to confirm that all transaction requirements have been fulfilled before releasing the funds to the seller. This pattern is helpful, especially in high-value transactions where the impact of a failure or malicious behavior is high and, as a consequence, the need to protect the interests of all parties is strong. This pattern is helpful, especially in high-value transactions where the impact of a failure or malicious behavior is high and, as a consequence, the need to protect the interests of all parties is strong, such as insurance payouts, social welfare benefits, or e-commerce settlements. - - - 1.1.1 Unsafe Credit Transfer

1.4.2 Escrow

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

1.5 Safe Arithmetic
Preserving the integrity of arithmetic operations to avert overflow, underflow, and other computational errors.
1.5.1 SafeMath
This pattern, which is available in a few libraries, allows avoiding overflow or underflow vulnerabilities. Overflow occurs when an arithmetic operation exceeds the maximum value of a data type, while underflow arises when an operation results in a value below its minimum range. Such vulnerabilities have historically led to severe exploits, as demonstrated in the attack on BEC tokens, where improper validation allowed unauthorized manipulation of balances and state variables. The main idea is to provide safe versions of the four arithmetic operations by including checks against problematic outcomes. Whenever a calculation reaches an overflow or underflow state, SafeMath reverts the transaction to ensure the integrity of the state of the contract. While this approach incurs some runtime overhead and gas costs, the benefits of preventing critical arithmetic vulnerabilities outweigh the costs. Safemath,detect prevent integer overflow,Ensure that unsigned integer operations do not wrap, Use integer types that can fully represent the possible range of unsigned data, Overflow/Underflow Pattern Ethereum Solidity 6.1.1 Integer Underflow, 6.1.2 Integer Overflow, 6.2.1 Divide by Zero

1.5.1 SafeMath

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6 Access Control
Securing systems through robust authentication and authorization mechanisms for reliable access management.
1.6.1 Authorization
This pattern restricts the execution of certain functions that are sensitive or somehow critical (e.g., sending ether, invoking the self-destruct() function to specific user addresses). It is commonly used to ensure that only authorized users, such as the contract owner or those with specific roles, can invoke certain functions that may alter the contract’s state. In practical terms, implementing this pattern typically involves using access control lists or mappings of addresses to track permissions and incorporating modifiers in the contract’s functions to check these permissions before allowing the execution of the code. Real-world applications of the Authorization pattern are obviously widespread. For instance, in notary contracts, the pattern may ensure that only the document owner can add or modify data, thereby preventing external tampering. In gambling games, the pattern may allow only the contract owner to manage participants’ fees and rewards, for instance, ensuring that only the winner can withdraw their prize. Some other decentralized applications may also generally use this pattern to assign different roles to different user addresses. authentication, roles, Guarding Pattern Ethereum Solidity 8.1.1 Wrong Caller Identification

1.6.1 Authorization

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

Guida, Luca, and Florian Daniel. "Supporting reuse of smart contracts through service orientation and assisted development." 2019 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). IEEE, 2019.

Mavridou, Anastasia, and Aron Laszka. "Tool demonstration: Fsolidm for designing secure ethereum smart contracts." Principles of Security and Trust: 7th International Conference, POST 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14-20, 2018, Proceedings 7. Springer International Publishing, 2018.

Argañaraz, Mauro, et al. "Detection of vulnerabilities in smart contracts specifications in ethereum platforms." 9th Symposium on Languages, Applications and Technologies (SLATE 2020). Vol. 83. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6.2 Time constraint
This pattern is used to define the time window during which certain actions are allowed or to specify deadlines after which certain functions can no longer be used. In practice, the developer controls the execution of contract functions by using timestamps or block numbers as references for measuring time intervals and durations, thus adding temporal logic to contract operations. These mechanisms will ensure that contract actions are bound by the temporal rules encoded within the contract. This pattern may be particularly useful in scenarios where the timing of actions is critical, such as financial transactions, identity verification, and gaming events. For example, a certificate holder might share a link to a verifier that grants access to credentials only within a defined period, preventing access after the period has expired. time-constrained access, Time limitations Ethereum Solidity 1.1.1 Unsafe Credit Transfer, 1.1.2 Unsafe System State Changes

1.6.2 Time constraint

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Guida, Luca, and Florian Daniel. "Supporting reuse of smart contracts through service orientation and assisted development." 2019 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). IEEE, 2019.

Mavridou, Anastasia, and Aron Laszka. "Tool demonstration: Fsolidm for designing secure ethereum smart contracts." Principles of Security and Trust: 7th International Conference, POST 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14-20, 2018, Proceedings 7. Springer International Publishing, 2018.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

Argañaraz, Mauro, et al. "Detection of vulnerabilities in smart contracts specifications in ethereum platforms." 9th Symposium on Languages, Applications and Technologies (SLATE 2020). Vol. 83. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6.3 Commit and Reveal
This pattern consists of two phases: a commit phase and a reveal phase. In the commit phase, a user submits a hashed version of its information to the blockchain, keeping the original information secret for a period of time. In the Reveal Phase, the user discloses the original information, and its integrity can be verified by the network by hashing it again and comparing it to the initially committed hash. The commit-reveal scheme is crucial in some blockchain-based applications because it ensures that no one can access the information before its original content is revealed, and it prevents users from altering their submissions after committing them. For example, in a blockchain-based auction, bidders can commit their bids without revealing the corresponding details to other participants until the auction ends. Once it ends, the details will be verifiable. Thus, this pattern actually addresses both access control and integrity. Data Encryption, Encrypting on-chain data, Hash secret, Commitment Pattern Ethereum Solidity 7.2.1 Exposed Private Data

1.6.3 Commit and Reveal

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Trojanowska, Natalia, et al. "Secure decentralized application development of blockchain-based games." 2020 IEEE 39th International Performance Computing and Communications Conference (IPCCC). IEEE, 2020.

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

1.6.4 Ownership
This is an access control pattern used in smart contract development to ensure that critical functions are only callable by a specific, authorized entity — the owner of the contract. The owner is set at the moment the contract is deployed, with the deployer’s address being then registered as the owner and this address being used to verify authorization for executing sensitive methods. For example, maintenance tasks or functions that manage contract funds are typically restricted to the owner to prevent potential misuse. Real-world examples of the Ownership pattern include its use in decentralized finance platforms, where the contract owner might need to update interest rates or manage liquidity pools. Owned, Ownable, owner Ethereum Solidity 7.1.2 Owner Manipulation, 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes

1.6.4 Ownership

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Verdonck, Michaël. "Demonstrating the importance of well-defined design patterns in smart contract development." Proceedings of the International Workshop on Value Modeling and Business Ontologies (VMBO 2019). 2019.

Ferreira Torres, Christof. "From Smart to Secure Contracts: Automated Security Assessment and Improvement of Ethereum Smart Contracts." (2022).

Töberg, Jan-Philipp, et al. "Modeling and enforcing access control policies for smart contracts." 2022 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPS). IEEE, 2022.

Guida, Luca, and Florian Daniel. "Supporting reuse of smart contracts through service orientation and assisted development." 2019 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). IEEE, 2019.

Wöhrer, Maximilian, and Uwe Zdun. "Domain specific language for smart contract development." 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2020.

Zecchini, Marco, et al. "On refining design patterns for smart contracts." European Conference on Parallel Processing. Cham: Springer International Publishing, 2019.

Van der Meyden, Ron, and Michael J. Maher. "Architecture for smart SAFE contracts." 2021 3rd Conference on Blockchain Research & Applications for Innovative Networks and Services (BRAINS). IEEE, 2021.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Yang, Xiaoyu. "Blockchain-based supply chain finance design pattern." 2021 13th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC). IEEE, 2021.

1.6.5 Access Restriction
The Access Restriction pattern ensures that certain functions can only be executed when specific restrictive conditions are met. The pattern aims to control function access based on predefined requirements, which can include temporal conditions, caller information, transaction details, or other necessary prerequisites. These requirements are often implemented using reusable modifiers that enforce conditions across multiple functions within the same contract. Additionally, Access Restriction can extend permissions to a broader set of users, such as those approved by other members, thus providing more flexible access control. For example, in a decentralized finance application, an Access Restriction pattern might be used to ensure that only users who have staked a certain amount of tokens can access premium features or execute high-value transactions. - Ethereum Solidity 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes

1.6.5 Access Restriction

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6.6 Blocklist
The Blocklist pattern addresses the need to restrict access to certain entities regarding an off-chain asset. This is achieved by implementing a contract that maintains a set of Bloom filter coefficients. These coefficients enable efficient off-chain computation, allowing clients to determine if an entity is included in the blocklist without explicitly storing the list within the contract. The main components of this pattern include a contract that holds the Bloom filter coefficients and the off-chain clients that utilize these coefficients to perform the necessary calculations, ensuring that disallowed entities are blocked from accessing the specified asset. This pattern is useful in scenarios where maintaining a comprehensive list of disallowed entities on-chain would be impractical due to storage constraints. For example, a contract could use this pattern to track certificate revocations or the Ethereum addresses of stolen cryptocurrency, ensuring that these entities are blocked from accessing the specified asset. - Ethereum Solidity -

1.6.6 Blocklist

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

1.6.7 Dynamic Binding
The goal of this pattern is to authorize actions by participants whose addresses are not known in advance. The pattern works through the association of an authority with a contract action through an off-chain secret rather than predefining the user’s address within the contract. The secret, when provided by the user, is verified by comparing its hash with a hash stored in the smart contract. This approach allows the smart contract to be updated to include this verification mechanism without needing a special protocol to exchange the secret. A third-party contract can also facilitate the authorization by confirming the secret key and then allowing interaction with the target contract. Off-chain secret enabled dynamic authorization - - -

1.6.7 Dynamic Binding

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6.8 Embedded Permission
This pattern enforces access restrictions directly within the contract’s code for selected functions. By specifying authorized addresses within the contract, this pattern allows only those pre-approved participants to invoke critical functions, such as self-destruct() in Solidity. It embeds a check within the function itself that verifies whether the caller’s address matches the list of authorized addresses before any function logic is executed. The presence of embedded permissions could help in avoiding the Parity multi-sig wallet incident, which ended up freezing 500K Ether. - - - 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes

1.6.8 Embedded Permission

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.6.9 Selective Content Generation
This pattern enables the creation of customized credentials tailored to a holder’s specific requirements regarding the credential contents. In this pattern, an issuer generates a credential that includes only the necessary data as requested by the holder, ensuring that only the essential information is shared with a verifier, who needs this information to validate the holder’s identity. This approach allows data owners to specify access control rules, thereby generating responses that avoid leaking unnecessary data. As an example, this pattern can be applied in contexts such as Self-Sovereign Identity (SSI), where a certificate issuer might generate a customized credential to show only the grade earned for a module rather than exposing the entire transcript. - - - -

1.6.9 Selective Content Generation

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

1.6.10 Tokenized Exchange
This pattern allows authorizing and tracking access to off-chain data storage through the use of security tokens. It allows for a verifiable history of data access, which is useful for auditability, and also encapsulates the complexities of interacting with various off-chain data sources via a standardized interface that allows encoding a set of attributes describing the sources and basic operations that can be performed on them. A real-world application of this pattern could be in healthcare, where patient data stored off-chain needs to be accessed by various stakeholders such as doctors, insurance companies, and researchers. - - - -

1.6.10 Tokenized Exchange

References

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

1.6.11 Single authorization
The Single Authorization design pattern in smart contract security is a protocol that designates a specific blockchain account as the sole authority to sign and authorize transactions. This pattern enforces function-level authorization to mitigate the risks associated with the open accessibility of smart contracts on blockchain platforms, where, typically, any participant could invoke any function. It basically requires that each function invocation be preceded by a verification step to confirm the caller’s authorization by the predefined single authority, offering a centralized method to manage permissions in contrast to more complex multi-signature authorization mechanisms. For example, in a decentralized finance application, this pattern could be used to ensure that only a designated account can authorize high-value transactions, thereby protecting the contract from unauthorized access and other potential risks. - - - -

1.6.11 Single authorization

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

1.6.12 Stealth Address
This pattern ensures that only the designated recipient can detect and spend the funds associated with a specific transaction in the blockchain. When a sender initiates a transfer, it generates a one-time, computationally random-looking address known as a stealth address. This address is unique to the transaction and can only be recognized by the recipient, who can then claim and spend the funds. This pattern prevents any third party from determining the actual recipient of the transaction. Stealth addresses obscure the economic relationship between the sender and recipient while ensuring that only the intended recipient has access to the transferred assets. - - - -

1.6.12 Stealth Address

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

1.6.13 Authorised Spender
The Authorized Spender design pattern in smart contract development enables token owners to grant a third party, such as another user or a smart contract, permission to spend a predefined amount of their tokens. The pattern is implemented through an ’approve’ function within the token contract, where the token owner specifies the spender’s address and the token amount they are authorized to use. By doing so, the contract records an allowance that is verified each time the authorized spender attempts to initiate a transfer, ensuring that the spender cannot exceed the set limit and providing a secure method for delegated transactions. This is particularly useful in blockchain ecosystems where buyers want to delegate payment responsibilities. As an example, in a decentralized marketplace, a buyer can authorize a smart contract to handle payments on their behalf, streamlining the transaction process and enhancing user convenience. The approve function can be added to the token template contract, with parameters for the spender’s address and the amount, allowing, in this way, the occurrence of delegated transactions. - - - -

1.6.13 Authorised Spender

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

1.7 Integrity
Ensuring data remains accurate, consistent, and unaltered throughout its lifecycle, incorporating mechanisms that verify data integrity.
1.7.1 Hash Integrity
This pattern aims to inform about the integrity of data that is stored outside the blockchain. A hash of the original data is generated and stored on the blockchain, which allows users to check the integrity of the off-chain data by checking the on-chain hash value. This pattern is essential for the case of applications in which data integrity is critical, such as financial records, legal documents, and other integrity-sensitive information . Off-chain data storage, Hash on-chain, Blockchain Anchor, IPFS, Swarm - - -

1.7.1 Hash Integrity

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.7.2 File Comparison
File comparison involves verifying the integrity of a file by comparing its cryptographic hash value with the corresponding hash stored on the blockchain. This service allows users to check if a file has been altered without authorization, ensuring that the file remains unchanged and original. By utilizing a cryptographic hash value like SHA-256, users can select a file and verify its authenticity. If the hashes match, the file is confirmed to be authentic. This approach emphasizes verification at the file level rather than handling extensive data that may not be easily stored on the blockchain. As an example, in auditing processes, the hash of an agreement stored on-chain allows auditors to verify the integrity of an off-chain file by ensuring its hash matches the blockchain-stored value . - - - -

1.7.2 File Comparison

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

1.7.3 Reverse Verifier
The Reverse Verifier pattern ensures the integrity of blockchain data when accessed by external sources. When an off-chain entity, like a traditional database application or a banking API, requests blockchain data, this pattern verifies it by checking the stored hash against the data, detecting any tampering. Reverse Verifier specifically ensures the integrity of blockchain data as it is accessed by external systems. This is especially useful for scenarios like retrieving check data from the blockchain. - - - -

1.7.3 Reverse Verifier

References

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

1.8 Privacy
Protecting personal information and ensuring confidentiality across interactions and transactions.
1.8.1 Multiple Registrations
The Multiple Registration pattern allows an entity to register and use distinct identifiers for each of its transacting relationships, minimizing the risk of identity correlation and privacy breaches. By using separate identifiers for different applications or roles, interactions with one party can be isolated from another, thus enhancing privacy. This approach involves registering multiple identifiers in an identifier registry, where each identifier uniquely corresponds to a different identity relationship. Consequently, each transaction is associated with a unique identifier, preventing the linkage of identities and protecting the entity’s privacy by avoiding the exposure of all identities held by that entity through a single identifier. This approach leverages decentralized identifiers, a widely adopted standard in Self-Sovereign Identity frameworks, to manage unique, persistent identifiers associated with blockchain accounts. As an example, a person could register separate identifiers for interactions with a hospital and a university, preventing either entity from linking his/her activities. - - - -

1.8.1 Multiple Registrations

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

1.8.2 Zero Knowledge Proofs
Zero-knowledge proof allows users to prove the validity of transactions or data without revealing the underlying details. This pattern allows one party (the prover) to inform another party (the verifier) that they possess certain secret information, which is verifiable, without revealing the information itself or the identities of either party. This is achieved through an interactive verification protocol consisting of a sequence of predefined actions that ensure the verifier is convinced of the prover’s knowledge without gaining any additional data. The protocol does not require complex public key infrastructure and is resistant to malicious attempts to extract further information. A practical application may be the encoding of a vulnerability and corresponding exploit of a real system. This would be verifiable by a target entity but, at the same time, would not reveal the details, which otherwise could allow other entities to exploit the vulnerable system. - - - -

1.8.2 Zero Knowledge Proofs

References

Blum, Florian, et al. "Building hybrid DApps using blockchain tactics-the meta-transaction example." 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2020.

1.8.3 Key Sharding
In this pattern, a master cryptographic key is split into multiple shards, which alone are incomplete but collectively can be used to reconstruct the original key. This technique prevents a single key’s overexposure across multiple transactions, protecting identity privacy. It enables an entity to manage distinct subkeys for various identity accounts under one master key, mitigating risks associated with key compromise. The main idea is that entities can conduct transactions with the assurance that their various identities remain unlinked and secure. In practical applications, users can store these key shards securely in diverse ways, such as distributing them among trusted family members or storing them in physical safes. If the original key is lost—due to events like device failure or theft—users can recover it by collecting the required number of shards that meet the regrouping threshold. - Ethereum Solidity -

1.8.3 Key Sharding

References

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

1.9 Risk Mitigation
Implementing strategies to minimize the impact and risk of current security issues.
1.9.1 Emergency Stop
This pattern is a measure to rapidly stop the impact of a major vulnerability by allowing to securely stop contract execution. In practice, it can be implemented as a function within the contract that an authenticated party can activate so that the problematic operations can be disabled. A real-world example of the need for this pattern is illustrated by the DAO attack, where participants on the Ethereum network could only watch as their funds were withdrawn due to a lack of an emergency stop mechanism. Circuit Breaker, Pausable, Deactivation Pattern, Mortal Ethereum Solidity 1.1.1 Unsafe Credit Transfer ,1.1.2 Unsafe System State Changes

1.9.1 Emergency Stop

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Ferreira Torres, Christof. "From Smart to Secure Contracts: Automated Security Assessment and Improvement of Ethereum Smart Contracts." (2022).

Guida, Luca, and Florian Daniel. "Supporting reuse of smart contracts through service orientation and assisted development." 2019 IEEE International Conference on Decentralized Applications and Infrastructures (DAPPCON). IEEE, 2019.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

1.9.2 Speed Bump
This pattern delays the execution of sensitive operations to diminish the risk of abrupt, potentially damaging activities (e.g., an attacker exploiting a vulnerability). The implementation of this pattern may take several forms, such as limiting the amount of funds a user can withdraw per day and instituting a mandatory waiting period before processing withdrawals, among others. This provides additional time for stakeholders to detect and respond to irregularities. Analogous to real-world banking scenarios, such as limiting withdrawals during a bank run, this pattern prevents sudden, unrestrained actions that could harm the integrity of a contract. For example, in decentralized finance (DeFi), slowing down high-value transactions allows additional time for validators or stakeholders to monitor irregularities. - Ethereum Solidity 1.2 Malicious Fallback Function

1.9.2 Speed Bump

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Fahmideh, Mahdi, et al. "Engineering blockchain-based software systems: Foundations, survey, and future directions." ACM Computing Surveys 55.6 (2022): 1-44.

1.9.3 Rate Limit
Is a pattern that allows contracts to manage and cap the frequency of task executions over a specified time period, with the aim of mitigating the effect of a high number of messages being sent to a smart contract (e.g., a surge of requests) and controlling its computational demand. By setting a rate limit, the pattern ensures that functions, such as withdrawals or other sensitive operations, are not called too frequently, thereby avoiding the risk associated with scenarios like rapid fund drainage. - Ethereum Solidity -

1.9.3 Rate Limit

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Fahmideh, Mahdi, et al. "Engineering blockchain-based software systems: Foundations, survey, and future directions." ACM Computing Surveys 55.6 (2022): 1-44.

1.9.4 Balance Limit
This design pattern refers to setting the maximum amount of funds that can be held within a contract at any given time, thereby managing the amount of money at risk. When the contract’s balance reaches this predefined quota, any further payments that attempt to exceed this limit are rejected. However, it is important to note that this approach cannot prevent Ether from being forcibly sent to the contract. This limits the potential damage in the event of a contract breach by ensuring that only a manageable amount of funds is ever at risk. By capping the funds at risk, this pattern minimizes the attack surface, as contracts holding excessive capital become attractive targets for malicious actors. Contract Balance Limit , Create Balance Limit, Contract Balance-Limit Ethereum Solidity -

1.9.4 Balance Limit

References

Wohrer, Maximilian, and Uwe Zdun. "Smart contracts: security patterns in the ethereum ecosystem and solidity." 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2018.

N’Da, Aboua Ange Kevin, Santiago Matalonga, and Keshav Dahal. "Characterizing the cost of introducing secure programming patterns and practices in ethereum." Trends and Innovations in Information Systems and Technologies: Volume 2 8. Springer International Publishing, 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Fahmideh, Mahdi, et al. "Engineering blockchain-based software systems: Foundations, survey, and future directions." ACM Computing Surveys 55.6 (2022): 1-44.

1.9.5 Multi-signature
The goal of this pattern is to make a certain transaction require the approval of multiple authorized parties before it can be validated and executed. The main idea is that no single entity should be able to unilaterally carry out a transaction. It serves as an additional protective layer, particularly in scenarios where the loss of a private key cannot be remedied by current blockchain technology. Multi-signature setups can vary in configuration, from requiring all parties to sign a transaction to requiring a subset of signatures. This allows for some flexibility in the mechanism, e.g., to better fit specific scenarios. lost private key, Multi-signatures,Multiple authorization, multiple authorities,Two-phase authorization Ethereum Solidity 1.1.1 Unsafe Credit Transfer

1.9.5 Multi-signature

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

1.10 Auxiliary
Supplying auxiliary functions or contracts to reinforce the implementation of security solutions.
1.10.1 Key Generation
This pattern refers to the creation and distribution of encryption keys to secure transactions on the blockchain. The overall idea is to generate keys (using asymmetric encryption) that are shared among parties prior to executing transactions on the blockchain. Such keys should be properly managed so that security is not compromised. - - - -

1.10.1 Key Generation

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

1.10.2 Database Proxy
The Database Proxy pattern is a specialized adaptation of the traditional Proxy design pattern tailored for blockchain-based systems. Its primary purpose is to add an extra layer of security and efficiency by performing lightweight tasks, such as basic security checks or auditing, before allowing access to database connectors. It minimizes computational costs on-chain by deferring the retrieval and unpackaging or decryption of sensitive data until it is required off-chain. The contract code should be organized to first invoke the proxy for preliminary operations and then proceed with more detailed data handling off-chain . - - - -

1.10.2 Database Proxy

References

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

1.10.3 Hash Time Lock Contract
The Hashed Timelock Contract (HTLC) pattern relies on hashlocks and timelocks to ensure secure and atomic swaps by requiring recipients to provide cryptographic proof of payment within a specified timeframe. Technically, the HTLC pattern enables the implementation of time-bound transactions. - - - -

1.10.3 Hash Time Lock Contract

References

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

2.Control
2.1 Data Management
Efficiently managing, storing, and processing data within smart contacts to ensure secure and effective data operations in blockchain systems.
2.1.1 Oracle
- data provider, Centralized Oracle, Decentralized Oracle, Pull-based inbound oracle, Pull-based outbound oracle, Push-based inbound oracle,Push-based outbound oracle, Oraclize; Oracle contract; Chainlink contract Ethereum Solidity 1.3.1 Improper Check of External Call Return Value, 1.5 Interoperability issues with other contracts

2.1.1 Oracle

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Gao, Zhipeng, et al. "Select-storage: A new oracle design pattern on blockchain." 2021 IEEE 20th International Conference on Trust, Security and Privacy in Computing and Communications (TrustCom). IEEE, 2021.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Abreu, Antonio Welligton, and Emanuel F. Coutinho. "A pattern adherence analysis to a blockchain web application." 2020 IEEE International Conference on Software Architecture Companion (ICSA-C). IEEE, 2020.

Zecchini, Marco, et al. "On refining design patterns for smart contracts." European Conference on Parallel Processing. Cham: Springer International Publishing, 2019.

Argañaraz, Mauro, et al. "Detection of vulnerabilities in smart contracts specifications in ethereum platforms." 9th Symposium on Languages, Applications and Technologies (SLATE 2020). Vol. 83. Schloss Dagstuhl--Leibniz-Zentrum fuer Informatik, 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Mühlberger, Roman, et al. "Foundational oracle patterns: Connecting blockchain to the off-chain world." Business Process Management: Blockchain and Robotic Process Automation Forum: BPM 2020 Blockchain and RPA Forum, Seville, Spain, September 13–18, 2020, Proceedings 18. Springer International Publishing, 2020.

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

2.1.2 Key-value Store
- - Ethereum Solidity -

2.1.2 Key-value Store

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.1.3 Anti-Oracle
- Reverse Oracle Ethereum Solidity -

2.1.3 Anti-Oracle

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Abreu, Antonio Welligton, and Emanuel F. Coutinho. "A pattern adherence analysis to a blockchain web application." 2020 IEEE International Conference on Software Architecture Companion (ICSA-C). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.1.4 Bulletin Board
- - Ethereum Solidity -

2.1.4 Bulletin Board

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.1.5 Flyweight
- - - - -

2.1.5 Flyweight

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Taylor, Alixandra, et al. "Vigilrx: A scalable and interoperable prescription management system using blockchain." IEEE Access 10 (2022): 25973-25986.

2.1.6 Content Addressable Storage
- Content-Addressable Storage Pattern - - -

2.1.6 Content Addressable Storage

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

2.1.7 Immediate-Read
- - - - -

2.1.7 Immediate-Read

References

Al-Breiki, Hamda, et al. "Trustworthy blockchain oracles: review, comparison, and open research challenges." IEEE access 8 (2020): 85675-85685.

2.1.8 Blockchain Data Management
- - Hyperledger Fabric chaincode -

2.1.8 Blockchain Data Management

References

Lamken, Dennis, et al. "Design patterns and framework for blockchain integration in supply chains." 2021 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2021.

2.1.9 Database Connector
- - - - -

2.1.9 Database Connector

References

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

2.1.10 Raw data on-chain
- - - - -

2.1.10 Raw data on-chain

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

2.2 Wallet and Key Management
Facilitating the creation, storage, and management of cryptographic keys and digital wallets within blockchain applications.
2.2.1 Master & Sub key creation
- - - - -

2.2.1 Master & Sub key creation

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.2.2 Shard distribution
- - - - -

2.2.2 Shard distribution

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

2.2.3 Shard combination
- - - - -

2.2.3 Shard combination

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

2.2.4 Hot & Cold wallet storage
- - - - -

2.2.4 Hot & Cold wallet storage

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.3 Business Logic
Enabling the implementation of standardized and modular business logic within smart contracts.
2.3.1 Poll
- - Ethereum Solidity -

2.3.1 Poll

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.3.2 Vote
- - Ethereum Solidity -

2.3.2 Vote

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.3.3 Voting
- - - - -

2.3.3 Voting

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

2.3.4 Lotterie
- - Algorand blockchain - -

2.3.4 Lotterie

References

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

2.3.5 Periodic Payment
- - Algorand blockchain - -

2.3.5 Periodic Payment

References

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

2.4 State Management
Guaranteeing efficient management and consistency of a contract’s state within a blockchain framework.
2.4.1 State Machine
- Finite State Machine, Finite - State Machines, State Ethereum Solidity 1.1.1 Unsafe Credit Transfer, 1.1.2 Unsafe System State Changes

2.4.1 State Machin

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Jurgelaitis, Mantas, and Rita Butkienė. "Solidity code generation from UML state machines in model-driven smart contract development." IEEE Access 10 (2022): 33465-33481.

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Zecchini, Marco, et al. "On refining design patterns for smart contracts." European Conference on Parallel Processing. Cham: Springer International Publishing, 2019.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Bartoletti, Massimo, et al. "A formal model of Algorand smart contracts." Financial Cryptography and Data Security: 25th International Conference, FC 2021, Virtual Event, March 1–5, 2021, Revised Selected Papers, Part I 25. Springer Berlin Heidelberg, 2021.

2.4.2 Establish genesis
- - - - -

2.4.2 Establish genesis

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Bandara, HMN Dilum, Xiwei Xu, and Ingo Weber. "Patterns for blockchain data migration." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.4.3 State aggregation
- - - - -

2.4.3 State aggregation

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Bandara, HMN Dilum, Xiwei Xu, and Ingo Weber. "Patterns for blockchain data migration." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.4.4 History oracle
- - - - -

2.4.4 History oracle

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

2.5 Fork Management
Developing design patterns focused on identifying blockchain forks and preserving operational stability across divergent chains.
2.5.1 Fork check
- - Ethereum Solidity -

2.5.1 Fork check

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.s

2.6 Life Cycle Management
Defining the different stages of a smart contract’s lifecycle, from deployment to termination.
2.6.1 Automatic Deprecation
- Auto deprecation Ethereum Solidity -

2.6.1 Automatic Deprecation

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.6.2 Availability Checking
- - - - -

2.6.2 Availability Checking

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.7 Registry and Discovery
Supporting the registration and effortless identification of entities within the smart contract and broader blockchain framework.
2.7.1 Contract Registry
- Contract Registry, Structural Patterns of Contract, business logic and management - updates and communication, smart contract pattern, Data Management, Contract Management, Structural, register contract Ethereum Solidity -

2.7.1 Contract Registry

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Bui, Van Cuong, et al. "Evaluating upgradable smart contract." 2021 IEEE international conference on blockchain (Blockchain). IEEE, 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Bloo, F. W. C. Towards updatable smart contracts. MS thesis. University of Twente, 2018.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.7.2 Multiple registration
- - - - -

2.7.2 Multiple registration

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.7.3 Entity Registry
- - - - -

2.7.3 Entity Registry

References

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

2.7.4 Identifier Registry
- - - - -

2.7.4 Identifier Registry

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.7.5 Pledge Register
- - - - -

2.7.5 Pledge Register

References

Yang, Xiaoyu. "Blockchain-based supply chain finance design pattern." 2021 13th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC). IEEE, 2021.

2.7.6 Consult Directory
- - - - -

2.7.6 Consult Directory

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.7.7 Seller Credential
- - - - -

2.7.7 Seller Credential

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.8 Creational
Enabling the instantiation and deployment processes of smart contracts, ensuring efficient setup and initialization in blockchain networks.
2.8.1 Contract Factory
- - Ethereum Solidity -

2.8.1 Contract Factory

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.8.2 Contract Composer
- - Ethereum Solidity -

2.8.2 Contract Composer

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.8.3 Abstract Factory
- - - - -

2.8.3 Abstract Factory

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Taylor, Alixandra, et al. "Vigilrx: A scalable and interoperable prescription management system using blockchain." IEEE Access 10 (2022): 25973-25986.

2.8.4 Factory Method
- - - - -

2.8.4 Factory Method

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

2.8.5 Builder
- - - - -

2.8.5 Builder

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

2.8.6 Singleton
- - - - -

2.8.6 Singleton

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

2.8.7 Pledge Template
- - - - -

2.8.7 Pledge Template

References

Yang, Xiaoyu. "Blockchain-based supply chain finance design pattern." 2021 13th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC). IEEE, 2021.

2.9 Structural
Dictating the composition and organization of smart contracts and their components to optimize interaction and functionality.
2.9.1 Contract Facade
- - Ethereum Solidity 1.2 Malicious Fallback Function

2.9.1 Contract Facade

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.9.2 Composite
- - - - -

2.9.2 Composite

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

2.10 Interaction
Streamlining and regulating the interactions among smart contracts and between contracts and external entities to ensure efficient operations.
2.10.1 Contract Mediator
- - Ethereum Solidity 1.5 Interoperability issues with other contracts

2.10.1 Contract Mediator

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.10.2 Contract Observer
- Publisher-Subscriber, Observer Ethereum Solidity 1.5 Interoperability issues with other contracts

2.10.2 Contract Observer

References

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Wessling, Florian, et al. "Towards blockchain tactics: Building hybrid decentralized software architectures." 2019 IEEE International Conference on Software Architecture Companion (ICSA-C). IEEE, 2019.

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Al-Breiki, Hamda, et al. "Trustworthy blockchain oracles: review, comparison, and open research challenges." IEEE access 8 (2020): 85675-85685.

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Taylor, Alixandra, et al. "Vigilrx: A scalable and interoperable prescription management system using blockchain." IEEE Access 10 (2022): 25973-25986.

2.10.3 Address Mapping
- - Ethereum Solidity -

2.10.3 Address Mapping

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.10.4 Judge
- - Ethereum Solidity -

2.10.4 Judge

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.10.5 Ticker Tape
- - Ethereum Solidity -

2.10.5 Ticker Tape

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.10.6 Announcement
- - Ethereum Solidity -

2.10.6 Announcement

References

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

2.10.7 Legal and Smart contract Pair
- - - - -

2.10.7 Legal and Smart contract Pair

References

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Abreu, Antonio Welligton, and Emanuel F. Coutinho. "A pattern adherence analysis to a blockchain web application." 2020 IEEE International Conference on Software Architecture Companion (ICSA-C). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.10.8 State Channel
- Pyament Channel - - -

2.10.8 State Channel

References

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Blum, Florian, et al. "Building hybrid DApps using blockchain tactics-the meta-transaction example." 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2020.

2.10.9 Dual Resolution
- - - - -

2.10.9 Dual Resolution

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.10.10 Bound with Social Media
- - - - -

2.10.10 Bound with Social Media

References

Liu, Yue, et al. "Design pattern as a service for blockchain-based self-sovereign identity." IEEE software 37.5 (2020): 30-36.

Liu, Yue, et al. "Design patterns for blockchain-based self-sovereign identity." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.10.11 Request-Response
- - - - -

2.10.11 Request-Response

References

Al-Breiki, Hamda, et al. "Trustworthy blockchain oracles: review, comparison, and open research challenges." IEEE access 8 (2020): 85675-85685.

2.10.12 Transfer
- - - - -

2.10.12 Transfer

References

Raab, Rene. Towards platform-agnostic smart contracts. Diss. Wien, 2021.

2.10.13 Exchange
- - - - -

2.10.13 Exchange

References

Raab, Rene. Towards platform-agnostic smart contracts. Diss. Wien, 2021.

Yang, Xiaoyu. "Blockchain-based supply chain finance design pattern." 2021 13th International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC). IEEE, 2021.

2.10.14 Sharing
- - - - -

2.10.14 Sharing

References

Raab, Rene. Towards platform-agnostic smart contracts. Diss. Wien, 2021.

2.10.15 Atomic Swap
- - Ethereum Solidity -

2.10.15 Atomic Swap

References

Van der Meyden, Ron, and Michael J. Maher. "Architecture for smart SAFE contracts." 2021 3rd Conference on Blockchain Research & Applications for Innovative Networks and Services (BRAINS). IEEE, 2021.

2.10.16 User Grants Access
- - - - -

2.10.16 User Grants Access

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.10.17 Asynchronous Request-Response
- - - - -

2.10.17 Asynchronous Request-Response

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.10.18 Fire-and-Forget
- - - - -

2.10.18 Fire-and-Forget

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.11 Operation Management
Enhancing the supervision and coordination of smart contract functions and processes for improved management.
2.11.1 Visitor
- - - - -

2.11.1 Visitor

References

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

2.11.2 Role Object
- - Ethereum Solidity -

2.11.2 Role Object

References

Oruç, Orçun, Uwe Aßmann, and Arbli Troshani. "Context-based Role Object Pattern with On-Chain Smart Contract Programming." Konferenzband zum Scientific Track der Blockchain Autumn School 2022. No. 2. Hochschule Mittweida, 2022.

2.11.3 Address
- - Ethereum Solidity 5.2.1 Improper Input Validation

2.11.3 Address

References

Chen, Huashan, et al. "A survey on ethereum systems security: Vulnerabilities, attacks, and defenses." ACM Computing Surveys (CSUR) 53.3 (2020): 1-43.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.11.4 Byteslib
- - Ethereum Solidity 4.6.5 Wrong Type in Variable Declaration

2.11.4 Byteslib

References

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.11.5 Context
- - Ethereum Solidity -

2.11.5 Context

References

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.12 Token
Facilitating the creation, issuance, and lifecycle management of digital tokens within blockchain applications.
2.12.1 Tokenisation
- Tokenisation; Token ERC20; Standard token; Token standard Ethereum Solidity -

2.12.1 Tokenisation

References

Bartoletti, Massimo, and Livio Pompianu. "An empirical analysis of smart contracts: platforms, applications, and design patterns." Financial Cryptography and Data Security: FC 2017 International Workshops, WAHC, BITCOIN, VOTING, WTSC, and TA, Sliema, Malta, April 7, 2017, Revised Selected Papers 21. Springer International Publishing, 2017.

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Ordoñez-Guerrero, Astrid Carolina, et al. "Blockchain architectural concerns: A systematic mapping study." 2022 IEEE 19th International Conference on Software Architecture Companion (ICSA-C). IEEE, 2022.

Wang, Ziyuan, et al. "ArtChain: Blockchain-enabled platform for art marketplace." 2019 IEEE international conference on blockchain (blockchain). IEEE, 2019.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

2.12.2 Acquire Token First
- - - - -

2.12.2 Acquire Token First

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.12.3 Token Template
- - - - -

2.12.3 Token Template

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.12.4 Token Registry
- - - - -

2.12.4 Token Registry

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.12.5 Policy Contract
- - - - -

2.12.5 Policy Contract

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.12.6 Burned Token
- - - - -

2.12.6 Burned Token

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Bandara, HMN Dilum, Xiwei Xu, and Ingo Weber. "Patterns for blockchain data migration." Proceedings of the European Conference on Pattern Languages of Programs 2020. 2020.

2.12.7 Token Swap
- - - - -

2.12.7 Token Swap

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.13 Transaction Management
Ensuring efficient execution and coordination of on-chain and off-chain transactions for seamless operations.
2.13.1 Subscribe-Notify
- - - - -

2.13.1 Subscribe-Notify

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.13.2 Meta Transactions
- - - - -

2.13.2 Meta Transactions

References

Blum, Florian, et al. "Building hybrid DApps using blockchain tactics-the meta-transaction example." 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC). IEEE, 2020.

2.13.3 Escrow
- - - - 1.1.1 Unsafe Credit Transfer

2.13.3 Escrow

References

Lu, Qinghua, et al. "Design patterns for blockchain-based payment applications." arXiv: 2102.09810. 2021.

2.13.4 Polling Transaction Pool with Retry
- - - - -

2.13.4 Polling Transaction Pool with Retry

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

2.13.5 Polling Blockchain with Retry
- - - - -

2.13.5 Polling Blockchain with Retry

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

3.Maintainability
3.1 Upgrading
Comforting the upgrade process of smart contracts to enhance functionality or address issues.
3.1.1 Data Segregation
- Data contract, data separation, Contract data, Eternal storage, basic data segregation Ethereum Solidity -

3.1.1 Data Segregation

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Bui, Van Cuong, et al. "Evaluating upgradable smart contract." 2021 IEEE international conference on blockchain (Blockchain). IEEE, 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Zhang, Peng, Douglas C. Schmidt, and Jules White. "A pattern sequence for designing blockchain-based healthcare information technology systems." arXiv preprint arXiv:2010.01172 (2020).

Chatterjee, Arnab, Yash Pitroda, and Manojkumar Parmar. "Dynamic role-based access control for decentralized applications." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Oruç, Orçun, Uwe Aßmann, and Arbli Troshani. "Context-based Role Object Pattern with On-Chain Smart Contract Programming." Konferenzband zum Scientific Track der Blockchain Autumn School 2022. No. 2. Hochschule Mittweida, 2022.

Hornyák, Olivér, and George Farid Alkhoury. "Smart contracts in the automotive industry." Vehicle and automotive engineering. Singapore: Springer Singapore, 2020. 148-157.

Thirulokachander, Vijay Rajasekar. Impact of Design Patterns on Code Quality in Blockchain-based Applications. MS thesis. University of Windsor (Canada), 2021.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Wang, Zeli, et al. "Ethereum smart contract security research: survey and future research opportunities." Frontiers of Computer Science 15 (2021): 1-18.

3.1.2 Satellite
- Contract decorator Ethereum Solidity -

3.1.2 Satellite

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Bui, Van Cuong, et al. "Evaluating upgradable smart contract." 2021 IEEE international conference on blockchain (Blockchain). IEEE, 2021.

Imeri, Adnan, et al. "Model of Dynamic Smart Contract for Permissioned Blockchains." PoEM (Forum). 2019.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

3.1.3 Proxy Delegate / Decorator
- CONTRACT RELAY, Transparent Proxy, delegatecall-based proxy,Unstructured Storage, Inherited Storage Diamond - - 1.6 Delegatecall to Untrusted Callee

3.1.3 Proxy Delegate / Decorator

References

Wöhrer, Maximilian, and Uwe Zdun. "Design patterns for smart contracts in the ethereum ecosystem." 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData). IEEE, 2018.

Liu, Yue, et al. "Applying design patterns in smart contracts: A case study on a blockchain-based traceability application." Blockchain–ICBC 2018: First International Conference, Held as Part of the Services Conference Federation, SCF 2018, Seattle, WA, USA, June 25-30, 2018, Proceedings 1. Springer International Publishing, 2018.

Worley, Carl R., and Anthony Skjellum. "Opportunities, challenges, and future extensions for smart-contract design patterns." International Conference on Business Information Systems. Cham: Springer International Publishing, 2018.

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Antonino, Pedro, et al. "Specification is law: Safe creation and upgrade of ethereum smart contracts." International Conference on Software Engineering and Formal Methods. Cham: Springer International Publishing, 2022.

Bui, Van Cuong, et al. "Evaluating upgradable smart contract." 2021 IEEE international conference on blockchain (Blockchain). IEEE, 2021.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Baryshev, Y. Design patterns security analysis for blockchain-based applications development with javascript and solidity. Diss. ВНТУ, 2019.

Ferreira Torres, Christof. "From Smart to Secure Contracts: Automated Security Assessment and Improvement of Ethereum Smart Contracts." (2022).

Imeri, Adnan, et al. "Model of Dynamic Smart Contract for Permissioned Blockchains." PoEM (Forum). 2019.

Wang, Ziyuan, et al. "ArtChain: Blockchain-enabled platform for art marketplace." 2019 IEEE international conference on blockchain (blockchain). IEEE, 2019.

Bloo, F. W. C. Towards updatable smart contracts. MS thesis. University of Twente, 2018.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Oruç, Orçun, Uwe Aßmann, and Arbli Troshani. "Context-based Role Object Pattern with On-Chain Smart Contract Programming." Konferenzband zum Scientific Track der Blockchain Autumn School 2022. No. 2. Hochschule Mittweida, 2022.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

Wang, Zeli, et al. "Ethereum smart contract security research: survey and future research opportunities." Frontiers of Computer Science 15 (2021): 1-18.

3.2 Reduce Complexity
Simplifying the architecture of smart contracts to improve their maintainability.
3.2.1 Use Libraries
- - - - -

3.2.1 Use Libraries

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

3.2.2 DynParam
- - Hyperledger Fabric - -

3.2.2 DynParam

References

Imeri, Adnan, et al. "Model of Dynamic Smart Contract for Permissioned Blockchains." PoEM (Forum). 2019.

3.3 Accessorial Functions
Implementing support functions that aid in the routine maintenance of contracts, such as purging expired records.
3.3.1 Incentive execution
- - - - -

3.3.1 Incentive execution

References

Xu, Xiwei, et al. "A pattern collection for blockchain-based applications." Proceedings of the 23rd European Conference on Pattern Languages of Programs. 2018.

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

3.3.2 Embedded into other functions
- - - - -

3.3.2 Embedded into other functions

References

Xu, Xiwei, et al. "A decision model for choosing patterns in blockchain-based applications." 2021 IEEE 18th International conference on software architecture (ICSA). IEEE, 2021.

4.Performance
4.1 Storage Usage
Optimizing for minimal and efficient use of storage resources.
4.1.1 On-Chain and Off-Chain
- Minimize on-chain data, hybrid-on/off-chain - - 7.2.1 Exposed Private Data

4.1.1 On-Chain and Off-Chain

References

Lu, Qinghua, et al. "Design pattern as a service for blockchain applications." 2018 IEEE International Conference on Data Mining Workshops (ICDMW). IEEE, 2018.

Li, Chao, Balaji Palanisamy, and Runhua Xu. "Scalable and privacy-preserving design of on/off-chain smart contracts." 2019 IEEE 35th International Conference on Data Engineering Workshops (ICDEW). IEEE, 2019.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.1.2 Limit Storage
- - - - -

4.1.2 Limit Storage

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

4.1.3 Freeing storage
- - - - 4.7.3 Unused Variables

4.1.3 Freeing storage

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.1.4 Tight Variable Packing
- - - - 4.6.5 Wrong Type in Variable Declaration

4.1.4 Tight Variable Packing

References

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

4.2 Gas Consumption
Reducing the amount of gas required for contract execution and transactions.
4.2.1 Challenge Response
- - - - -

4.2.1 Challenge Response

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

4.2.2 Single Line Swap
- - - - -

4.2.2 Single Line Swap

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.3 Use Libraries
- - - - -

4.2.3 Use Libraries

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.4 Delegated Computation
- - - - -

4.2.4 Delegated Computation

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

4.2.5 Event Log
- Transparent Event Log - - -

4.2.5 Event Log

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.6 Limit Storage
- - - - -

4.2.6 Limit Storage

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

4.2.7 Packing Variables
- packaging variables - - -

4.2.7 Packing Variables

References

Lopez Marin, Joan Carlo. Upgradeable Smart Contracts design patterns for Dapps Architectures. Diss. Dublin, National College of Ireland, 2022.

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.8 Packing Booleans
- - - - -

4.2.8 Packing Booleans

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.9 Uint* vs Uint256
- - - - -

4.2.9 Uint* vs Uint256

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.10 Mapping vs Array
- - - - -

4.2.10 Mapping vs Array

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.11 Fixed Size
- - - - 7.3.4. Incorrect Argument Encoding

4.2.11 Fixed Size

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.12 Default Value
- - - - 4.2.3 Missing Variable Initialization

4.2.12 Default Value

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.13 Explicitly mark external function
- - - - 4.10.1 Wrong Function Modifier

4.2.13 Explicitly mark external function

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.14 Limit External Calls
- - - - 1.1.1 Unsafe Credit Transfer, 1.1.2 Unsafe System State Changes, 1.3.3 Improper Check of Low-Level Call Return Value

4.2.14 Limit External Calls

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.15 Internal Function Calls
- - - - -

4.2.15 Internal Function Calls

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.16 Fewer functions
- - - - 4.11 Redundant Functionality

4.2.16 Fewer functions

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.17 Short Circuit
- - - - -

4.2.17 Short Circuit

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.18 Short Constant Strings
- - - - -

4.2.18 Short Constant Strings

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.19 Limit Modifiers
- - - - -

4.2.19 Limit Modifiers

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.20 Avoid redundant operations
- - - - -

4.2.20 Avoid redundant operations

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.21 Write Values
- - - - -

4.2.21 Write Values

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.22 Freeing storage
- - - - 4.7.3 Unused Variables

4.2.22 Freeing storage

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.23 Optimizer
- - - - -

4.2.23 Optimizer

References

Marchesi, Lodovica, et al. "Design patterns for gas optimization in ethereum." 2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE). IEEE, 2020.

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.24 Tight Variable Packing
- - - - 4.6.5 Wrong Type in Variable Declaration

4.2.24 Tight Variable Packing

References

Rajasekar, Vijay, et al. "Emerging Design Patterns for Blockchain Applications." ICSOFT. 2020.

4.2.25 String equality comparison
- - Ethereum Solidity -

4.2.25 String equality comparison

References

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.26 Memory array building
- - Ethereum Solidity -

4.2.26 Memory array building

References

Moura, Tiago Augusto Pinto. Design patterns for Ethereum smart contracts. MS thesis. Instituto Politecnico do Porto (Portugal), 2020.

4.2.27 Gas Consumption Checking
- - Ethereum Solidity 3.1 Improper Gas Requirements Checking

4.2.27 Gas Consumption Checking

References

Xu, Xiwei, et al. "Understanding and handling blockchain uncertainties." Blockchain–ICBC 2020: Third International Conference, Held as Part of the Services Conference Federation, SCF 2020, Honolulu, HI, USA, September 18-20, 2020, Proceedings 3. Springer International Publishing, 2020.

The information in https://blockchain.dei.uc.pt/patterns is based on the paper:

Azimi, S., Golzari, A., Ivaki, N. & Laranjeiro, N. A systematic review on smart contracts security design patterns. Empirical Software Engineering 30(3), 95 (2025) https://doi.org/10.1007/s10664-025-10646-w.
The data used to create this work is available at:

Azimi, S., Golzari, A., Ivaki, N. & Laranjeiro, N. "A systematic review on smart contracts security design patterns – Supplemental Material" (2025) https://zenodo.org/records/15263802.