Author

Topic: pubkeyhash vs scripthash with createrawtransaction (Read 395 times)

staff
Activity: 3374
Merit: 6530
Just writing some code
That is correct. In order to spend the coins, you need the redeem script which is the script which is hashed to create the address. It is also what the signatures are validated against in order to spend the Bitcoin at that address.
member
Activity: 65
Merit: 16
I want to create a new wallet without using the bitcoind wallet.
I have created a testnet wallet on blocktrail.com so I use
pubkeys from blocktrail and from bitcore package (node.js).

pubkey generated by bitcore:    n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu
pubkey generated by blocktrail: 2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK

my transaction: from n2e... to 2NC... change back to n2e...

When I do a createrawtransaction I have two different types of scriptPubKey:

n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu:     pubkeyhash  (bitcore)
2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK:  scripthash     (blocktrail)

My question: why I have a scripthash from blocktrail ?

What I think the answer is:
quote from blocktrail: "The BlockTrail Payment API is built using Multi-Signature HD Wallets, this means that there are 3 keys in total, 2 of which are necessary to get access to your Bitcoin!" (primary key, backup key and blocktrail key)
so instead of paying to a single pubkey, I must pay to a scripthash representing 2 out of 3 signatures.

Is it correct ? or there is another reason ?
Jump to: