* [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
@ 2019-08-07 13:48 Bryan Bishop
2019-08-07 20:32 ` Bryan Bishop
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Bryan Bishop @ 2019-08-07 13:48 UTC (permalink / raw)
To: Bitcoin Dev, Bryan Bishop
Hi,
I have a proposal for implementing bitcoin vaults in a way that does not
require any soft-forks or other software upgrades, although it could benefit
from SIGHASH_NOINPUT which I'll describe later.
I call them pre-signed vaults.
Vault definition
================
Here, a vault is defined as a transaction setup scheme that binds both the user
and the attacker to always using a public observation and delay period before a
weakly-secured hot key is allowed to arbitrarily spend coins. This is the same
definition previously used[1]. During the delay period, there is an opportunity
to initiate recovery/clawback which can either trigger deeper cold storage
parameters or at least reset the delay period to start over again for the same
keys.
One of the important components of this is the delete-the-key pre-signed
transaction concept, where only a single transaction is (pre)signed before
deleting the key. This is basically an emulation of a covenant and enforces a
certain outcome.
Background and motivation
=========================
I was looking at Eyal and Sirer's 2016 vaults paper [1], and I saw this
headscratcher:
> Vault transactions use a delay mechanism. We note that vault transactions
> cannot be implemented with existing timing mechanisms such as
> CHECKLOCKTIMEVERIFY opcode or transaction locktime.
This was probably written before the introduction of OP_CHECKSEQUENCEVERIFY.
Still, a viable construction would have more steps than just using OP_CSV. They
were probably not thinking about what those steps might be, because in the
context of the paper they were proposing a bitcoin vault implemented using
recursive consensus-enforced covenants via a new opcode, which obviously cannot
be deployed without an upgrade fork. Covenants have been discussed for years,
but require new opcodes or other consensus-enforcement changes.
Relative locktimes are useful here because there is no knowledge as to when the
transactions might be broadcasted in the future. The delays need to be relative
to after the transaction is included in the blockchain, not to setup
initialization time.
Also, from [2]:
> We show that a [vault transaction] mechanism is currently not possible in all
> cryptocurrencies [...] Bitcoin's scripting language requires support for
> covenants.
I haven't seen any previous proposal for how to implement recursive bitcoin
vaults without a fork and without a covenant. After asking around, I am pretty
sure this is somewhat novel. The closest I guess is [3].
Vaults are particularly interesting as a bitcoin cold storage security
mechanism because they enable a publicly observable delay period during which
time a user could be alerted by a watchtower that a thief might be in the
process of stealing their coins, and then the user may take some actions to
place the coins back into the vault before the relative timelock expires. There
seems to be no way to get this notification or observation period without a
vault construction. It might have been assumed it required a covenant.
Having a vault construction might go a long way to discourage would-be
attackers, on principle that the attacker might be incapable of recovering
their cost-of-attack because the recovery mechanism can lock up the coins
indefinitely. Griefing or denial-of-service would still be possible, of course,
but with multisig there might be some ways to put a halt to that as well. I am
working under the assumption that the attacker knows that the user is a vault
user.
Vaults
======
The idea is to have a sequence of pre-generated pre-signed transactions that
are generated in a certain way. The basic components are a vaulting transaction
that locks coins into a vault, a delayed-spend transaction which is the only
way to spend from a vault, and a re-vaulting transaction which can
recover/clawback coins from the delayed-spend transaction. The security of this
scheme is enforced by pre-signing transactions and deleting private keys, or
with the help of SIGHASH_NOINPUT then there's another scheme where private keys
are provably never known. This enforces that there's only a specific set of
possible outcomes at every step of the vault.
Some examples of what the set of broadcasted transactions might look like in
regular usage:
coins -> VT -> DST -> exit via hot wallet key
coins -> VT -> DST -> RVT
coins -> VT -> DST -> RVT -> DST -> ...
coins -> VT -> ... -> RVT998 -> nuclear abort
where:
VT = vault transaction
DST = delayed-spend transaction
RVT = re-vaulting transaction
The delayed-spending transaction would have a single output with a script like:
(
30 days AND hot wallet key
OR 10 days AND re-vaulting public key
OR 1 day AND 4-of-7 multisig
OR 0 days and super-secure nuclear abort ragequit key
)
Another diagram:
VT_100 -> DST -> (optionally) RVT -> coins are now in VT_99
VT_99 -> DST -> (optionally) RVT -> coins are now in VT_98
...
VT_1 -> burn-all-coins nuclear abort ragequit (final)
Definitions
===========
Transactions and components:
* Commitment/funding vault setup transaction. Signed after setting up the
transaction tree, and it is broadcasted whenever funds are to be placed into
the vault.
* Delayed-spend transaction. Signed during the vault transaction tree setup,
and it is broadcasted when the user wants to withdraw coins from cold storage
or otherwise manipulate the coins. The output script template used by the
delayed-spend transaction was defined earlier.
* Hot wallet key: Somewhat insecure key. This can also be multisig using
multiple hot keys.
* Re-vaulting key: It is important to note that the private key either never
existed (SIGHASH_NOINPUT + P2WPK for the re-vaulting transaction) or the
private key was deleted after pre-signing the re-vaulting transaction.
* 4-of-7 multisig: This is a group of differently-motivated individuals who are
responsible for signing transactions. This multisig group is not necessry to
describe the technique, I just think it's a useful feature for a vault to
include.
* Nuclear abort key: Also unnecessary. This is a key for which only a single
signed transaction will ever exist, and that single transaction will spend to a
proof-of-burn key like 0x00. This key must be extremely secure, and if there
is any doubt about the ability to keep such a key secured, then it is better to
not include this in the protocol. Alternatively, maybe include it as an option
50 layers down in the revaulting sequence.
* Nuclear-abort pre-signed transaction. This is signed during transaction tree
setup, before constructing the delayed-spend transaction. It is broadcasted
only if the user wants to provably relinquish coins forever without giving the
attacker any coins.
* Re-vaulting transaction. This is where the magic happens. The re-vaulting
transaction is signed during transaction tree setup, before constructing the
delayed-spend transaction for the parent vault. The re-vaulting transaction is
broadcasted when someone wants to prevent a coin withdrawal during the public
observation delay period. The re-vaulting transaction spends the delayed-spend
transaction outputs. It has a single output with a script created by running
the entire vault setup function again. Hence, when the re-vaulting transaction
is confirmed, all of the coins go back into a new identically-configured vault
instead of being relinquished through the delayed-spend transaction timeout for
hot wallet key signing.
* Special case: final transaction. This is the very first pre-signed
transaction during setup, and the transaction spends the coins using any
provable burn technique. This is broadcasted only at the end of the game, as an
ultimate abort and forfeiture of coins without giving in to an adversary. It's
similar to the nuclear-abort ragequit transaction but it sits at the same place
that a delayed-spend transaction would, at the very end of the rainbow or
yellow brick road.
Example log during vault setup
==============================
When running the recursive vault setup function, the created artifacts (in
order) will look like:
1) choose one of:
(first iteration) pre-signed burn-all-coins nuclear abort ragequit (final)
(all others) a new vault setup transaction spendable only by its
delayed-spend transaction
2) pre-signed re-vaulting transaction sending to vault setup or final
transaction, with a unique private key
3) pre-signed delayed-spend transaction, with a unique private key
4) vault transaction spendable only by the delayed-spend public key
Pseudocode
==========
In pseudocode (where PTX is a pre-signed transaction function with
private key deletion):
VT(counter, *args, **kwargs) =
if counter == 0:
DST = PTX("burn-all-coins")
else:
next_vault = VT(counter-1, *args, **kwargs)
revaulting = PTX("only spendable by next_vault public key")
DST = PTX("DST policy including revaulting and other conditions")
vault = PTX("spendable only by this DST")
return vault
Pre-signed transactions
=======================
What has been known for a while is that a covenant can be somewhat emulated
using a pre-signed transaction where the user then deletes the private key,
enforcing that the user's chosen policy must be enforced since there is only
one existing option and there will only ever be one option.
Such a scheme has been previously described for simple one-time and chained
vaults [3]. I have learned that the author has an implementation that is in
preparation, for a non-recursive version.
Note that a series of pre-signed transactions can be considered to be an
emulation of a covenant. Imagine a linear chain of pre-signed transactions
where each hop has a relative locktime before being able to broadcast the next
transaction. To recover the coins at the end of the rainbow, one would need to
broadcast each sequential transaction in order and wait for the relative
timelocks to expire each time. Here, covenants provide something like an undo
for bitcoin, but only between pre-determined addresses and scripts.
Fees for pre-signed transactions
================================
There's a few different techniques to talk about:
1) SIGHASH_SINGLE|SIGHASH_ANYONECANPAY to let someone add inputs and outputs.
This can get pretty complex though.
2) Add a zero-value OP_TRUE output and let anyone spend the zero-value output
and attach a child-pays-for-parent (CPFP) transaction to pay for everything.
3) Pre-sign a variety of different possible fee rates. Unfortunately this
involves an explosive blow-up in the amount of transaction data to generate. It
might actually be a reasonable blow-up amount, only resulting in a few hundred
megabytes of additional data. But given the other options, this is unnecessary.
Delete the key (for pre-signed transactions)
============================================
The delete-the-key trick is simple. The idea is to pre-sign at least one
transaction and then delete the private key, thus locking in that course of
action.
Unfortunately, delete-the-key doesn't really work for multisig scenarios
because nobody would trust that anyone else in the scheme has actually deleted
the secret. If they haven't deleted the secret, then they have full unilateral
control to sign anything in that branch of the transaction tree. The only time
that delete-the-key might be appropriate would be where the user who deletes
the key and controls the key during the setup process is also the sole
beneficiary of the entire setup with the multisig participants.
Alternative fee rates are easier to deal with using delete-the-key, compared to
a technique where the private key never existed which can only be used to sign
one fee rate per public key, requiring an entirely new vault subtree for each
alternative fee rate. With delete-the-key, the alternative fee rates are signed
with the private key before the private key is deleted.
Multisig gated by ECDSA pubkey recovery for provably-unknown keys
=================================================================
A group can participate in a multisig scheme with provably-unknown ECDSA keys.
Instead of deleting the key, the idea is to agree on a blockheight and then
select the blockhash (or some function of the chosen blockhash like
H(H(H(blockhash)))) as the signature. Next, the group agrees on a transaction
and they recover the public key from the signature using ECDSA pubkey recovery.
A pre-signed transaction is created, which will trigger the start of the public
observation period described earlier and also start the clock for the bip112
relative timelock on its output. In the output script, an OR branch
is added that enables the use of a re-vaulting key which could also be its own
separate multisig construction.
This is incompatible with P2WPKH because the P2WPKH spending scriptSig needs to
have the pubkey (to check the hash of the pubkey against the pubkeyhash in the
scriptPubKey), which in turn makes it incompatible with ECDSA pubkey recovery
which requires a hash of the message. However, with P2WPK and SIGHASH_NOINPUT
instead of P2WPKH it could conceivably work. SIGHASH_NOINPUT is required because
otherwise the input includes a txid which references the public key. With P2WPK,
the scriptSig only needs a signature and not a public key. Note that what would
be required is a version of SIGHASH_NOINPUT that does not commit to the public
key, and I think a few of the NOINPUT proposals are committing to the public
key.
Alternatively, there may be some constructions using the 2-party ECDSA
techniques or m-n party ECDSA techniques.
Deploying exceedingly large scripts
===================================
A brief interlude to share a somewhat obvious construction. I haven't seen this
written down yet.
Suppose there is a bitcoin script that someone is interested in using, but it
far exceeds the size limits and sigop limits. To fix this, they would split up
the script into usable chunks, and then use the delete-the-key mechanism (or
the other one) to create an OR branch that is signable by a single key for
which only a single signature is known. That new pre-signed transaction would
spend to a script that has the output with the remainder of the script of
interest. Re-vaulting or clawback clauses can be added to that output as well,
but spending back to the original root script will only work by generating new
scripts and keys (since the final hash isn't known until the whole tree is
constructed, it's a dependency loop).
Recursively-enforced multi-party multisig bitcoin vaults
========================================================
Ideally, to enforce a covenant with impossible fairy dust magic, we would ask
for a bitcoin transaction that could be self-referential because the
only-one-signature-ever trick requires that the signed message be known before
producing the signature, and the signature has to be known before the public
key can be known, and the public key would have to be included in the
self-referential message/transaction hash value. So, that's a dependency loop
and it doesn't work. It would be interesting to explore a variation of this
idea with masking, such that a value X can be replaced by a hash over the whole
script with the X value, even though the real script will have the hash.
Someone else can figure that one out for me :-).
Instead of the self-referential values attempting to reference the same
script that is in the process of being constructed, an alternative is to use
the same script template but populate it with different parameters. The script
template gets reused over and over again, all the way down the tree, until the
final transaction which could be >100 years into the future once done adding up
all the relative locktimes. In fact, to create and populate this terrifying
recursive script tree, the final transaction needs to be created first, and
then it is given as input to the script template function and that output is
then given to the script template function itself-- and so on. At each stage,
there are additional pre-signed transactions and values to remember.
This can be written as:
final_transaction = TX(spend to 0x0000 to burn the coins)
initial_transaction = F(F(...F(final_transaction))
(This is missing parameters to indicate to the function what the spending
keys requirements are to be.)
See earlier explanation for more details.
Each call to the template populating function produces values that each must be
preserved for a very long time. It is less safe to store all of the pre-signed
transactions together at the same time, but more convenient. With less
redundancy, there is an increased chance of losing data over time, which could
render the coins completely frozen. This doesn't particularly worry me because
forgetting a key has that property already, and this could be likened to
hundreds of megabytes of extra key data or something. Unlike the much smaller
covenant-based (opcode-based covenant) vault construction, the multiple layers
here can be separately stored and protected, which might be able to protect
against an adversary that has stolen some of the re-vaulting keys but not all
of them.
Optimizations can be made to store parameters for generating the remainder of
the tree, such as using deterministic key derivation, such that megabytes of
data wouldn't need to be long-term stored. Only the initial parameters would
need to be stored.
Financial privacy for custody
=============================
One of the concerns raised in [2] is that if all coins at an exchange are
stored together in the same vault, then attackers would be able to learn about
access control policies by observing scripts and keys. Some privacy can be
recovered by using segregated vaults, at the cost of additional setup
complexity and keeping more data in long-term storage.
However, note that I think vaults are also useful for personal cold storage
solutions.
Fail-deadly mechanism
=====================
An early nuclear abort option can be added to these scripts. This idea was
explored in [2]. This would be a very cold very secret key that would abort the
re-vaulting procedure and send all coins to a (provably) nonsense key. This
allows a vault user to destroy the coins instead of continuously monitoring the
bitcoin blockchain for the rest of his life. The attacker can't recover their
cost of attack if they never get the coins, and this eliminates an entire class
of potential attackers who are directly interested only in financial gain. The
disadvantage is that if the attacker finds the secret key for the fail-deadly
mechanism and uses it, then all of the coins are gone forever.
Multisig variations
===================
The re-vaulting key could be the same key at each layer, or only sometimes the
same key, or always a unique key stored separately in another secure location.
Additionally, these re-vaulting keys could be subjected to multisig schemes, as
well as Shamir secret sharing schemes or other secret sharing schemes.
The idea of adding the 4-of-7 multisig component is to avoid griefing
situations, at the cost of the additional security requirements for the 4-of-7
multisig group.
Key rotation for vaults
=======================
Keeping the same hot wallet key for 100 years is not advisable. Rotate the keys
by setting up a new vault construction and initiating a withdrawal transaction
from the old vault to the new vault.
Single-use seals
================
This proposal may have inadvertedly demonstrated a practical way to implement
Peter Todd's single-use seals concept [4]. I am hesitant to say so, though,
because I think he would ask for a more sophisticated way to verify seal
closure.
Paid defection
==============
It might be advisable to add small rewards for evidence of defection amongst
multiparty multisig setups. Besides amounts spendable by individual keys from a
multisig setup, it may be possible to use a zero-knowledge contingent payment
for a zero-knowledge statement like: I have a signature s over some message m
which validates for pubkey pk where pk is a member of the multisig group. Then
the zkcp transaction would pay for knowledge of defectors. The zkcp procedure
would require interaction with the defector, while the direct pubkey method
would not. This is similar to companies paying employees to quit when they
value the payment over the value of continued employment.
Handling change
===============
It is important to note that this vault setup is one-time and once-only. There
must only ever be one deposit into one vault. Also, spending some coins would
require sending the change amount back into a new vault. Alternatively,
upfront work can be done to set a regular withdrawal stipend or assumption
about how many coins are left, such that the transaction tree can be
pre-generated for those possibilities, hence cutting down on future vault
reinitializations. It would also be possible to commit upfront to only ever
working in some minimum increment number of bitcoin or something.
It is very important to only fund the vault once, and only with the amount that
was configured when setting up the vault.
References
==========
[1] https://fc16.ifca.ai/bitcoin/papers/MES16.pdf
[2] http://www0.cs.ucl.ac.uk/staff/P.McCorry/preventing-cryptocurrency-exchange.pdf
[3] http://web.archive.org/web/20180503151920/https://blog.sldx.com/re-imagining-cold-storage-with-timelocks-1f293bfe421f?gi=da99a4a00f67
[4] https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015350.html
or https://diyhpl.us/wiki/transcripts/building-on-bitcoin/2018/single-use-seals/
or https://petertodd.org/2016/closed-seal-sets-and-truth-lists-for-privacy
Acknowledgements
================
* Jeremy Rubin for pointing out something embarrassingly broken in an earlier
draft.
* Bob McElrath for telling me to use SIGHASH_NOINPUT which I proceeded to
promptly forget about.
* Andrew Poelstra for the OP_TRUE trick.
* Joe Rayhawk for paid defection.
* Tadge Dryja for pointing out a few differences between SIGHASH_NOINPUT
proposals.
Thank you,
- Bryan
http://heybryan.org/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
@ 2019-08-07 20:32 ` Bryan Bishop
2019-08-07 21:19 ` Dustin Dettmer
2019-08-08 0:27 ` ZmnSCPxj
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Bryan Bishop @ 2019-08-07 20:32 UTC (permalink / raw)
To: Bitcoin Dev, Bryan Bishop
Hi,
One of the biggest problems with the vault scheme (besides all of the
setup data that has to be stored for a long time) is an attacker that
silently steals the hot wallet private key and waits for the vault's
owner to make a delayed-spend transaction to initiate a withdrawal
from the vault. If the user was unaware of the theft of the key, then
the attacker could steal the funds after the delay period.
To mitigate this, it is important to choose a stipend or withdrawal
amount per withdrawal period like x% of the funds. This limits the
total stolen funds to x% because once the funds are stolen the user
would know their hot key is compromised, and the user would know to
instead use one of the other clawback paths during all of the future
withdrawal delay periods instead of letting the delay timeout all the
way to the (stolen) default/hot key.
The reason why a loss limiter is the way to go is because there's
currently no way (that I am aware of, without an upgrade) to force an
attacker to reveal his key on the blockchain while also forcing the
attacker to use a timelock before the key can spend the coins. I am
curious about what the smallest least invasive soft-fork would be for
enabling this kind of timelock. There are so many covenant proposals
at this point (CHECKSIGFROMSTACK, SECURETHEBAG, CHECKOUTPUTVERIFY,
....). Or there's crazy things like a fork that enables a transaction
mode where the (timelock...) script of the first output is
automatically prefixed to any of the other scripts on any of the other
outputs when an input tries to spend in the future. A thief could add
his key to a new output on the transaction and try to spend (just like
a user would with a fresh/rotated key), but the OP_CSV would be
automatically added to his script to implement the public observation
delay window.
Also, there was other previous work that I was only informed about
today after posting my proposal, so I should mention these as related
work:
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015793.html
https://blog.oleganza.com/post/163955782228/how-segwit-makes-security-better
https://www.youtube.com/watch?v=diNxp3ZTquo
https://bitcointalk.org/index.php?topic=5111656
- Bryan
http://heybryan.org/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 20:32 ` Bryan Bishop
@ 2019-08-07 21:19 ` Dustin Dettmer
2019-08-08 2:09 ` Sergio Demian Lerner
0 siblings, 1 reply; 12+ messages in thread
From: Dustin Dettmer @ 2019-08-07 21:19 UTC (permalink / raw)
To: Bitcoin Protocol Discussion, Bryan Bishop
[-- Attachment #1: Type: text/plain, Size: 2896 bytes --]
Does revaulting vault up with the same keys, or new ones?
Are they new derivation paths on the same key?
Would love some expanded explanation on how you’re proposing this would
work.
Thanks,
Dustin
On Wed, Aug 7, 2019 at 1:35 PM Bryan Bishop via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:
> Hi,
>
> One of the biggest problems with the vault scheme (besides all of the
> setup data that has to be stored for a long time) is an attacker that
> silently steals the hot wallet private key and waits for the vault's
> owner to make a delayed-spend transaction to initiate a withdrawal
> from the vault. If the user was unaware of the theft of the key, then
> the attacker could steal the funds after the delay period.
>
> To mitigate this, it is important to choose a stipend or withdrawal
> amount per withdrawal period like x% of the funds. This limits the
> total stolen funds to x% because once the funds are stolen the user
> would know their hot key is compromised, and the user would know to
> instead use one of the other clawback paths during all of the future
> withdrawal delay periods instead of letting the delay timeout all the
> way to the (stolen) default/hot key.
>
> The reason why a loss limiter is the way to go is because there's
> currently no way (that I am aware of, without an upgrade) to force an
> attacker to reveal his key on the blockchain while also forcing the
> attacker to use a timelock before the key can spend the coins. I am
> curious about what the smallest least invasive soft-fork would be for
> enabling this kind of timelock. There are so many covenant proposals
> at this point (CHECKSIGFROMSTACK, SECURETHEBAG, CHECKOUTPUTVERIFY,
> ....). Or there's crazy things like a fork that enables a transaction
> mode where the (timelock...) script of the first output is
> automatically prefixed to any of the other scripts on any of the other
> outputs when an input tries to spend in the future. A thief could add
> his key to a new output on the transaction and try to spend (just like
> a user would with a fresh/rotated key), but the OP_CSV would be
> automatically added to his script to implement the public observation
> delay window.
>
> Also, there was other previous work that I was only informed about
> today after posting my proposal, so I should mention these as related
> work:
>
> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015793.html
>
> https://blog.oleganza.com/post/163955782228/how-segwit-makes-security-better
> https://www.youtube.com/watch?v=diNxp3ZTquo
> https://bitcointalk.org/index.php?topic=5111656
>
> - Bryan
> http://heybryan.org/
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
[-- Attachment #2: Type: text/html, Size: 4136 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 21:19 ` Dustin Dettmer
@ 2019-08-08 2:09 ` Sergio Demian Lerner
2019-08-08 3:03 ` ZmnSCPxj
0 siblings, 1 reply; 12+ messages in thread
From: Sergio Demian Lerner @ 2019-08-08 2:09 UTC (permalink / raw)
To: Dustin Dettmer, Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 3483 bytes --]
Seems to be comparable to the proposed "Tick Method" from 2013:
https://bitcointalk.org/index.php?topic=307211.msg3308565#msg3308565
However I remember that someone told me the tick method had a flaw..
On Wed, Aug 7, 2019 at 6:28 PM Dustin Dettmer via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:
> Does revaulting vault up with the same keys, or new ones?
>
> Are they new derivation paths on the same key?
>
> Would love some expanded explanation on how you’re proposing this would
> work.
>
> Thanks,
> Dustin
>
> On Wed, Aug 7, 2019 at 1:35 PM Bryan Bishop via bitcoin-dev <
> bitcoin-dev@lists.linuxfoundation.org> wrote:
>
>> Hi,
>>
>> One of the biggest problems with the vault scheme (besides all of the
>> setup data that has to be stored for a long time) is an attacker that
>> silently steals the hot wallet private key and waits for the vault's
>> owner to make a delayed-spend transaction to initiate a withdrawal
>> from the vault. If the user was unaware of the theft of the key, then
>> the attacker could steal the funds after the delay period.
>>
>> To mitigate this, it is important to choose a stipend or withdrawal
>> amount per withdrawal period like x% of the funds. This limits the
>> total stolen funds to x% because once the funds are stolen the user
>> would know their hot key is compromised, and the user would know to
>> instead use one of the other clawback paths during all of the future
>> withdrawal delay periods instead of letting the delay timeout all the
>> way to the (stolen) default/hot key.
>>
>> The reason why a loss limiter is the way to go is because there's
>> currently no way (that I am aware of, without an upgrade) to force an
>> attacker to reveal his key on the blockchain while also forcing the
>> attacker to use a timelock before the key can spend the coins. I am
>> curious about what the smallest least invasive soft-fork would be for
>> enabling this kind of timelock. There are so many covenant proposals
>> at this point (CHECKSIGFROMSTACK, SECURETHEBAG, CHECKOUTPUTVERIFY,
>> ....). Or there's crazy things like a fork that enables a transaction
>> mode where the (timelock...) script of the first output is
>> automatically prefixed to any of the other scripts on any of the other
>> outputs when an input tries to spend in the future. A thief could add
>> his key to a new output on the transaction and try to spend (just like
>> a user would with a fresh/rotated key), but the OP_CSV would be
>> automatically added to his script to implement the public observation
>> delay window.
>>
>> Also, there was other previous work that I was only informed about
>> today after posting my proposal, so I should mention these as related
>> work:
>>
>> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015793.html
>>
>> https://blog.oleganza.com/post/163955782228/how-segwit-makes-security-better
>> https://www.youtube.com/watch?v=diNxp3ZTquo
>> https://bitcointalk.org/index.php?topic=5111656
>>
>> - Bryan
>> http://heybryan.org/
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev@lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
[-- Attachment #2: Type: text/html, Size: 5322 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-08 2:09 ` Sergio Demian Lerner
@ 2019-08-08 3:03 ` ZmnSCPxj
0 siblings, 0 replies; 12+ messages in thread
From: ZmnSCPxj @ 2019-08-08 3:03 UTC (permalink / raw)
To: Sergio Demian Lerner, Bitcoin Protocol Discussion
Good morning Sergio,
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Thursday, August 8, 2019 10:09 AM, Sergio Demian Lerner via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
> Seems to be comparable to the proposed "Tick Method" from 2013:
> https://bitcointalk.org/index.php?topic=307211.msg3308565#msg3308565
>
> However I remember that someone told me the tick method had a flaw..
Maybe the use of `SIGHASH_NONE` for both inputs of the TxOut transactions?
Also txid malleability.
The first can be fixed by not using `SIGHASH_NONE` for one of the inputs and requiring a hot privkey to sign with that.
The second can be fixed by using SegWit outputs.
Regards,
ZmnSCPxj
>
>
> On Wed, Aug 7, 2019 at 6:28 PM Dustin Dettmer via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
>
> > Does revaulting vault up with the same keys, or new ones?
> >
> > Are they new derivation paths on the same key?
> >
> > Would love some expanded explanation on how you’re proposing this would work.
> >
> > Thanks,
> > Dustin
> >
> > On Wed, Aug 7, 2019 at 1:35 PM Bryan Bishop via bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
> >
> > > Hi,
> > >
> > > One of the biggest problems with the vault scheme (besides all of the
> > > setup data that has to be stored for a long time) is an attacker that
> > > silently steals the hot wallet private key and waits for the vault's
> > > owner to make a delayed-spend transaction to initiate a withdrawal
> > > from the vault. If the user was unaware of the theft of the key, then
> > > the attacker could steal the funds after the delay period.
> > >
> > > To mitigate this, it is important to choose a stipend or withdrawal
> > > amount per withdrawal period like x% of the funds. This limits the
> > > total stolen funds to x% because once the funds are stolen the user
> > > would know their hot key is compromised, and the user would know to
> > > instead use one of the other clawback paths during all of the future
> > > withdrawal delay periods instead of letting the delay timeout all the
> > > way to the (stolen) default/hot key.
> > >
> > > The reason why a loss limiter is the way to go is because there's
> > > currently no way (that I am aware of, without an upgrade) to force an
> > > attacker to reveal his key on the blockchain while also forcing the
> > > attacker to use a timelock before the key can spend the coins. I am
> > > curious about what the smallest least invasive soft-fork would be for
> > > enabling this kind of timelock. There are so many covenant proposals
> > > at this point (CHECKSIGFROMSTACK, SECURETHEBAG, CHECKOUTPUTVERIFY,
> > > ....). Or there's crazy things like a fork that enables a transaction
> > > mode where the (timelock...) script of the first output is
> > > automatically prefixed to any of the other scripts on any of the other
> > > outputs when an input tries to spend in the future. A thief could add
> > > his key to a new output on the transaction and try to spend (just like
> > > a user would with a fresh/rotated key), but the OP_CSV would be
> > > automatically added to his script to implement the public observation
> > > delay window.
> > >
> > > Also, there was other previous work that I was only informed about
> > > today after posting my proposal, so I should mention these as related
> > > work:
> > > https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-February/015793.html
> > > https://blog.oleganza.com/post/163955782228/how-segwit-makes-security-better
> > > https://www.youtube.com/watch?v=diNxp3ZTquo
> > > https://bitcointalk.org/index.php?topic=5111656
> > >
> > > - Bryan
> > > http://heybryan.org/
> > > _______________________________________________
> > > bitcoin-dev mailing list
> > > bitcoin-dev@lists.linuxfoundation.org
> > > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> >
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
2019-08-07 20:32 ` Bryan Bishop
@ 2019-08-08 0:27 ` ZmnSCPxj
2019-08-08 1:16 ` Bryan Bishop
2019-08-12 14:40 ` [bitcoin-dev] Single-use-Seal Implementation Peter Todd
` (2 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: ZmnSCPxj @ 2019-08-08 0:27 UTC (permalink / raw)
To: Bryan Bishop, Bitcoin Protocol Discussion
Good morning Bryan,
> - Re-vaulting transaction. This is where the magic happens. The re-vaulting
> transaction is signed during transaction tree setup, before constructing the
> delayed-spend transaction for the parent vault. The re-vaulting transaction is
> broadcasted when someone wants to prevent a coin withdrawal during the public
> observation delay period. The re-vaulting transaction spends the delayed-spend
> transaction outputs. It has a single output with a script created by running
> the entire vault setup function again. Hence, when the re-vaulting transaction
> is confirmed, all of the coins go back into a new identically-configured vault
> instead of being relinquished through the delayed-spend transaction timeout for
> hot wallet key signing.
As transactions need to be signed in reverse order, it seems to me that there is a practical limit in the number of times a vault can be used.
Basically, the number of times we run the vault setup function is the limit on number of re-vaultings possible.
Is my understanding correct?
Regards,
ZmnSCPxj
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-08 0:27 ` ZmnSCPxj
@ 2019-08-08 1:16 ` Bryan Bishop
0 siblings, 0 replies; 12+ messages in thread
From: Bryan Bishop @ 2019-08-08 1:16 UTC (permalink / raw)
To: ZmnSCPxj, Dustin Dettmer, Bryan Bishop; +Cc: Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 2181 bytes --]
Replying to two emails below.
On Wed, Aug 7, 2019 at 7:27 PM ZmnSCPxj <ZmnSCPxj@protonmail.com> wrote:
> > - Re-vaulting transaction. This is where the magic happens. The
> re-vaulting
> > transaction is signed during transaction tree setup, before
> constructing the
> > delayed-spend transaction for the parent vault. The re-vaulting
> transaction is
> > broadcasted when someone wants to prevent a coin withdrawal during
> the public
> > observation delay period. The re-vaulting transaction spends the
> delayed-spend
> > transaction outputs. It has a single output with a script created by
> running
> > the entire vault setup function again. Hence, when the re-vaulting
> transaction
> > is confirmed, all of the coins go back into a new
> identically-configured vault
> > instead of being relinquished through the delayed-spend transaction
> timeout for
> > hot wallet key signing.
>
> As transactions need to be signed in reverse order, it seems to me that
> there is a practical limit in the number of times a vault can be used.
> Basically, the number of times we run the vault setup function is the
> limit on number of re-vaultings possible.
>
> Is my understanding correct?
>
Yes, that is correct. When setting up the vault, plan it "all the way to
the end" like next 100+ years. With exponential backoff on the relative
timelock values, the total number of pre-signed transactions isn't really
that high. With a few thousand pre-signed transactions (more than enough),
you can have high resolution timelocks well into the future.
On Wed, Aug 7, 2019 at 4:19 PM Dustin Dettmer <dustinpaystaxes@gmail.com>
wrote:
> Does revaulting vault up with the same keys, or new ones?
> Are they new derivation paths on the same key?
>
Honestly, no idea. The answer to that might depend on each individual vault
user. If the user doesn't want to deal with the expense of managing a bunch
of unique keys and other data, then it might make more sense to use the
same values and have a small blob that has to be stored for a long time,
rather than many different blobs stored in different places to deal with.
- Bryan
http://heybryan.org/
[-- Attachment #2: Type: text/html, Size: 2978 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bitcoin-dev] Single-use-Seal Implementation
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
2019-08-07 20:32 ` Bryan Bishop
2019-08-08 0:27 ` ZmnSCPxj
@ 2019-08-12 14:40 ` Peter Todd
2019-08-12 15:01 ` [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Peter Todd
2019-08-13 2:44 ` Praveen Baratam
4 siblings, 0 replies; 12+ messages in thread
From: Peter Todd @ 2019-08-12 14:40 UTC (permalink / raw)
To: Bryan Bishop, Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
On Wed, Aug 07, 2019 at 08:48:06AM -0500, Bryan Bishop via bitcoin-dev wrote:
> Single-use seals
> ================
>
> This proposal may have inadvertedly demonstrated a practical way to implement
> Peter Todd's single-use seals concept [4]. I am hesitant to say so, though,
> because I think he would ask for a more sophisticated way to verify seal
> closure.
I'm not sure what you're getting at here; single-use-seals are really boring
and simple. To recap, they're akin to a pubkey that has the "magical" property
that it can only be signed once. This of course is impossible with math alone,
but can be implemented with beyond-math mechanisms like trust or PoW (physics).
Thus you have a globally unique seal, which can be closed over a message,
producing a witness attesting to the fact that the seal was closed over that
message. A single-use-seal protocol is secure if it is impossible (in your
chosen security model) to trick the validation function into thinking a single
seal was closed over two different messages.
The obvious implementation with Bitcoin is to define the seal to be a specified
txout, and the witness to be a transaction (and lite client proof) that spends
that txout in a transation with an OP_RETURN output committing to the hash of
the message as the first output. A fancier implementation could use a
pay-to-pubkey-style commitment (RGB¹ uses something along these lines).
For applications requiring a chain of single-use-seals, you can easily keep two
txouts for seals in your wallet, and alternate them as the chain is extended.
Do you mean to say there didn't previously exist a practical way to implement
them? Or that you've found another way? I'm curious what you mean here.
1) https://github.com/rgb-org/spec
--
https://petertodd.org 'peter'[:-1]@petertodd.org
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
` (2 preceding siblings ...)
2019-08-12 14:40 ` [bitcoin-dev] Single-use-Seal Implementation Peter Todd
@ 2019-08-12 15:01 ` Peter Todd
2019-08-13 2:09 ` Bryan Bishop
2019-08-13 2:44 ` Praveen Baratam
4 siblings, 1 reply; 12+ messages in thread
From: Peter Todd @ 2019-08-12 15:01 UTC (permalink / raw)
To: Bryan Bishop, Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 5884 bytes --]
On Wed, Aug 07, 2019 at 08:48:06AM -0500, Bryan Bishop via bitcoin-dev wrote:
> Hi,
>
> I have a proposal for implementing bitcoin vaults in a way that does not
> require any soft-forks or other software upgrades, although it could benefit
> from SIGHASH_NOINPUT which I'll describe later.
>
> I call them pre-signed vaults.
>
> Vault definition
> ================
>
> Here, a vault is defined as a transaction setup scheme that binds both the user
> and the attacker to always using a public observation and delay period before a
> weakly-secured hot key is allowed to arbitrarily spend coins. This is the same
> definition previously used[1]. During the delay period, there is an opportunity
> to initiate recovery/clawback which can either trigger deeper cold storage
> parameters or at least reset the delay period to start over again for the same
> keys.
So, I'll point out that I'd describe this a little bit differently:
The vault is a tx setup scheme that binds coins in such a way that they can
only be spent via a proof-of-publication *notification*, followed by a delay
period, during which coins can be recovered/clawed back.
The key difference being it's not important that this be a *public*
notification: that the public can see just happens to be an (unfortunate)
implementation detail. For example, you could imagine a system where the
"prepare to spend" tx is indistinguishable from any other transaction.
> One of the important components of this is the delete-the-key pre-signed
> transaction concept, where only a single transaction is (pre)signed before
> deleting the key. This is basically an emulation of a covenant and enforces a
> certain outcome.
It's important to note the reason this is possible is because any coin bound by
a convenant simply isn't a coin in the normal sense of the word, and is only
acceptable as payment directly if the receiver chooses to accept it.
To use an analogy many others have used, if you owe me $100, it's not
acceptable for you to pay me that $100 by dumping a time-locked safe on my
front lawn containing that $100 unless I've agreed to accept payment that way.
> * Nuclear abort key: Also unnecessary. This is a key for which only a single
> signed transaction will ever exist, and that single transaction will spend to a
> proof-of-burn key like 0x00. This key must be extremely secure, and if there
So to be clear, you're spending to a proof-of-burn _key_ because of the use of
adapter signatures for multisig? I'm not sure where the 0x00 is coming from
here.
Obviously normally to provably destroy coins you'd spend to an OP_RETURN
output, or if miner censorship was an issue, a pay-to-script-hash of an
OP_RETURN <nonce> script.
> Delete the key (for pre-signed transactions)
> ============================================
>
> The delete-the-key trick is simple. The idea is to pre-sign at least one
> transaction and then delete the private key, thus locking in that course of
> action.
>
> Unfortunately, delete-the-key doesn't really work for multisig scenarios
> because nobody would trust that anyone else in the scheme has actually deleted
> the secret. If they haven't deleted the secret, then they have full unilateral
> control to sign anything in that branch of the transaction tree. The only time
> that delete-the-key might be appropriate would be where the user who deletes
> the key and controls the key during the setup process is also the sole
> beneficiary of the entire setup with the multisig participants.
>
> Alternative fee rates are easier to deal with using delete-the-key, compared to
> a technique where the private key never existed which can only be used to sign
> one fee rate per public key, requiring an entirely new vault subtree for each
> alternative fee rate. With delete-the-key, the alternative fee rates are signed
> with the private key before the private key is deleted.
I think this could use a bit more analysis here: why can't delete the *keys*
work, with each party deleting a separate private key that's used in an m-of-n
fashion? So long as at least n-m+1 parties actually deleted their keys IIUC it
should be secure.
> Multisig gated by ECDSA pubkey recovery for provably-unknown keys
> =================================================================
>
> A group can participate in a multisig scheme with provably-unknown ECDSA keys.
> Instead of deleting the key, the idea is to agree on a blockheight and then
> select the blockhash (or some function of the chosen blockhash like
> H(H(H(blockhash)))) as the signature. Next, the group agrees on a transaction
> and they recover the public key from the signature using ECDSA pubkey recovery.
Could you explain in more detail why you're deriving this from a blockhash?
> Deploying exceedingly large scripts
> ===================================
>
> A brief interlude to share a somewhat obvious construction. I haven't seen this
> written down yet.
>
> Suppose there is a bitcoin script that someone is interested in using, but it
> far exceeds the size limits and sigop limits. To fix this, they would split up
> the script into usable chunks, and then use the delete-the-key mechanism (or
> the other one) to create an OR branch that is signable by a single key for
> which only a single signature is known. That new pre-signed transaction would
> spend to a script that has the output with the remainder of the script of
> interest. Re-vaulting or clawback clauses can be added to that output as well,
> but spending back to the original root script will only work by generating new
> scripts and keys (since the final hash isn't known until the whole tree is
> constructed, it's a dependency loop).
Clever!
--
https://petertodd.org 'peter'[:-1]@petertodd.org
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-12 15:01 ` [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Peter Todd
@ 2019-08-13 2:09 ` Bryan Bishop
2019-08-13 14:15 ` Peter Todd
0 siblings, 1 reply; 12+ messages in thread
From: Bryan Bishop @ 2019-08-13 2:09 UTC (permalink / raw)
To: Peter Todd, Bryan Bishop; +Cc: Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 4272 bytes --]
On Mon, Aug 12, 2019 at 10:01 AM Peter Todd <pete@petertodd.org> wrote:
> The key difference being it's not important that this be a *public*
> notification: that the public can see just happens to be an (unfortunate)
> implementation detail. For example, you could imagine a system where the
> "prepare to spend" tx is indistinguishable from any other transaction.
>
True, I did not intend for everyone to know the meaning of the observed
transaction. It turns out to not be too useful to the scheme anyway, unless
you're interested in protecting against an adversary dumb enough to tell
you he has stolen your key before spending your coins. To reiterate my
other follow-up email, the best you can do (... or the best I can do right
now) is limit losses to k% where k is selected by the user, e.g. 1 input
100 outputs each with succesively increasing timeouts allowing the rotten
non-rotated(pre-inserted) key to spend, and instant spending by a recovery
flow. Once the attacker steals any one of the k% outputs, you know to not
let the outputs timeout to that key in the future. Unfortunately, without
an opcode-style covenant, the only way to know if a stale hot key is stolen
is to observe an unexpected spend or, if you're lucky, observe an
unexpected signature otherwise unassociated with a transaction.
> > * Nuclear abort key: Also unnecessary. This is a key for which only a
> single
>
Obviously normally to provably destroy coins you'd spend to an OP_RETURN
> output, or if miner censorship was an issue, a pay-to-script-hash of an
> OP_RETURN <nonce> script.
>
Oh, right. Well, that works.
> > Delete the key (for pre-signed transactions)
> > ============================================
> >
> > The delete-the-key trick is simple. The idea is to pre-sign at least one
> > transaction and then delete the private key, thus locking in that course
> of
> > action.
> >
> > Unfortunately, delete-the-key doesn't really work for multisig scenarios
> > because nobody would trust that anyone else in the scheme has actually
> deleted
> > the secret. If they haven't deleted the secret, then they have full
> unilateral
> > control to sign anything in that branch of the transaction tree. The
> only time
> > that delete-the-key might be appropriate would be where the user who
> deletes
> > the key and controls the key during the setup process is also the sole
> > beneficiary of the entire setup with the multisig participants.
> >
> > Alternative fee rates are easier to deal with using delete-the-key,
> compared to
> > a technique where the private key never existed which can only be used
> to sign
> > one fee rate per public key, requiring an entirely new vault subtree for
> each
> > alternative fee rate. With delete-the-key, the alternative fee rates are
> signed
> > with the private key before the private key is deleted.
>
> I think this could use a bit more analysis here: why can't delete the
> *keys*
> work, with each party deleting a separate private key that's used in an
> m-of-n
> fashion? So long as at least n-m+1 parties actually deleted their keys
> IIUC it
> should be secure.
>
I was thinking about another construction where you pick a key as a group
(separate from the multisig setup) and sign with that. But in practice, as
you have pointed out, you would do the delete-the-key trick on the multisig
construction itself with each party contributing their own pubkey,
requiring 1/n honest deletes.
> > Multisig gated by ECDSA pubkey recovery for provably-unknown keys
> > =================================================================
> >
> > A group can participate in a multisig scheme with provably-unknown ECDSA
> keys.
> > Instead of deleting the key, the idea is to agree on a blockheight and
> then
> > select the blockhash (or some function of the chosen blockhash like
> > H(H(H(blockhash)))) as the signature. Next, the group agrees on a
> transaction
> > and they recover the public key from the signature using ECDSA pubkey
> recovery.
>
> Could you explain in more detail why you're deriving this from a blockhash?
>
Well you need to pick an entropy source, and I wouldn't want to tell people
to just trust the first party to tell you a good sequence of bytes.
- Bryan
http://heybryan.org/
1 512 203 0507
[-- Attachment #2: Type: text/html, Size: 5612 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-13 2:09 ` Bryan Bishop
@ 2019-08-13 14:15 ` Peter Todd
0 siblings, 0 replies; 12+ messages in thread
From: Peter Todd @ 2019-08-13 14:15 UTC (permalink / raw)
To: Bryan Bishop; +Cc: Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]
On Mon, Aug 12, 2019 at 09:09:43PM -0500, Bryan Bishop wrote:
> > > Multisig gated by ECDSA pubkey recovery for provably-unknown keys
> > > =================================================================
> > >
> > > A group can participate in a multisig scheme with provably-unknown ECDSA
> > keys.
> > > Instead of deleting the key, the idea is to agree on a blockheight and
> > then
> > > select the blockhash (or some function of the chosen blockhash like
> > > H(H(H(blockhash)))) as the signature. Next, the group agrees on a
> > transaction
> > > and they recover the public key from the signature using ECDSA pubkey
> > recovery.
> >
> > Could you explain in more detail why you're deriving this from a blockhash?
> >
>
> Well you need to pick an entropy source, and I wouldn't want to tell people
> to just trust the first party to tell you a good sequence of bytes.
But why does this specifically need to be entropy?
If I understand the scheme correctly, the important thing is for the ECDSA
private key to be unknown. Under the standard assumption that hash functions
are random oracles, hashing anything should be sufficient to create a pubkey
whose private key is unknown.
Secondly, there's probably better slightly privacy if a random nonce is chosen
(perhaps by concatenating a nonce from each party) rather than picking pubkeys
unique to this use-case.
--
https://petertodd.org 'peter'[:-1]@petertodd.org
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
` (3 preceding siblings ...)
2019-08-12 15:01 ` [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Peter Todd
@ 2019-08-13 2:44 ` Praveen Baratam
4 siblings, 0 replies; 12+ messages in thread
From: Praveen Baratam @ 2019-08-13 2:44 UTC (permalink / raw)
To: Bryan Bishop, Bitcoin Protocol Discussion
[-- Attachment #1: Type: text/plain, Size: 24479 bytes --]
Bryan,
This is very similar to *CoinVault - Secure Depository and Secure Exchange*
technologies that I have shared with you all.
ᐧ
On Wed, Aug 7, 2019 at 7:23 PM Bryan Bishop via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:
> Hi,
>
> I have a proposal for implementing bitcoin vaults in a way that does not
> require any soft-forks or other software upgrades, although it could
> benefit
> from SIGHASH_NOINPUT which I'll describe later.
>
> I call them pre-signed vaults.
>
> Vault definition
> ================
>
> Here, a vault is defined as a transaction setup scheme that binds both the
> user
> and the attacker to always using a public observation and delay period
> before a
> weakly-secured hot key is allowed to arbitrarily spend coins. This is the
> same
> definition previously used[1]. During the delay period, there is an
> opportunity
> to initiate recovery/clawback which can either trigger deeper cold storage
> parameters or at least reset the delay period to start over again for the
> same
> keys.
>
> One of the important components of this is the delete-the-key pre-signed
> transaction concept, where only a single transaction is (pre)signed before
> deleting the key. This is basically an emulation of a covenant and
> enforces a
> certain outcome.
>
> Background and motivation
> =========================
>
> I was looking at Eyal and Sirer's 2016 vaults paper [1], and I saw this
> headscratcher:
>
> > Vault transactions use a delay mechanism. We note that vault transactions
> > cannot be implemented with existing timing mechanisms such as
> > CHECKLOCKTIMEVERIFY opcode or transaction locktime.
>
> This was probably written before the introduction of
> OP_CHECKSEQUENCEVERIFY.
> Still, a viable construction would have more steps than just using OP_CSV.
> They
> were probably not thinking about what those steps might be, because in the
> context of the paper they were proposing a bitcoin vault implemented using
> recursive consensus-enforced covenants via a new opcode, which obviously
> cannot
> be deployed without an upgrade fork. Covenants have been discussed for
> years,
> but require new opcodes or other consensus-enforcement changes.
>
> Relative locktimes are useful here because there is no knowledge as to
> when the
> transactions might be broadcasted in the future. The delays need to be
> relative
> to after the transaction is included in the blockchain, not to setup
> initialization time.
>
> Also, from [2]:
>
> > We show that a [vault transaction] mechanism is currently not possible
> in all
> > cryptocurrencies [...] Bitcoin's scripting language requires support for
> > covenants.
>
> I haven't seen any previous proposal for how to implement recursive bitcoin
> vaults without a fork and without a covenant. After asking around, I am
> pretty
> sure this is somewhat novel. The closest I guess is [3].
>
> Vaults are particularly interesting as a bitcoin cold storage security
> mechanism because they enable a publicly observable delay period during
> which
> time a user could be alerted by a watchtower that a thief might be in the
> process of stealing their coins, and then the user may take some actions to
> place the coins back into the vault before the relative timelock expires.
> There
> seems to be no way to get this notification or observation period without a
> vault construction. It might have been assumed it required a covenant.
>
> Having a vault construction might go a long way to discourage would-be
> attackers, on principle that the attacker might be incapable of recovering
> their cost-of-attack because the recovery mechanism can lock up the coins
> indefinitely. Griefing or denial-of-service would still be possible, of
> course,
> but with multisig there might be some ways to put a halt to that as well.
> I am
> working under the assumption that the attacker knows that the user is a
> vault
> user.
>
> Vaults
> ======
>
> The idea is to have a sequence of pre-generated pre-signed transactions
> that
> are generated in a certain way. The basic components are a vaulting
> transaction
> that locks coins into a vault, a delayed-spend transaction which is the
> only
> way to spend from a vault, and a re-vaulting transaction which can
> recover/clawback coins from the delayed-spend transaction. The security of
> this
> scheme is enforced by pre-signing transactions and deleting private keys,
> or
> with the help of SIGHASH_NOINPUT then there's another scheme where private
> keys
> are provably never known. This enforces that there's only a specific set of
> possible outcomes at every step of the vault.
>
> Some examples of what the set of broadcasted transactions might look like
> in
> regular usage:
>
> coins -> VT -> DST -> exit via hot wallet key
> coins -> VT -> DST -> RVT
> coins -> VT -> DST -> RVT -> DST -> ...
> coins -> VT -> ... -> RVT998 -> nuclear abort
>
> where:
> VT = vault transaction
> DST = delayed-spend transaction
> RVT = re-vaulting transaction
>
> The delayed-spending transaction would have a single output with a script
> like:
> (
> 30 days AND hot wallet key
> OR 10 days AND re-vaulting public key
> OR 1 day AND 4-of-7 multisig
> OR 0 days and super-secure nuclear abort ragequit key
> )
>
> Another diagram:
>
> VT_100 -> DST -> (optionally) RVT -> coins are now in VT_99
> VT_99 -> DST -> (optionally) RVT -> coins are now in VT_98
> ...
> VT_1 -> burn-all-coins nuclear abort ragequit (final)
>
> Definitions
> ===========
>
> Transactions and components:
>
> * Commitment/funding vault setup transaction. Signed after setting up the
> transaction tree, and it is broadcasted whenever funds are to be placed
> into
> the vault.
>
> * Delayed-spend transaction. Signed during the vault transaction tree
> setup,
> and it is broadcasted when the user wants to withdraw coins from cold
> storage
> or otherwise manipulate the coins. The output script template used by the
> delayed-spend transaction was defined earlier.
>
> * Hot wallet key: Somewhat insecure key. This can also be multisig using
> multiple hot keys.
>
> * Re-vaulting key: It is important to note that the private key either
> never
> existed (SIGHASH_NOINPUT + P2WPK for the re-vaulting transaction) or the
> private key was deleted after pre-signing the re-vaulting transaction.
>
> * 4-of-7 multisig: This is a group of differently-motivated individuals
> who are
> responsible for signing transactions. This multisig group is not necessry
> to
> describe the technique, I just think it's a useful feature for a vault to
> include.
>
> * Nuclear abort key: Also unnecessary. This is a key for which only a
> single
> signed transaction will ever exist, and that single transaction will spend
> to a
> proof-of-burn key like 0x00. This key must be extremely secure, and if
> there
> is any doubt about the ability to keep such a key secured, then it is
> better to
> not include this in the protocol. Alternatively, maybe include it as an
> option
> 50 layers down in the revaulting sequence.
>
> * Nuclear-abort pre-signed transaction. This is signed during transaction
> tree
> setup, before constructing the delayed-spend transaction. It is broadcasted
> only if the user wants to provably relinquish coins forever without giving
> the
> attacker any coins.
>
> * Re-vaulting transaction. This is where the magic happens. The re-vaulting
> transaction is signed during transaction tree setup, before constructing
> the
> delayed-spend transaction for the parent vault. The re-vaulting
> transaction is
> broadcasted when someone wants to prevent a coin withdrawal during the
> public
> observation delay period. The re-vaulting transaction spends the
> delayed-spend
> transaction outputs. It has a single output with a script created by
> running
> the entire vault setup function again. Hence, when the re-vaulting
> transaction
> is confirmed, all of the coins go back into a new identically-configured
> vault
> instead of being relinquished through the delayed-spend transaction
> timeout for
> hot wallet key signing.
>
> * Special case: final transaction. This is the very first pre-signed
> transaction during setup, and the transaction spends the coins using any
> provable burn technique. This is broadcasted only at the end of the game,
> as an
> ultimate abort and forfeiture of coins without giving in to an adversary.
> It's
> similar to the nuclear-abort ragequit transaction but it sits at the same
> place
> that a delayed-spend transaction would, at the very end of the rainbow or
> yellow brick road.
>
> Example log during vault setup
> ==============================
>
> When running the recursive vault setup function, the created artifacts (in
> order) will look like:
>
> 1) choose one of:
> (first iteration) pre-signed burn-all-coins nuclear abort ragequit
> (final)
> (all others) a new vault setup transaction spendable only by its
> delayed-spend transaction
>
> 2) pre-signed re-vaulting transaction sending to vault setup or final
> transaction, with a unique private key
>
> 3) pre-signed delayed-spend transaction, with a unique private key
>
> 4) vault transaction spendable only by the delayed-spend public key
>
> Pseudocode
> ==========
>
> In pseudocode (where PTX is a pre-signed transaction function with
> private key deletion):
>
> VT(counter, *args, **kwargs) =
> if counter == 0:
> DST = PTX("burn-all-coins")
> else:
> next_vault = VT(counter-1, *args, **kwargs)
> revaulting = PTX("only spendable by next_vault public key")
> DST = PTX("DST policy including revaulting and other
> conditions")
> vault = PTX("spendable only by this DST")
> return vault
>
> Pre-signed transactions
> =======================
>
> What has been known for a while is that a covenant can be somewhat emulated
> using a pre-signed transaction where the user then deletes the private key,
> enforcing that the user's chosen policy must be enforced since there is
> only
> one existing option and there will only ever be one option.
>
> Such a scheme has been previously described for simple one-time and chained
> vaults [3]. I have learned that the author has an implementation that is in
> preparation, for a non-recursive version.
>
> Note that a series of pre-signed transactions can be considered to be an
> emulation of a covenant. Imagine a linear chain of pre-signed transactions
> where each hop has a relative locktime before being able to broadcast the
> next
> transaction. To recover the coins at the end of the rainbow, one would
> need to
> broadcast each sequential transaction in order and wait for the relative
> timelocks to expire each time. Here, covenants provide something like an
> undo
> for bitcoin, but only between pre-determined addresses and scripts.
>
> Fees for pre-signed transactions
> ================================
>
> There's a few different techniques to talk about:
>
> 1) SIGHASH_SINGLE|SIGHASH_ANYONECANPAY to let someone add inputs and
> outputs.
> This can get pretty complex though.
>
> 2) Add a zero-value OP_TRUE output and let anyone spend the zero-value
> output
> and attach a child-pays-for-parent (CPFP) transaction to pay for
> everything.
>
> 3) Pre-sign a variety of different possible fee rates. Unfortunately this
> involves an explosive blow-up in the amount of transaction data to
> generate. It
> might actually be a reasonable blow-up amount, only resulting in a few
> hundred
> megabytes of additional data. But given the other options, this is
> unnecessary.
>
> Delete the key (for pre-signed transactions)
> ============================================
>
> The delete-the-key trick is simple. The idea is to pre-sign at least one
> transaction and then delete the private key, thus locking in that course of
> action.
>
> Unfortunately, delete-the-key doesn't really work for multisig scenarios
> because nobody would trust that anyone else in the scheme has actually
> deleted
> the secret. If they haven't deleted the secret, then they have full
> unilateral
> control to sign anything in that branch of the transaction tree. The only
> time
> that delete-the-key might be appropriate would be where the user who
> deletes
> the key and controls the key during the setup process is also the sole
> beneficiary of the entire setup with the multisig participants.
>
> Alternative fee rates are easier to deal with using delete-the-key,
> compared to
> a technique where the private key never existed which can only be used to
> sign
> one fee rate per public key, requiring an entirely new vault subtree for
> each
> alternative fee rate. With delete-the-key, the alternative fee rates are
> signed
> with the private key before the private key is deleted.
>
> Multisig gated by ECDSA pubkey recovery for provably-unknown keys
> =================================================================
>
> A group can participate in a multisig scheme with provably-unknown ECDSA
> keys.
> Instead of deleting the key, the idea is to agree on a blockheight and then
> select the blockhash (or some function of the chosen blockhash like
> H(H(H(blockhash)))) as the signature. Next, the group agrees on a
> transaction
> and they recover the public key from the signature using ECDSA pubkey
> recovery.
> A pre-signed transaction is created, which will trigger the start of the
> public
> observation period described earlier and also start the clock for the
> bip112
> relative timelock on its output. In the output script, an OR branch
> is added that enables the use of a re-vaulting key which could also be its
> own
> separate multisig construction.
>
> This is incompatible with P2WPKH because the P2WPKH spending scriptSig
> needs to
> have the pubkey (to check the hash of the pubkey against the pubkeyhash in
> the
> scriptPubKey), which in turn makes it incompatible with ECDSA pubkey
> recovery
> which requires a hash of the message. However, with P2WPK and
> SIGHASH_NOINPUT
> instead of P2WPKH it could conceivably work. SIGHASH_NOINPUT is required
> because
> otherwise the input includes a txid which references the public key. With
> P2WPK,
> the scriptSig only needs a signature and not a public key. Note that what
> would
> be required is a version of SIGHASH_NOINPUT that does not commit to the
> public
> key, and I think a few of the NOINPUT proposals are committing to the
> public
> key.
>
> Alternatively, there may be some constructions using the 2-party ECDSA
> techniques or m-n party ECDSA techniques.
>
> Deploying exceedingly large scripts
> ===================================
>
> A brief interlude to share a somewhat obvious construction. I haven't seen
> this
> written down yet.
>
> Suppose there is a bitcoin script that someone is interested in using, but
> it
> far exceeds the size limits and sigop limits. To fix this, they would
> split up
> the script into usable chunks, and then use the delete-the-key mechanism
> (or
> the other one) to create an OR branch that is signable by a single key for
> which only a single signature is known. That new pre-signed transaction
> would
> spend to a script that has the output with the remainder of the script of
> interest. Re-vaulting or clawback clauses can be added to that output as
> well,
> but spending back to the original root script will only work by generating
> new
> scripts and keys (since the final hash isn't known until the whole tree is
> constructed, it's a dependency loop).
>
> Recursively-enforced multi-party multisig bitcoin vaults
> ========================================================
>
> Ideally, to enforce a covenant with impossible fairy dust magic, we would
> ask
> for a bitcoin transaction that could be self-referential because the
> only-one-signature-ever trick requires that the signed message be known
> before
> producing the signature, and the signature has to be known before the
> public
> key can be known, and the public key would have to be included in the
> self-referential message/transaction hash value. So, that's a dependency
> loop
> and it doesn't work. It would be interesting to explore a variation of this
> idea with masking, such that a value X can be replaced by a hash over the
> whole
> script with the X value, even though the real script will have the hash.
> Someone else can figure that one out for me :-).
>
> Instead of the self-referential values attempting to reference the same
> script that is in the process of being constructed, an alternative is to
> use
> the same script template but populate it with different parameters. The
> script
> template gets reused over and over again, all the way down the tree, until
> the
> final transaction which could be >100 years into the future once done
> adding up
> all the relative locktimes. In fact, to create and populate this terrifying
> recursive script tree, the final transaction needs to be created first, and
> then it is given as input to the script template function and that output
> is
> then given to the script template function itself-- and so on. At each
> stage,
> there are additional pre-signed transactions and values to remember.
>
> This can be written as:
>
> final_transaction = TX(spend to 0x0000 to burn the coins)
> initial_transaction = F(F(...F(final_transaction))
>
> (This is missing parameters to indicate to the function what the
> spending
> keys requirements are to be.)
>
> See earlier explanation for more details.
>
> Each call to the template populating function produces values that each
> must be
> preserved for a very long time. It is less safe to store all of the
> pre-signed
> transactions together at the same time, but more convenient. With less
> redundancy, there is an increased chance of losing data over time, which
> could
> render the coins completely frozen. This doesn't particularly worry me
> because
> forgetting a key has that property already, and this could be likened to
> hundreds of megabytes of extra key data or something. Unlike the much
> smaller
> covenant-based (opcode-based covenant) vault construction, the multiple
> layers
> here can be separately stored and protected, which might be able to protect
> against an adversary that has stolen some of the re-vaulting keys but not
> all
> of them.
>
> Optimizations can be made to store parameters for generating the remainder
> of
> the tree, such as using deterministic key derivation, such that megabytes
> of
> data wouldn't need to be long-term stored. Only the initial parameters
> would
> need to be stored.
>
> Financial privacy for custody
> =============================
>
> One of the concerns raised in [2] is that if all coins at an exchange are
> stored together in the same vault, then attackers would be able to learn
> about
> access control policies by observing scripts and keys. Some privacy can be
> recovered by using segregated vaults, at the cost of additional setup
> complexity and keeping more data in long-term storage.
>
> However, note that I think vaults are also useful for personal cold storage
> solutions.
>
> Fail-deadly mechanism
> =====================
>
> An early nuclear abort option can be added to these scripts. This idea was
> explored in [2]. This would be a very cold very secret key that would
> abort the
> re-vaulting procedure and send all coins to a (provably) nonsense key. This
> allows a vault user to destroy the coins instead of continuously
> monitoring the
> bitcoin blockchain for the rest of his life. The attacker can't recover
> their
> cost of attack if they never get the coins, and this eliminates an entire
> class
> of potential attackers who are directly interested only in financial gain.
> The
> disadvantage is that if the attacker finds the secret key for the
> fail-deadly
> mechanism and uses it, then all of the coins are gone forever.
>
> Multisig variations
> ===================
>
> The re-vaulting key could be the same key at each layer, or only sometimes
> the
> same key, or always a unique key stored separately in another secure
> location.
>
> Additionally, these re-vaulting keys could be subjected to multisig
> schemes, as
> well as Shamir secret sharing schemes or other secret sharing schemes.
>
> The idea of adding the 4-of-7 multisig component is to avoid griefing
> situations, at the cost of the additional security requirements for the
> 4-of-7
> multisig group.
>
> Key rotation for vaults
> =======================
>
> Keeping the same hot wallet key for 100 years is not advisable. Rotate the
> keys
> by setting up a new vault construction and initiating a withdrawal
> transaction
> from the old vault to the new vault.
>
> Single-use seals
> ================
>
> This proposal may have inadvertedly demonstrated a practical way to
> implement
> Peter Todd's single-use seals concept [4]. I am hesitant to say so, though,
> because I think he would ask for a more sophisticated way to verify seal
> closure.
>
> Paid defection
> ==============
>
> It might be advisable to add small rewards for evidence of defection
> amongst
> multiparty multisig setups. Besides amounts spendable by individual keys
> from a
> multisig setup, it may be possible to use a zero-knowledge contingent
> payment
> for a zero-knowledge statement like: I have a signature s over some
> message m
> which validates for pubkey pk where pk is a member of the multisig group.
> Then
> the zkcp transaction would pay for knowledge of defectors. The zkcp
> procedure
> would require interaction with the defector, while the direct pubkey method
> would not. This is similar to companies paying employees to quit when they
> value the payment over the value of continued employment.
>
> Handling change
> ===============
>
> It is important to note that this vault setup is one-time and once-only.
> There
> must only ever be one deposit into one vault. Also, spending some coins
> would
> require sending the change amount back into a new vault. Alternatively,
> upfront work can be done to set a regular withdrawal stipend or assumption
> about how many coins are left, such that the transaction tree can be
> pre-generated for those possibilities, hence cutting down on future vault
> reinitializations. It would also be possible to commit upfront to only ever
> working in some minimum increment number of bitcoin or something.
>
> It is very important to only fund the vault once, and only with the amount
> that
> was configured when setting up the vault.
>
> References
> ==========
>
> [1] https://fc16.ifca.ai/bitcoin/papers/MES16.pdf
>
> [2]
> http://www0.cs.ucl.ac.uk/staff/P.McCorry/preventing-cryptocurrency-exchange.pdf
>
> [3]
> http://web.archive.org/web/20180503151920/https://blog.sldx.com/re-imagining-cold-storage-with-timelocks-1f293bfe421f?gi=da99a4a00f67
>
> [4]
> https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015350.html
> or
> https://diyhpl.us/wiki/transcripts/building-on-bitcoin/2018/single-use-seals/
> or https://petertodd.org/2016/closed-seal-sets-and-truth-lists-for-privacy
>
> Acknowledgements
> ================
>
> * Jeremy Rubin for pointing out something embarrassingly broken in an
> earlier
> draft.
>
> * Bob McElrath for telling me to use SIGHASH_NOINPUT which I proceeded to
> promptly forget about.
>
> * Andrew Poelstra for the OP_TRUE trick.
>
> * Joe Rayhawk for paid defection.
>
> * Tadge Dryja for pointing out a few differences between SIGHASH_NOINPUT
> proposals.
>
>
>
> Thank you,
>
> - Bryan
> http://heybryan.org/
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
--
Dr. Praveen Baratam
about.me <http://about.me/praveen.baratam>
[-- Attachment #2: Type: text/html, Size: 27544 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2019-08-13 14:15 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 13:48 [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Bryan Bishop
2019-08-07 20:32 ` Bryan Bishop
2019-08-07 21:19 ` Dustin Dettmer
2019-08-08 2:09 ` Sergio Demian Lerner
2019-08-08 3:03 ` ZmnSCPxj
2019-08-08 0:27 ` ZmnSCPxj
2019-08-08 1:16 ` Bryan Bishop
2019-08-12 14:40 ` [bitcoin-dev] Single-use-Seal Implementation Peter Todd
2019-08-12 15:01 ` [bitcoin-dev] Bitcoin vaults with anti-theft recovery/clawback mechanisms Peter Todd
2019-08-13 2:09 ` Bryan Bishop
2019-08-13 14:15 ` Peter Todd
2019-08-13 2:44 ` Praveen Baratam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox