Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: cellard on October 05, 2018, 07:47:50 PM



Title: Signing a sum of bitcoin
Post by: cellard on October 05, 2018, 07:47:50 PM
Is it possible to somehow get a sum of a bunch of different inputs and then generate a single resulting signature that could prove you own for instance 1 BTC? Or it's impossible and you must go through the hassle of signing a bunch of different inputs that make a sum of 1 BTC and the person must manually verify and sum it all? This beside being annoying and slow, goes against your privacy interests as you show a ton of different inputs.

Ideally, it would be cool to do it with a single click. If the wallet contains +1 BTC, then generate a single hash that proves this somehow. For example I like to think that in 2030 or so, there will be clubs in which you cannot access if you don't own 1+ BTC, then you bring this signature with you like a VIP pass, bouncer verifies it and you are in. I think this may be impossible but just asking if it could somehow be made.


Title: Re: Signing a sum of bitcoin
Post by: HCP on October 05, 2018, 10:02:58 PM
This BIP seems like it might be addressing this general scenario amongst several others: https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki#Multiple_Proofs

However, it seems that it will still "expose" all the UTXOs required to make up the sum, as opposed to just proving a sum total.


Title: Re: Signing a sum of bitcoin
Post by: Thirdspace on October 05, 2018, 10:29:26 PM
Is it possible to somehow get a sum of a bunch of different inputs and then generate a single resulting signature that could prove you own for instance 1 BTC?
I don't think it is possible because signing requires a private key of a public address
so even if there is a way to sign sum of multi inputs, to verify it people will (need to) know all input addresses
why didn't you consolidate your utxo and have your bitcoin in one address?


Title: Re: Signing a sum of bitcoin
Post by: cellard on October 06, 2018, 01:06:15 AM
Is it possible to somehow get a sum of a bunch of different inputs and then generate a single resulting signature that could prove you own for instance 1 BTC?
I don't think it is possible because signing requires a private key of a public address
so even if there is a way to sign sum of multi inputs, to verify it people will (need to) know all input addresses
why didn't you consolidate your utxo and have your bitcoin in one address?

This would require you to spend money into fees to do that. While it may be affordable now, it may not be economically sound in the future, just to present some cryptographic proof, unless you really need to. Also like I said before, consolidating it all into a single address can break privacy sometimes.


Title: Re: Signing a sum of bitcoin
Post by: Coding Enthusiast on October 06, 2018, 04:05:10 AM
If you want to define something that does not exist then you also have to define a standard for it too. For example in this case you can define it like this:
1. Append all the transaction outputs you want to sign together. (Lets assume it is 5 UTXO belonging to 3 keys). Put transactions that belong to one key together and the order is important.
Code:
[Tx1_key1][Tx2_key1][Tx3_key2][Tx4_key3][Tx5_key3]
Perform a SHA256 on the whole thing to make it 32 bytes.
2. Sign with key1, key2, key3 and then concatenate 3 resulting signatures together. You can DER encode it if you like:
Code:
[Seq][size]
  [Seq][size][int][size][r][int][size][s]
  [Seq][size][int][size][r][int][size][s]
  [Seq][size][int][size][r][int][size][s]
* Seq and int are DER flags.
** There is an additional part in signatures for recovering public key that I am not familiar with yet but assume we added that to the signature :P


Title: Re: Signing a sum of bitcoin
Post by: bones261 on October 06, 2018, 03:35:26 PM
Won't Schnorr signatures pave the way to make this possible? (When and if it gets integrated.)