summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2023-09-29 09:17:32 -0400
committerJames O'Beirne <james.obeirne@pm.me>2023-09-29 09:19:15 -0400
commit014b832e07d3be3c6aff1230d560fcf7032f0495 (patch)
tree7bf9b606791cb480125a9a81a816c04f4ff59212
parent4aae726be9610a675b362e66f539ce0d5f903a5f (diff)
BIP-345: add sigops cost of 60
-rw-r--r--bip-0345.mediawiki1
1 files changed, 1 insertions, 0 deletions
diff --git a/bip-0345.mediawiki b/bip-0345.mediawiki
index 87e084c..e63e0a2 100644
--- a/bip-0345.mediawiki
+++ b/bip-0345.mediawiki
@@ -266,6 +266,7 @@ where
After the stack is parsed, the following validation checks are performed:
+* Decrement the per-script sigops budget (see [https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki#user-content-Resource_limits BIP-0342]) by 60<ref>'''Why is the sigops cost for OP_VAULT set to 60?''' To determine the validity of a trigger output, OP_VAULT must perform an EC multiplication and hashing proportional to the length of the control block in order to generate the output's expected TapTweak. This has been measured to have a cost in the worst case (max length control block) of roughly twice a Schnorr verification. Because the hashing cost could be mitigated by caching midstate, the cost is 60 and not 100.</ref>; if the budget is brought below zero, script execution MUST fail and terminate immediately.
* Let the output designated by <code><trigger-vout-idx></code> be called ''triggerOut''.
* If the scriptPubKey of ''triggerOut'' is not a witness program of the same version and same tapleaf version as the currently executing script, script execution MUST fail and terminate immediately.
* Let the script constructed by taking the <code><leaf-update-script-body></code> and prefixing it with minimally-encoded data pushes of the <code><n-pushes></code> leaf-update script data items be called the ''leaf-update-script''.