Bitcoin Forum
November 13, 2024, 05:51:03 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Effect of different hashtypes  (Read 629 times)
jl2012 (OP)
Legendary
*
Offline Offline

Activity: 1792
Merit: 1111


View Profile
July 12, 2013, 04:28:26 PM
 #1

I would like to clarify the meaning of different hashtypes:

SIGHASH_ALL: All inputs and outputs are required.

SIGHASH_ALL + SIGHASH_ANYONECANPAY: All outputs are required. I don't care where the rest of bitcoins come from.

SIGHASH_NONE: All inputs are required. I don't care where the bitcoins go.

SIGHASH_NONE + SIGHASH_ANYONECANPAY: I don't care where the rest of bitcoins come from. I don't care where the bitcoins go. Basically throwing the coins away without any condition.

SIGHASH_SINGLE: All inputs are required. As long as one particular output is satisfied, I don't care where the rest of bitcoins go.

SIGHASH_SINGLE + SIGHASH_ANYONECANPAY: I don't care where the rest of bitcoins come from. As long as one particular output is satisfied, I don't care where the rest of bitcoins go.

Am I correct?

How is the particular output in SIGHASH_SINGLE specified? I don't understand the description in bitcoin wiki ( https://en.bitcoin.it/wiki/OP_CHECKSIG#Procedure_for_Hashtype_SIGHASH_SINGLE )

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
blueadept
Full Member
***
Offline Offline

Activity: 225
Merit: 101


View Profile
July 12, 2013, 04:35:14 PM
 #2

As I understand it, a) you're correct and b) the number of the output is the same as the number of the input when using SIGHASH_SINGLE.  So if your input is at position 0, the output you'd be including in the transaction hash would be output 0.

Like my posts?  Connect with me on LinkedIn and endorse my "Bitcoin" skill.
Decentralized, instant off-chain payments.
Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1134


View Profile
July 12, 2013, 04:47:09 PM
 #3

There's a description here:

https://en.bitcoin.it/wiki/Contracts
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!