Skip to content

Commit dafc00b

Browse files
committed
Using admonitions for important warnings and pitfalls
1 parent 6c25c46 commit dafc00b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/documentation/timelocks.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ Enforcing an absolute timelock in SimplicityHL uses the jets `check_lock_height`
8484

8585
A relative timelock is calculated based on the time when a particular UTXO was included in a block.
8686

87-
The Simplicity jets that directly enforce relative timelocks have been deprecated due to an implementation error. However, a workaround is available.
87+
!!! warning "Deprecated jets"
88+
The Simplicity jets that directly enforce relative timelocks have been deprecated due to an implementation error. However, a workaround is available. This document describes the workaround, not the deprecated jets.
8889

8990
This function enforces a relative distance timelock by calling a combination of related jets.
9091

@@ -166,7 +167,10 @@ Transactions that consume UTXOs with timelock conditions must be constructed app
166167

167168
## No maximum time constraints
168169

169-
In some smart contracts, one might be tempted to use timelock jets to require a transaction to happen *before* a certain time rather than *after*. However, this is not supported. **Architecturally, timelocks in Simplicity contracts can only be usefully used to enforce minimum times, not maximum times, when transactions can occur.**
170+
!!! warning "Timelocks enforce minimum transaction times, not maximum times"
171+
In some smart contracts, one might be tempted to use timelock jets to require a transaction to happen *before* a certain time rather than *after*. However, this is not supported. **Architecturally, timelocks in Simplicity contracts can only be usefully used to enforce minimum times, not maximum times, when transactions can occur.**
172+
173+
This section further discusses this limitation.
170174

171175
Because of the *monotonicity* property of Bitcoin and related blockchain systems, there is no way to directly express a requirement that a transaction occur *before* a certain block height and not after. These systems enforce a rule that a specific transaction that was valid at some point remains valid at all times in the future. Although you can write SimplicityHL code that asserts that a lock distance is *smaller than* rather than *larger than* a specific numerical value, the person creating the transaction can simply assert a small `sequence` value which will be accepted as valid by the blockchain consensus.
172176

0 commit comments

Comments
 (0)