Skip to content

Instantly share code, notes, and snippets.

@rot13maxi
Created October 31, 2023 14:25
Show Gist options
  • Save rot13maxi/4223e0358d3da30a73dac0e6fd8498c6 to your computer and use it in GitHub Desktop.
Save rot13maxi/4223e0358d3da30a73dac0e6fd8498c6 to your computer and use it in GitHub Desktop.
herberger tax with cat
herberger tax with cat + tapscript
operations:
- set price
- pay tax
- auction or seize if taxes not paid
- anyone-can-buy at current price
set-price:
spend the UTXO to the same script, include as an output an OP_RETURN that sets the tax-payment.
script in the set-price operation checks that the SPK of the input matches the SPK of the output
should we require a tax payment at price-setting time? trying to mitigate a scenario where you wait until
the tax is almost due and then crank the price down and then back up again
pay-tax:
input: previous txout
outputs: same spk, also an output to the tax collector
script validates that the second output on the prev-tx was an op_return that contains a price that matches the value of the second output
seize:
input: previous txout
output: ???
the hergerger tax script contains a relative timelock. if its expired, anyone can spend
anyone-can-buy:
input: previous txout
output: ???, previous owner address
script path that adds up the tax-payment amount `n` times, and then validates that the owner-payment amount matches.
Big open question: how do we ensure that on the seize or anyone can buy, that it goes to a script that enforces the hergerger tax? on the seize path, we could always send it back to the tax authority and they can reset it. but on anyone-can-buy, we need to make sure the script encodes the same constraints. Without a taptweak script operation, we can't verify the taptree on the stack :-/ I think we need something like TLUV for that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment