OP_VAULT: a new vault proposal



Summary:

The author has received a suggestion from Greg about an improvement to the "output flow" of an expected vault use. In the existing draft implementation, all outputs except for the OP_UNVAULT trigger had the ability to hide their true script until spend. However, the OP_UNVAULT trigger had to be bare so that the script interpreter could inspect part of it for validity. Greg's suggestion is to put the script onto the witness stack when spending the OP_VAULT output, which would allow the script interpreter to construct the expected scriptPubKey and enable all outputs in vault lifecycles to be P2TR. This would conceal the operation of the vault and also allow the OP_VAULT/OP_UNVAULT opcodes to be implemented as Taproot-only OP_SUCCESSx opcodes if desired. However, the problem arises regarding enabling something similar for witness v0 outputs, specifically for (ii) and (iii) output scripts to live behind P2WSH. One potential solution is to have the script interpreter construct the expected OP_UNVAULT scriptPubKey based on what witness version it sees, such as using "OP_0 " for a fitting P2WSH scriptPubKey or using "OP_1 {