Emulating OP_VAULT with elements opcodes

Batched unvault on the left, Batched recovery on the right.

VAULT emulation:

  1. a witness program scriptPubKey that, when hashed, yields the <unvault-spk-hash>,
  2. a witness stack satisfying that witness program

BatchAgg Checker

  1. The BatchAgg script first ensures BatchAgg Checker is the last input spent in the spending transaction.
  2. The BatchAgg script then checks the number of inputs in the spending transaction is LEAF INDEX + 3.
  3. The BatchAgg script then checks if all inputs (except for the last two) share the same VAULT scriptpubkey.
  4. The BatchAgg script finally sums all the input values (except for the last two) and constrains the value to the first output value.

Fee-supplier or Unvault SPK Mirror

--

--

Bitcoin hustler

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store