diff --git a/doc/reference/simple-scripts.md b/doc/reference/simple-scripts.md index 0e230155697..1f08cc548ba 100644 --- a/doc/reference/simple-scripts.md +++ b/doc/reference/simple-scripts.md @@ -281,25 +281,26 @@ NB: If you specify `"type": "any"` this will allow you to spend from your script ## Bounds -It is important to understand the bounds on a transaction and how they relate to the time locking scripts. Previously we had a `ttl` argument in the cli which was an upper bound on a transaction i.e the transaction was valid up until that slot number. This has been replaced with `--lower-bound` and `--upper-bound` arguments as described below: +It is important to understand the bounds on a transaction and how they relate to the time locking scripts. Previously we had a `ttl` argument in the cli which was an upper bound on a transaction i.e the transaction was valid up until that slot number. This has been replaced with `--invalid-before` and `--invalid-hereafter` arguments as described below: ``` -If you specify a lower bound on a transaction it is valid from the lower-bound: - lower bound +infinity - |-------------------> -If you specify an upper bound on a transaction it is valid to upperbound - 1: - -infinity upper bound - 1 - <-------------------| -If you specify both bounds the tx is valid from the lower bound to the upperbound - 1 - lower bound upper bound - 1 - <-------------------> +If you specify a lower bound on a transaction it is valid from the invalid-before slot (IBS): + + [IBS, +infinity) + +If you specify an upper bound on a transaction it is valid to invalid-hereafter slot - 1 (IHS - 1): + + (-infinity, IHS) + +If you specify both bounds the tx is valid from the IBS to the IHS - 1 + [IBS, IHS) ``` Whichever bound you specify, the slot number in which you submit your transaction has to be within that bound. For example -if you submit your transaction in slot 500 and you specify a lower bound of 600 then your transaction will be rejected. +if you submit your transaction in slot 500 and you specify a `--invalid-before` slot of 600 then your transaction will be rejected. -This also applies to time locking scripts. If you specify a time lock script with `after: 1000` you must specify a lower bound of at least 1000 and therefore also submit that transaction in or after slot 1000. +This also applies to time locking scripts. If you specify a time lock script with `after: 1000` you must specify a `--invalid-before` of at least 1000 and therefore also submit that transaction in or after slot 1000. -Conversely, if you specify a time lock script with `before: 500` you must specify an upper bound of at most 500 and submit the transaction before slot 500. NB: `before: 500` means the transaction is expired in slot 500. +Conversely, if you specify a time lock script with `before: 500` you must specify an `--invalid-hereafter` slot of at most 500 and submit the transaction before slot 500. NB: `before: 500` means the transaction is expired in slot 500. Once you have generated your time locked script you need to follow all the same steps above for a multisignature script with a slight modification of [step 1](#Step-1---construct-the-tx-body) which needs to be amended as follows: @@ -322,12 +323,12 @@ Examples of the time locking scripts are: "type": "all" } ``` -For `after` scripts we must provide a lower bound that is greater than or equal to the specified slot number in our simple script. In the example above this means >= 1000. +For `after` scripts we must provide a `--invalid-before` slot that is greater than or equal to the specified slot number in our simple script. In the example above this means >= 1000. ```bash cardano-cli shelley transaction build-raw \ --ttl 1000 \ - --lower-bound 1000\ + --invalid-before 1000\ --fee 0 \ --tx-in (txin of script address) --tx-out yourspecifiedtxout \ @@ -352,12 +353,12 @@ cardano-cli shelley transaction build-raw \ } ``` -For before scripts we must provide an upper bound that is less than or equal to the specified slot number in our simple script. In the example above this means <= 3000: +For before scripts we must provide a `--invalid-hereafter` slot that is less than or equal to the specified slot number in our simple script. In the example above this means <= 3000: ```bash cardano-cli shelley transaction build-raw \ --ttl 1000 \ - --upper-bound 3000\ + --invalid-hereafter 3000\ --fee 0 \ --tx-in (txin of script address) --tx-out yourspecifiedtxout \