Bitcoin Forum
April 26, 2024, 04:29:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Using HASHSIG_NONE and HASHSIG_SINGLE  (Read 217 times)
fabbit (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
January 21, 2020, 08:05:04 AM
 #1

Which are real scenario where HASHSIG_NONE and HASHSIG_SINGLE are used?
1714105798
Hero Member
*
Offline Offline

Posts: 1714105798

View Profile Personal Message (Offline)

Ignore
1714105798
Reply with quote  #2

1714105798
Report to moderator
1714105798
Hero Member
*
Offline Offline

Posts: 1714105798

View Profile Personal Message (Offline)

Ignore
1714105798
Reply with quote  #2

1714105798
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714105798
Hero Member
*
Offline Offline

Posts: 1714105798

View Profile Personal Message (Offline)

Ignore
1714105798
Reply with quote  #2

1714105798
Report to moderator
1714105798
Hero Member
*
Offline Offline

Posts: 1714105798

View Profile Personal Message (Offline)

Ignore
1714105798
Reply with quote  #2

1714105798
Report to moderator
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
January 21, 2020, 01:13:58 PM
Merited by ABCbits (1), DdmrDdmr (1), Heisenberg_Hunter (1)
 #2

i haven't seen these in action so it is hard to say what their use cases are.

what i can think of is something like this:
imagine you were working in a company as budget manager and were only responsible for how much bitcoin is being spent not "where and how". for example you say this month we can use 1BTC out of the budget for whatever. they sent you a transaction (it needs to be multi-sig) spending 1BTC and you provide one signature with your key out of n with SIGHASH_NONE saying "i allow spending of 1BTC out of our budget (ie. the txins that the transaction has as input) but don't care where it is being spent" then the other parties that are responsible for spending  set the destination (like paying the employees each 0.01BTC) and provide at least one signature with SIGHASH_ALL.

SIGHASH_SIGNLE could be the same scenario where you say the same thing but it has an addendum "... and i want X amount be paid to this address".
for example in payment scenario, you say pay 0.5 to this address (the CEO's paycheck!) and i don't care what you do with the remaining 0.5, the accounting department sets the rest (0.01 to each employee).

There is a FOMO brewing...
fabbit (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
January 21, 2020, 08:54:11 PM
 #3

For SIGHASH_NONE I found this https://raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash

Quote
This is mostly designed to be used in scenarios where more than one party is contributing inputs. At that point, such a signature essentially means “I agree to spend my money, provided all these other people spend their’s too”. It is expected that one of the other signers will then use SIGHASH_ALL to secure all the outputs of the transaction, and send the money to a mutually agreed output set.
fabbit (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
January 30, 2020, 01:30:29 PM
 #4

then the other parties that are responsible for spending  set the destination (like paying the employees each 0.01BTC) and provide at least one signature with SIGHASH_ALL.

Hey, I didn't understand this, why other parties provide one signature with SIGHASH_ALL?
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
January 30, 2020, 01:44:53 PM
Merited by BrewMaster (1)
 #5

then the other parties that are responsible for spending  set the destination (like paying the employees each 0.01BTC) and provide at least one signature with SIGHASH_ALL.

Hey, I didn't understand this, why other parties provide one signature with SIGHASH_ALL?
To sign the outputs, hence securing the coins' destination.
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
January 30, 2020, 03:52:33 PM
Merited by Heisenberg_Hunter (1)
 #6

then the other parties that are responsible for spending  set the destination (like paying the employees each 0.01BTC) and provide at least one signature with SIGHASH_ALL.
Hey, I didn't understand this, why other parties provide one signature with SIGHASH_ALL?

as i explained when you sign with SIGHASH_NONE you are not setting any destination for the coins you are spending, as the result anybody can set the destination (output) and receive the coins. so in the scheme i outlined above, at least one of the signers has to sign everything (namely the outputs) so that they can't be changed. to sign everything you have to use SIGHASH_ALL.

There is a FOMO brewing...
fabbit (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
January 30, 2020, 05:42:55 PM
Last edit: February 01, 2020, 12:09:38 PM by fabbit
Merited by Heisenberg_Hunter (1)
 #7

Yes I understand this, but so the transaction should have at least two input, one for SIGHASH_ALL and the other for SIGHASH_NONE?
And if it is a Bob's transaction so we're talking about Bob's scriptSig, how Alice can put her sign (SIGHASH_ALL) in Bob's inputs?

I mean those kind of transactions look like as collaborative transaction because different parties are contributing in inputs and no as a standard transaction owned by a single 'people', I was reading about PSBT protocol for collaborative transactions.
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
February 01, 2020, 03:50:03 PM
 #8

Yes I understand this, but so the transaction should have at least two input, one for SIGHASH_ALL and the other for SIGHASH_NONE?
And if it is a Bob's transaction so we're talking about Bob's scriptSig, how Alice can put her sign (SIGHASH_ALL) in Bob's inputs?

the example i gave is a multi-signature output which means if it were 2 of 2 then both signature of Bob and Alice are needed and one can sign with NONE and the other with ALL.

i can not think of a safe way to make it work with anything else because the output (assuming it is NOT multi-sig) that was signed with NONE could be extracted and put in any other transaction by a thief.

There is a FOMO brewing...
fabbit (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 6


View Profile
February 01, 2020, 11:24:39 PM
 #9

Thanks for answer, I was reading about BIP-174 proposal..
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!