-
Notifications
You must be signed in to change notification settings - Fork 1k
Scoped Witnesses #544
Copy link
Copy link
Closed
Labels
BlockerIssues that are blocking other issues. Check issues details to see what it is blocking.Issues that are blocking other issues. Check issues details to see what it is blocking.LedgerModule - The ledger is our 'database', this is used to tag changes about how we store informationModule - The ledger is our 'database', this is used to tag changes about how we store informationReady-to-ImplementIssue state: Ready to be implemented or implementation in progressIssue state: Ready to be implemented or implementation in progress
Milestone
Metadata
Metadata
Assignees
Labels
BlockerIssues that are blocking other issues. Check issues details to see what it is blocking.Issues that are blocking other issues. Check issues details to see what it is blocking.LedgerModule - The ledger is our 'database', this is used to tag changes about how we store informationModule - The ledger is our 'database', this is used to tag changes about how we store informationReady-to-ImplementIssue state: Ready to be implemented or implementation in progressIssue state: Ready to be implemented or implementation in progress
Currently, user is able to attach (global) witnesses to an Invocation (or Contract/Claim) Transaction, which are validated on execution time by means of CheckWitness function (mostly based on GetScriptsForVerifying).
These global witnesses are enough for a scenario where a single main script is executed (Contract/Claim Tx). However, on Invocation tx we can have surrogated executions by means of dynamic invoke, so user must have the power to add Contract-Specific Witnesses (in contrast to Global Witnesses), which are witnesses valid only during the execution on a specific contract.
If community likes the idea, I can propose a PR, which should be fully backwards-compatible by simply adding an extra attribute to transaction:
Scriptattribute will continue to correspond to current Global Witness behavior; and a newContractSpecificScriptwill only be listed as a verification script when execution is happening on the specified target script. This gives power to user provide a signature which is only valid to its purposes, and nothing more.ContractSpecificScriptwill receive two 20-byte parameters: (i) attached scripthash (same asScript) (ii) target scripthash (contract that is allowed to receive this verification script as validation), which can also be provided as a list if multiple targets are informed (to avoid repeated signature validations).Another possibily is to simply adjust
Scriptattribute to receive this extra (optional) parameter, which is a list of target scripthashes where this is valid (if left empty, it's global).