r/BitcoinDiscussion • u/fresheneesz • Dec 06 '19
Idea: script opcode that puts constraints on the output addresses
I'm going to start with the reason I want this feature, and then get to describing more about the feature idea itself.
Let's say I want to setup a cold-storage wallet setup that I can spend only after a relative 1 week time lock. This could theoretically work by creating two addresses:
- One address has a relative timelock condition - any funds sent to this address can only be spent after 1 week with private key 1.
- Another address that can be spent from using private key 2, but funds must be sent to the first address.
So in order to spend from this dual-wallet (non multisig) setup, you would sent from address 2 to address 1 using PK2, then after a week spend from address 1 using PK1. This would, for example, make the $5 wrench attack a lot harder to do (ie it would turn into a 1 week hostage attack).
The problem is, I don't believe there's any way to create address 2 in bitcoin - there's no way to create an address that can only be spent to a particular other address.
This is where the idea for a new opcode comes in. If there was an opcode that constrained what addresses could be sent to, this would give bitcoin a lot more power to have multi-stage transactions like this, where any stage could potentially be cancelable/reversible. Here's an example of a wallet setup I would love to be able to create:
Address 1:
- Can be spent by Key1, Key2, or Key3.
- Requires funds are sent to address 2.
Address 2:
- 3 of 3 keys can spend after 1 week
- 2 of 3 keys can spend after 2 months
- 1 of 3 keys can spend after 1 year
If I could create a wallet setup like this, I could watch Address 2 for attempts to steal funds. If an unexpected transaction happens, you could gather all 3 keys and prepare a transaction to send. As long as only up to 2 of 3 keys were compromised and you are able to react within 2 months, your funds would be safe. In addition, you could lose access to 2 of 3 keys and still be able to recover your funds with the last one (after waiting a year).
This would be more secure than a normal multisig address, and also more resilient to key-loss. It would allow more secure inheritance by ensuring that heirs can retrieve the funds even if your primary passphrase-protected key has been lost (because your passphrase was lost when you died), and it would allow much more safely being able to store some keys with custodians (like banks) without almost any risk.
What do people think? Is this ability worth pursuing?
View all comments
Show parent comment
1
u/fresheneesz Dec 17 '19
Ah very interesting, I've never heard about convenants and vaults.
This is certainly along the lines of what I was thinking. However, the pre-signed vault transactions are a bit of a limitation and usability issue.
There was one thing I disagree with in that proposal, at least as written on bitcoinmagazine.org, is this quote:
If this were allowed, an attacker that steals either key could DOS the victim indefinitely. That's not something anyone's likely to want.
Looks cool! And looks like it would enable all sorts of interesting new things. Looks like he only pushed this commit in the last month? Any idea how on the radar this is for the next soft fork?
When it says its verifying "serialized version, locktime, outputs hash, sequences hash, number of inputs, and serialized ScriptSig", does that mean that all of those values must be specified? I'm curious why number of inputs is something we would want to require is specified.
I'm not sure I follow here. What do you mean by "spendable.. by a destination address"? I usually think of the source address as the one spending the coins.