Time in Blockchain-Based Process Execution

The traceable execution of business processes and choreographies using smart contracts is one prominent application of blockchain technology in Business Process Management (BPM). Existing approaches support a large set of patterns, modeling languages, and blockchain architectures, which cover a wide range of practical scenarios. However, they largely neglect the important aspect of time, a crucial part of process and choreography models manifested in deadlines, delays, and other temporal constraints. We argue that this deficit is due to inherent limitations of smart contracts---in particular the absence of a natural notion of measuring time---on popular blockchain platforms used in research and practice. We introduce a set of time measures available on blockchain platforms to alleviate these issues, and systematically compare their properties. We also give hints as to their suitability for facilitating various temporal constraints commonly found in process models.


I. INTRODUCTION
In Business Process Management (BPM), process and choreography models are used to specify processes within and between organizations, respectively [1]. While models often serve documentation purposes only, they are also used as source artifacts in model-driven process execution on different target platforms. One such target platform are blockchainbased smart contracts, which have been shown to enable transparent, tamper-proof, and auditable process execution which is especially valuable for inter-organizational communication between untrusted partners [2].
Sophisticated approaches have emerged, allowing users to employ a large bandwidth of process modeling tools [3]- [6]. They have a drawback in common, however; they do not properly take into account time, which is of paramount importance in process models in general [7] and in contractual agreements in particular [8]. Deadlines have to be kept and timeouts have to be observed closely for partners to achieve a common business goal, and process modeling languages naturally provide a multitude of elements to express such temporal constraints [9].
This deficiency is ostensibly due to the peculiar properties and mining protocols of commonly used blockchain platforms. Smart contracts are entirely transaction-driven and executed within a closed-world environment without access to global timing information. As such, a smart contract executing certain parts of the model can often not reliably decide whether a temporal constraint is violated or not.
In this paper, we want to alleviate these issues in a four-step approach. First, (i) an abstract formal model of blockchain is introduced, based on which (ii) a set of time measures which can be used within the narrow confines of a smart contract is developed. We then (iii) critically compare properties of the measures, such as accuracy and trust, before (iv) discussing how they can be used to implement generic temporal constraints found in process models. By doing so, we hope to give structured insights into the techniques which can be used by blockchain-based process execution approaches, and provide guidelines on how to chose the right measure for a given approach.
As a motivating example throughout the paper, we will consider a simplified invoicing choreography between a Mobile Network Operator (MNO) and one of their customers. Figure 1 shows a view of the orchestration process of the MNO modeled using the de-facto industry standard Business Process Model and Notation (BPMN) [10]. It starts on the 1 st of each month with the sending of an invoice. The customer may pay directly, or be reminded every seven days incurring additional overdue fines. Also, they may file a complaint with the MNO, e.g., because of an incorrect charge on the invoice. The invoice is then manually adjusted, and a message asking for patience is sent regularly every 24 hours to keep the customer informed. The example illustrates that temporal constraints are pervasive in business processes, and blockchain-based process execution approaches necessarily need to support such scenarios in order to gain widespread acceptance.
The paper is structured as follows. Preliminary knowledge and a detailed problem statement are conveyed in Sect. II. A formalization of the abstract structure of blockchains is provided in Sect. III, which is used to define and assess a set of time measures available in blockchain-based process execution in Sect. IV. We gauge whether the time measures are suitable for implementing temporal constraints in Sect. V, before critically discussing and evaluating the results in Sect. VI. We review related work based on our findings in Sect. VII, and finally conclude in Sect. VIII.

II. BACKGROUND
This section establishes preliminary knowledge pertaining to temporal constraints in business processes and the underlying techniques and restrictions of blockchain technology as well as smart contracts. process execution is then assessed on that basis to further narrow down the problem statement at hand.

A. Temporal Constraints in Business Process Management
Temporal constraints are ubiquitous in business processes and choreographies and have been an active field of research for decades [7]. They can be broadly divided into three categories: intra-activity, e.g., durations of atomic tasks; interactivity, e.g., delays between activities and events; and interprocess temporal constraints, i.e., deadlines between partners in a choreography [9].
The running example in Fig. 1, for instance, contains the latter two categories of constraints, modeled using timer events discernible by the clock symbol. They have different purposes, like initially starting a process instance at the "1st of [the] month" which then indirectly triggers the customer's local orchestration process (inter-process), or expressing delays such as "7 days" in the process flow (inter-activity).
In any case, timer events are further refined from their natural language label by a formal specification. BPMN largely follows a generic distinction between absolute and relative temporal constraints [9], and allows for three different notions of timer events following the ISO-8601 standard (see Tab. I) [10, p. 273]. Dates are used to wait for a specific, absolute point in time; durations are used to delay process execution or represent timeouts relative to the event's enablement; and cycles are used to model actions that are taken in a recurring fashion. The latter may start at an absolute point in time or relative to the event's enablement.
Another more indirect temporal constraint is also found in the example, a common pattern known as deferred choice [11]. It is used in situations in which the process waits for one of several events to happen, and picks the one "first triggered" [10, p. 437] for the final execution. In BPMN, the pattern is modeled using event-based gateways, diamondshaped elements containing two circles and a pentagon, which create a kind of temporal race between the following events.

B. Blockchain Technology and Smart Contracts
Graduating from its original motivation in the finance domain [12], blockchain technology has since emerged as a core platform for secure trustless applications [13]. The blockchain does not only store a list of account balances anymore, but also application logic in the form of executable code and its associated state, which is generally called a smart contract.
Smart contracts are not continuously running but triggered externally using transactions propagated in the network. Transactions and their effects are only applied to the blockchain's overall state during mining, a procedure in which information is appended to the blockchain as a new block. In order to generate a block, a network participant-the minerbundles a set of pending transactions, assigns them an order, and sequentially applies them, altering account balances and executing smart contract code. Once finished, the block is forwarded to the other nodes in the network to append it to their local versions of the blockchain.
All of these steps are secured via cryptographic schemes, consensus protocols, and incentivization measures depending on the blockchain implementation, with numerous complex extensions being constantly explored and proposed. Ultimately, this interplay of techniques results in the strong security guarantees of blockchain technology such as integrity, transparency, and immutability, despite potentially distrustful participants in the network [13].

C. Blockchain Oracles
A direct consequence of the blockchain's favorable properties is a strict closed-world assumption, i.e., data external to the blockchain which could be altered or go missing can not be accessed from within smart contracts for integrity reasons. Rather, the blockchain needs to be entirely self-contained for later validation. Common patterns to somewhat mitigate this restriction use oracles [14]. Oracles are operated by third-party providers and supply external data to the blockchain. They generally work using one of two schemes [15]: The data may be stored directly on the blockchain for immediate read access, which we will call storage oracle. For this purpose, an oracle provider maintains a publicly known smart contract (see Fig. 2a) and regularly updates it via dedicated transactions (steps 1.1, 1.2). The data can then be synchronously read by consumer smart contracts (steps 2.1-2.3). One example for such a service in practice is OrFeed 1 , which provides cryptocurrency exchange rates on Ethereum using a similar mechanism.
Alternatively, data may be asynchronously requested from within the blockchain using request-response oracles (see Fig. 2b). Here, the oracle provider operates a publicly known smart contract acting as a proxy. Data requests directed at this smart contract (steps 1.1, 1.2) are emitted using the blockchain's event layer, which the provider actively listens to (step 1.3). The query is performed off-chain, and the provider sends a transaction with the result of the query back to the original requester (steps 2.1, 2.2). Request-response oracles might provide general-purpose services, like Provable 2 , or more domain-specific ones such as Ethereum Alarm Clock 3 .

D. Blockchain-Based Execution of Business Process
The potential of blockchain technology in the area of BPM has been widely acknowledged [16]. One field of particular interest involves the blockchain-based execution of business processes, especially in the context of contractual interactions between distrustful partners benefiting from the platform's strong security guarantees [2].
Approaches like Caterpillar [4] or Lorikeet [3] collectively provide support for a large set of modeling languages and elements and can be roughly categorized as follows: They either translate executable process models into semantically equivalent smart contracts [3]- [6], [17] or provide interpreter smart contracts which then work on process specifications directly [18], [19], e.g., simulating a token system. The resulting smart contracts are either used as a connector between different participant's local Business Process Management Systems (BPMS), or even provide some features of a BPMS themselves like on-chain worklist handlers or monitoring tools. Regardless the architecture, participants interact with process instances via transactions, during which conditions and constraints specified in the model are checked in the trusted on-chain environment. Referring to the running example (see Fig. 1), for instance, the MNO might be submitting a transaction to the invoicing smart contract to "add overdue fines" after they sent a transaction for "send invoice". The smart contract now needs to check whether "7 days" have actually passed between the transactions to ensure compliance.
However, determining whether this or other temporal constraints are fulfilled is not trivial, which forms the basis of our problem statement: Since process instances are smart contracts executed within the confines of the blockchain, the general restrictions mentioned in Sect. II-B apply: 1) Smart contracts are executed in a closed-world environment and can not readily access global timing information and clocks. 2) Smart contracts are inherently passive structures only activated within synchronous calls during the mining of transactions and do not offer continuous runtime behavior or timer monitoring. 3) Since transactions originate from single participants and are propagated through a network of mutually distrustful nodes, there is no reliable timestamp attached to them individually, as it could not be independently verified.
These limitations make it hard to pinpoint the exact time a transaction was originally issued, and thus correctly enforce temporal constraints specified in the underlying model. While the blockchain domain is very diverse and not all technologies might exhibit the same extent of restrictions (see Sect. VI), existing approaches largely neglect or glance over these issues and the challenges implied (see Sect. VII). In this paper, we

III. BLOCKCHAIN FORMALIZATION
To ground the remaining paper in a formal framework, we abstract the structure of a blockchain to its core components. This abstraction is based on literature [13] and on implementations like Ethereum [20] and Tezos [21], and covers a large variety of blockchains found in practice (see Sect. VI-B1).
Note that we will not consider low-level effects like network latency in our formalization. We assume that there is an optimal, instantaneous connection between all peers of the blockchain network, and only take into account delays and effects directly related to the blockchain's protocols.
In literature, the term block height is often used interchangeably with block number. The first block B 0 of a blockchain is called genesis block. We regard a timestamp to be a scalar value, for example representing an Unix timestamp. We do not model the contents of transactions in this paper. For us, only the exact time a transaction was created by its original sender locally before being propagated within the blockchain network is relevant: Definition 2 (transaction timestamp). For any transaction tx, let s tx ∈ N be the timestamp the transaction was initially created and signed by its sender. Figure 3 illustrates an excerpt of a blockchain mapped against a timeline. The block timestamp s i of each visible block B i is fixed at the start of mining, i.e., when a miner bundles the set of transactions and begins performing the mining procedure, which takes some computing time.
Definition 3 (mining time). Let B = (B 0 , ..., B n ) be a blockchain. The duration of the mining procedure of a block B i is called the mining time m i Some blockchain networks like Ethereum [20] and Bitcoin [12] aim at achieving a fixed block generation rate, and adjust the difficulty of their mining algorithms constantly to react to changes in the network's overall power. The important measure in this context is block time, the interval between two consecutive blocks (not to be confused with the block timestamp): Lastly, after transactions are created and signed by their sender, they need to be propagated, picked up by a miner, and included in a block. This takes a certain amount of time: Then the delay between the transaction's initial creation s tx and the time it was included in the block is called the inclusion time d tx := s i − s tx of tx.

IV. TIME MEASURES IN BLOCKCHAIN SYSTEMS
To correctly execute business processes in smart contracts on the blockchain, the exact time a transaction was originally created-the transaction timestamp-needs to be determined, as it eventually decides whether temporal constraints defined in the model were complied with despite potential delays in the blockchain processing. Since this information is not readily available (see Sect. II-B), we propose a number of alternative methods to measure time within smart contracts with different advantages and drawbacks. Table II shows an overview of the measures, and presents a rough relative comparison regarding various metrics on a scale from best to worst.
For simplicity reasons, we will use tx to denote an arbitrary transaction contained in a block B i = (s i , T i ), i.e., tx ∈ T i , of an arbitrary blockchain B = (B 0 , ..., B n ). The ultimate goal is to acquire a suitable estimate for s tx .

A. Definition of Measures
We differentiate between five measures of time available in the scope of a transaction to a smart contract. Two of these are tied to the block the transaction is contained in (block timestamp M BT , block number M BN ), one requires manual input (parameter M PA ), and two are based on oracles (storage oracle M SO , request-response oracle M RO ).
1) Block Timestamp: Transaction tx has access to the timestamp s i of its including block B i , which can be used as a measure M BT (tx) := s i . The miner of B i fixes the timestamp when they start assembling the block, since it is part of the cryptographically relevant block metadata, and thus crucial in ascertaining the blockchain's integrity.
2) Block Number: The block number of a block B i can be used to estimate the block timestamp s i , and in extension the timestamps of the transactions contained in it. That is, if the mean block time isb, then B i would have had to be mined i timesb after the genesis block, or more formally at M BN (tx) := s 0 + i ·b.
This measure can not only be used to determine the absolute "age" of a block from the genesis block, but also the time interval between two blocks. For any two arbitrary blocks B i and B j , they were roughly mined |i − j| ·b milliseconds apart.
This is useful for estimating relative time differences, as we will discuss in Sect. V.
3) Parameter: Smart contract functions may receive arbitrary arguments encoded in the payload of the calling transaction tx. A function can thus be designed to take in an additional argument, namely a timestamp set by the sender of the transaction, which we will denote with M PA (tx). For example, the smart contract function in Listing 1 can only be called if the supplied timestamp is below 1608811200 (noon on Dec. 24 th , 2020, UTC). Such time servers can be used from the context of a blockchain using request-response oracles as shown in Fig. 2b to estimate the transaction timestamp. To obtain the measure M RO (tx), a smart contract would schedule a query to a time server, and receive a callback transaction with the measure attached later.

B. Accuracy
The time measures are designed to estimate the transaction timestamp s tx , but may deviate considerably in practice. These deviations are illustrated in Fig. 4, which displays the possible range of outputs for each measure on a timeline.
The parameter approach M PA consistently achieves perfect accuracy (assuming honest participants, as we will discuss in the next section) and is the only measure with this property. Block timestamps M BT are less accurate in that they always deviate by the inclusion time d tx , which depends on several factors like blockchain configuration, congestion, and how much a sender is willing to pay in transaction fees. However, these factors have been shown to be predictable in principle [22], meaning a high accuracy can still be achieved.
The storage oracle measure M SO depends on the frequency the provider updates the timestamp stored in the oracle smart contract. Since the storage oracle update needs to be performed in the same or an earlier block as tx we can generally assert that M SO (tx) ≤ s i = s tx + d tx , that is, it at most postdates the transaction by its inclusion time. This is the only guarantee that can be given, as otherwise the measure could be arbitrarily outdated. The request-response oracle M RO behaves rather obversely and at least postdates s tx by d tx + m i if the oracle provider immediately reacts upon observing the request in B i . Since this can not be guaranteed and the oracle provider may only react later, the measure can be arbitrarily inaccurate.
For the block number, fluctuations in the block times might lead to arbitrary discrepancies in both directions. As an illustrative example, we considered the block times of the Ethereum main chain observed within the last five years 4  It should be noted at this point that time itself is not an entirely static concept. Being regulated by international and national groups, minor or major adjustments may occasionally be prescribed which can not be accommodated for in all systems. As a concrete example, leap seconds are irregularly added to Coordinated Universal Time (UTC), but not reflected in Unix timestamps as used by Ethereum [20]. Thus, the block measures can not take leap seconds into account, in contrast to the parameter and oracle approaches.

C. Trust
Blockchains are designed to be trustless in that no participant, be it a miner or a business partner, can deviate from agreed-upon specifications, and the integrity of the data can be independently verified. However, some degree of trust in other entities is required for some time measures.
The block number approach M BN relies only on the inherent blockchain protocol and configuration, and cannot be unilaterally forged since block numbers must strictly increase by  The block timestamp measure M BT on the other hand is set by the miner, and there is a degree of freedom in fixing it. Ethereum, for example, demands a "reasonable" [20] timestamp, and Tezos similarly postulates that the "protocol design must tolerate reasonable clock drift" [21]. Bitcoin even amended its protocol in 2016 to fix a monetary "incentive for miners to lie about the time of their blocks" 5 . However, consensus algorithms in practice do constraint the window allowed by this: For one, younger blocks will usually be preferred since they were mined first. Secondly, some implementations place an upper limit on the deviation, e.g., 15 seconds in the future when receiving a new block for Ethereum 6 .
For oracles, trust lies entirely in the third-party oracle provider to serve correct information. Oracle providers have acknowledged this issue and offer various mitigation options. For example, Provable uses proof systems to certify that they did not tamper with the data provided from external APIs 7 . Other oracles rely on second-layer consensus algorithms themselves to decrease trust [23]. Combined with the monetary incentives to attract and keep customers, we assess the required trust to be on a par with the block timestamp.
Finally, the parameter approach performs worst in this metric, since trust is placed in each collaborator in the smart contract to attach correct timestamps M PA to the transactions. Acknowledging that the outspoken lack of trust between participants is one of the main reasons to use blockchain technology in the first place [2], this severely reduces the measure's utility.

D. Immediacy
The time measure should be immediately available to the smart contract code when it is executed via a transaction. This is the case for all approaches except the request-response oracle, which provides the measure via a delayed callback transaction. The time measure can thus not be used in-place, but there needs to be some kind of waiting mechanism which increases the complexity of the smart contracts involved.

E. Cost
Cost is crucial in determining the practical use of a measure. In general, blockchain transactions incur a cost, the socalled transaction cost, which is distributed to the miners to incentivize their operations. Transaction cost usually depends on both the size of the transaction's payload, as well as on the computational effort required to execute the called smart contract function.
We base our comparison on whether a measure incurs any significant extra cost on top of the regular cost of the transaction. This is not the case for the block timestamp M BT or block number M BN , which are available "for free" in the context of the transaction by default. The parameter measure M PA requires adding additional payload, which will increase the overall cost marginally. The oracle measures M SO and M RO require an inter-contract function call, which is typically quite expensive. Additionally, the providers of the oracles will probably incur some kind of fee for their service. For example, Provable prices regular API calls at USD 0.01, up to USD 0.04 if a notary proof is requested 8 .

F. Reliability
A measure should be reliably accessible, i.e., be resilient to attacks and system failures. This is the case for both the block timestamp M BT as well as the block number M BN since they are an inherent part of the blockchain protocol, and necessarily available whenever a transaction is executed. The parameter measure M PA is slightly less reliable as it depends on participants attaching a timestamp to each transaction. Mistakes in calculating the timestamp and sending the transaction could thus lead to deviations or errors.
For the oracle measures M SO and M RO , reliability varies since a third-party service provider is involved [23]. This issue is less severe in storage oracles since a dedicated smart contract with some return value will always be availablealbeit with potentially outdated or uninitialized data-even if the provider experiences issues. Request-response oracles would not be able to return a value, however, if the provider is offline. Especially long-running processes could get stuck if the provider used when the smart contract was initially deployed is not available anymore after some months or years.
In this section, we will evaluate whether the time measures are suitable for the implementation of temporal constraints found in business processes; in particular absolute timers, relative timers, cycles, as well as deferred choice (see Sect. II-A).

A. Absolute Timers
Absolute temporal constraints model deadline scenarios, in which certain activities have to start or finish by a specific point in time. The start event in the running example (see Fig. 1), for instance, governs that the process may not start before the 1 st of any specific month. In terms of blockchainbased process execution, that means that any transaction tx corresponding to either the timer start event itself or the "send invoice" activity may not be accepted by the smart contract before that. If we assume that s e is the scalar timestamp of midnight on the 1 st of some month, this comes down to determining whether s e ≤ s tx within the smart contract.
For any time measure M , one of two fundamental errors may be observed: a false negative occurs if M (tx) < s e ≤ s tx , that is, the measure erroneously reports that s e has not happened yet although it did; and a false positive occurs if s tx < s e ≤ M (tx), that is, the measure erroneously reports that s e has elapsed even when it did not. Figure 5 shows whether the time measures exhibit those errors. The expected result is that elapsed deadlines relative to s tx , like s e1 , are correctly recognized as past (dark background) and prospective ones like s e2 or s e3 as still open (light background). A dotted pattern on a measure's timeline signifies that false positives or negatives are possible in the interval, while a diagonal line pattern more severely signifies that the false result will always be obtained in the interval.
For example, consider s e2 which happens after the transaction timestamp s tx , but before it is included in a block, and should receive a result indicating it is still open. The block timestamp measure M BT (tx) = s i will always falsely report the deadline as past. The storage oracle measure M SO (tx) might yield any timestamp in the time interval up to s i , thus potentially leading to a false positive. Similar errors happen for the request-response oracle and block number measures. Only the parameter approach M PA is consistently correct. Table III summarizes these findings and ranks the measures on a scale from best to worst. The parameter approach M PA objectively performs best when absolute temporal constraints are concerned, and always yields the right result. The block timestamp M BT will result in a false positive if the event trigger happens between the creation of the transaction tx and its inclusion in a block, making it slightly worse, but still relatively predictable [22].
The other measures, however, may perform arbitrarily bad. The storage oracle M SO may return any timestamp before s i , and thus is only perfectly accurate for later deadlines. The request-response oracle M RO may provide an arbitrary timestamp after the propagation of block B i at s i + m i , and thus the measure is only accurate for elapsed deadlines. Consequently, the oracle measures only seem sensible when strictly trying to avoid false positives (storage oracle) or false negatives (request-response oracle).
On the lower end of the spectrum, the block number M BN is only technically accurate if the deadline elapsed before the timestamp s 0 of the genesis block, i.e., before the blockchain was even started, since that is the lower bound of timestamps obtained per definition. Otherwise, results are arbitrary.

B. Relative Timers
Relative temporal constraints concern minimum or maximum delays between different activities. In the running example in Fig. 1, for instance, the "7 days" until overdue fines are added start once the invoice has been sent and the following event-based gateway has been enabled. Supporting relative temporal constraints thus comes down to calculating the time difference or delta between the two corresponding transactions. This is illustrated in Fig. 6, in which an excerpt of a blockchain is drawn alongside the corresponding snippet from the running example. The issue is determining in tx whether 7 days have passed since tx was created. Table III summarizes the findings regarding the time measures' suitability in resolving these kinds of relative temporal constraints. As is the case for the absolute case, only the parameter approach M PA consistently achieves perfect results, that is, M PA (tx )−M PA (tx) = s tx −s tx The block timestamp M BT performs predictably worse due to its inherent deviations from the transaction timestamp The block number measure M BN performs reasonably well if we employ the alternative time interval definition given in Sect. IV. That is, we do not calculate M BN (tx ) − M BN (tx), but directly consider |i−j|·b, the total block times between B i and B j . Because of the smaller multiplicator, the inaccuracy due to fluctuations in the block time is reduced.
In general, though, the inaccuracy of a measure multiplies when using it to calculate deltas, which becomes especially apparent for the oracle measures. While the storage oracle measure M SO might be adequate when trying to minimize false positives on absolute temporal constraints, the difference between two timestamps obtained from a storage oracle at different times might be arbitrarily large if there are no further requirements on the service which is queried. The same is true for request-response oracles.

C. Cycles
Cycles are complex temporal constraints in that they can start at an absolute or a relative point in time, and combine the  difficulties discussed in both the previous sections. Thus, from a temporal perspective, cycles are covered by our discussion of absolute and relative temporal constraints, respectively. The main issue is making sure that all iterations of the cycle are hit. For example, the process in the running example (see Fig. 1) needs to be started at the beginning of each month, and no month may be missed. This leads to implementation overhead in the smart contracts, which have to keep track of some kind of counter to make sure this is not the case.

D. Deferred Choice
The deferred choice pattern introduces a major complication, which is the lack of causality between the events to compare. Whereas for relative temporal constraints, we know that we have to compare the delta between two transactions which must always arrive in the same order, as governed by the sequence flow in the model, deferred choice means that any transaction could arrive at any time.
Consider the process snippet from the running example in Fig. 6, for instance. The event-based gateway models a deferred choice between "7 days", "complaint received" and "payment received" (clipped in the figure). Per the semantics of BPMN, the transaction first created should be accepted. There is no way for the smart contract to decide on this, however: If the customer has complained already and the transaction for "complaint received" is pending, it could be overtaken by the "7 days" transaction even if it was actually sent in time. Overdue fines could then be added mistakenly.
The underlying cause for this is that it is the miner's decision which transactions to include in a block from the pending pool, and how to order them. Miners are not aware of domain and application-specific constraints such as deferred choice, and decide based on purely economical or protocol-related reasons. As such, we can not give a clear indication as to the performance of the different time measures.

VI. RESULTS AND EVALUATION
In this section, we summarize our results on the running example, deriving more general application guidelines, and evaluate the overall approach in broader terms.

A. Results and Guidelines
In Sects. IV and V, we compared the time measures regarding their inherent properties as well as their utility in implementing temporal constraints, respectively. A holistic result, of course, requires more than just naively "summing up the points"-which would yield that the block timestamp M BT and parameter approach M PA heavily outperform all other measures, in particular those resorting to oracles.
Instead, we propose more nuanced results. While we can confidently attest that temporal constraints can be implemented in blockchain-based process execution, the exact degree to which this is the case entirely depends on the scenario and the requirements of all involved participants. The comparisons provided in this paper as a whole may be taken as a guideline when evaluating measures for a concrete use case to help arriving at a meaningful choice.
Take, for instance, the running example from Fig. 1, in which an MNO and its customer handle an invoice. At first glance, the parameter approach M PA seems like a good choice, since it provides perfect accuracy, eliminating legally questionable situations in which fines are added prematurely. However, the customer may have doubts about the credibility of those timestamps, as they are usually not in a perceived position of power in face of a large corporation like an MNO. In turn, the MNO might take care of thousands of customers, making them relucant to place trust in customer-provided timestamps which are hard to oversee. Thus, the block timestamp M BT seems like the more sensible choice, since the relative deficit in accuracy rarely comes into play when looking at durations of days or months. In practice, deviations due to processing times-like for bank transfers-are well-understood and should pose no further problems when applied to blockchain technology.

B. General Evaluation
The fields of BPM and blockchain technology are highly complex and diverse in their own rights, let alone in their interplay. In this section, we will briefly evaluate whether this has an impact on the results of this paper.
1) Technological Generality: The blockchain model we introduced in Sect. III is based on common blockchains such as Ethereum [20] and Tezos [21], but adopts a somewhat traditional structure for the blockchain and its protocols which initially lead to the restrictions identified in Sect. II-B. There are blockchains which work differently, though, and may not experience the same difficulties: Hyperledger Fabric [24] uses sophisticated network structures and provides endorsement-based transaction timestamps. Corda R3 [25] features a concept called "time-windows", in which notaries enforce certain temporal constraints. Ostensibly, having a participant, notary, or endorser provide a timestamp is equivalent to the parameter approach M PA introduced in this paper in many aspects-trust is merely shifted. Nevertheless, novel blockchains might open up new perspectives and issues in the future.
2) Conceptual Completeness: We did not consider some blockchain concepts like forks. As a consequence confirmation time, i.e., the time a participant has to wait in practice until they can be reasonably sure a transaction was successfully included in the blockchain, is not taken into account. This does not majorly impact our results, though. From a smart contract's perspective, forks are not visible and thus do not affect any time measure. From a participant's perspective, personal risk tolerance is highly individual, and confirmation times might vary greatly [22].
3) Coverage of Temporal Constraints: While we have largely covered inter-activity and inter-process temporal constraints in this paper, we did not dive deeper into intra-activity constraints like activity durations [9]. These kinds of constraints are rarely found in blockchain-based business process execution approaches since transactions usually have a very brief time limit to avoid deadlocks and ensure throughput. This inherently limits the time a transaction can spend processing an activity. Nevertheless, intra-activity temporal constraints have been shown to be in principle feasible within single blockchain transactions [26].
Conceivably, constraints on task durations could also be implemented using at least two transactions for each activity, one at the start and one at the end of working on it. Additionally, task duration constraints in BPMN have been shown to be expressible via inter-activity temporal constraints using specific patterns of timer and signal events [27]. This would make them susceptible to the same techniques we used in this paper for the other temporal constraints.

VII. RELATED WORK
Temporal constraints are a well-researched area in BPM [7], [9]. Yet, little research has been done regarding the implementation of temporal constraints in blockchain-based process execution. Notable frameworks like Caterpillar [4], Lorikeet [3], and others [17]- [19] do not mention them at all. Some approaches briefly acknowledge some challenges involved and leave them for future work [2], [5], or seem to support some notion of temporal constraints without discussing the actual implementation [6]. Some exceptions do exist, however.
Abid et al. extend Caterpillar to support the modeling and execution of several intra and inter-activity temporal constraints like task durations and absolute start/end times [26]. Their implementation on Ethereum uses time-guards checking block timestamps-called M BT in this paper-to evaluate those constraints, but the authors do not provide a critical discussion of the consequences or feasibility of that decision. Similar restrictions apply to Mavridou and Laszka, who use finite state machines as their source modeling language and support timed transitions within them, again implemented using block timestamps on Ethereum [28].
Lastly, work has been carried out regarding the simulation and prediction of temporal aspects in blockchain-based process execution. Yasaweerasinghelage et al. predict more technical properties of blockchain networks like confirmation times and how they impact business process execution [22]. Haarmann annotates choreography models with activity-level duration information and estimates the total duration of the choreography in face of varying inclusion times and block times through simulation [29]. Both works abstract from the concrete source of the timing information, i.e., they assume there is some measure readily available.
In summary, we assert that no approach provides a systematic discussion and evaluation of temporal constraints and their implementation on blockchain. Important metrics like trust or accuracy, alternative measures like oracle-based timestamps, or more advanced patterns of constraints like deferred choice are not considered. Thus, to the best of our knowledge, this paper contributes the first holistic framework of its kind.

VIII. CONCLUSION AND FUTURE WORK
Temporal constraints are of utmost importance in business processes. When implementing compliant blockchain-based smart contracts for these processes, however, the blockchain environment's inherent restrictions pose several challenges. In this paper, we have identified these challenges, and proposed a number of alternative measures facilitating temporal constraints. We have compared these measures, and provided hints as to their utility in process execution. In particular, the results and their critical assessment can be used as a guideline to choose the right measures for specific scenarios. We hope that our contributions may help in enabling the development of more sophisticated and complete blockchain-based business process execution platforms.
In future work, we aim to explore further techniques not discussed in this paper. Second-layer consensus protocols could be used to let participants in a process dispute timestamps they suspect are invalid. Heartbeat transactions could trigger the smart contract regularly to globally check enabled constraints, and reduce the potential for false positives or negatives later on. Lastly, social and organizational aspects surely warrant a deeper look, for example regarding the actual level of trust between collaborating enterprises and which trade-offs in enforcing temporal constraints are acceptable in practice. This could help to further broaden the acceptance of blockchain technology in BPM in the near future.