Author

Topic: protocol vulnerability? (Read 1180 times)

kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 04:35:08 PM
#15
Thank you guys.
I realized my mistake. Your links are very useful for me. Sorry for my English ))
legendary
Activity: 3472
Merit: 4801
April 08, 2016, 02:47:15 PM
#14
If you had read the paragraph after the picture, you would have known that there is more signed than just the scriptPubKey...

Quote
As illustrated above, the data that gets signed includes the txid and vout from the previous transaction. That information is included in the createrawtransaction raw transaction. But the data that gets signed also includes the pubkey script from the previous transaction, even though it doesn’t appear in either the unsigned or signed transaction.

He's concerned that the signature doesn't cover the output of the current transaction

Certainly, but he said it "seems that signed only scriptPubKey", and clearly that isn't true.  Therefore, it should be obvious to him, from reading the paragraph below the drawing, that he misunderstood the drawing.

See all those arrows passing through the "Signed Data" box?  That means all those fields are included in what gets signed.
I readed this.
ONLY data from the PREVIOUS transaction is signed!
Data in CURRENT transaction is not signet and not protected from changing.
Right?

No.  That is not right.

I can't tell if you are failing to pay attention, or if you are just trolling.

With sighash all, all of the data in the current transaction, except for the signature itself, is signed. This prevents any transaction data from being changed.

Which has already been explained 3 times, and several links have been included to provide additional details for better understanding.

I'm beginning to think we are being trolled.

NO! With sighash all, all of the data in the current transaction, except for the signature itself, is signed. This prevents any transaction data from being changed.

Where this wrote? Give me please link to any document or source code?
[/quote]

You have been provided several links.

The source code is in github.  Here:
https://github.com/bitcoin/bitcoin

Now i can see only
Quote
includes the txid and vout from the previous transaction
and
Quote
also includes the pubkey script from the previous transaction

If that's all you can see in this whole thread, then you are only looking for things that you can take out of context to create confusion.  I'm nearly certain you are just trolling now.

He's been told that the entire transaction is signed multiple times.  He's been supplied with links with additional details about what is signed.  And yet, he carefully searches through posts and links looking for small pieces that he can take out of context and then exclaim that only the inputs are signed.  Nonsense.
staff
Activity: 3458
Merit: 6793
Just writing some code
April 08, 2016, 09:48:08 AM
#13

I readed this.
ONLY data from the PREVIOUS transaction is signed!
Data in CURRENT transaction is not signet and not protected from changing.
Right?

NO! With sighash all, all of the data in the current transaction, except for the signature itself, is signed. This prevents any transaction data from being changed.

Where this wrote? Give me please link to any document or source code?

Now i can see only
Quote
includes the txid and vout from the previous transaction
and
Quote
also includes the pubkey script from the previous transaction

See https://bitcoin.org/en/developer-guide#signature-hash-types

It's also in the source somewhere.
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 09:31:54 AM
#12

I readed this.
ONLY data from the PREVIOUS transaction is signed!
Data in CURRENT transaction is not signet and not protected from changing.
Right?

NO! With sighash all, all of the data in the current transaction, except for the signature itself, is signed. This prevents any transaction data from being changed.

Where this wrote? Give me please link to any document or source code?

Now i can see only
Quote
includes the txid and vout from the previous transaction
and
Quote
also includes the pubkey script from the previous transaction
staff
Activity: 3458
Merit: 6793
Just writing some code
April 08, 2016, 09:23:52 AM
#11

I readed this.
ONLY data from the PREVIOUS transaction is signed!
Data in CURRENT transaction is not signet and not protected from changing.
Right?

NO! With sighash all, all of the data in the current transaction, except for the signature itself, is signed. This prevents any transaction data from being changed.
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 09:18:16 AM
#10
Picture from https://bitcoin.org/en/developer-examples#offline-signing

- snip -

It seems that signed only scriptPubKey for the previous transaction.
"PubKey Script" for the new transaction is not signed and new transaction is not signed too! So anyone may change scriptPubKey for unconfirmed transaction.  Sad

Nope.

See all those arrows passing through the "Signed Data" box?  That means all those fields are included in what gets signed.

If you had read the paragraph after the picture, you would have known that there is more signed than just the scriptPubKey...

Quote
As illustrated above, the data that gets signed includes the txid and vout from the previous transaction. That information is included in the createrawtransaction raw transaction. But the data that gets signed also includes the pubkey script from the previous transaction, even though it doesn’t appear in either the unsigned or signed transaction.


I readed this.
ONLY data from the PREVIOUS transaction is signed!
Data in CURRENT transaction is not signet and not protected from changing.
Right?
sr. member
Activity: 467
Merit: 267
April 08, 2016, 09:16:55 AM
#9
If you had read the paragraph after the picture, you would have known that there is more signed than just the scriptPubKey...

Quote
As illustrated above, the data that gets signed includes the txid and vout from the previous transaction. That information is included in the createrawtransaction raw transaction. But the data that gets signed also includes the pubkey script from the previous transaction, even though it doesn’t appear in either the unsigned or signed transaction.


He's concerned that the signature doesn't cover the output of the current transaction - which it does for all signature types besides SIGHASH_NONE.

To be honest, I don't understand this drawing either. This explanation works better for me.

https://en.bitcoin.it/wiki/OP_CHECKSIG


legendary
Activity: 3472
Merit: 4801
April 08, 2016, 09:09:08 AM
#8
Picture from https://bitcoin.org/en/developer-examples#offline-signing

- snip -

It seems that signed only scriptPubKey for the previous transaction.
"PubKey Script" for the new transaction is not signed and new transaction is not signed too! So anyone may change scriptPubKey for unconfirmed transaction.  Sad

Nope.

See all those arrows passing through the "Signed Data" box?  That means all those fields are included in what gets signed.

If you had read the paragraph after the picture, you would have known that there is more signed than just the scriptPubKey...

Quote
As illustrated above, the data that gets signed includes the txid and vout from the previous transaction. That information is included in the createrawtransaction raw transaction. But the data that gets signed also includes the pubkey script from the previous transaction, even though it doesn’t appear in either the unsigned or signed transaction.
staff
Activity: 3458
Merit: 6793
Just writing some code
April 08, 2016, 08:39:19 AM
#7

Picture from https://bitcoin.org/en/developer-examples#offline-signing

-snip img-

It seems that signed only scriptPubKey for the previous transaction.
"PubKey Script" for the new transaction is not signed and new transaction is not signed too! So anyone may change scriptPubKey for unconfirmed transaction.  Sad
Nope. Read all of https://bitcoin.org/en/developer-guide#transactions
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 08:24:47 AM
#6
Nope, not possible. The scriptsig, if using sighash all (the default), is a signature of the hash of the transaction. If part of the transaction is changed, the hash will no longer match and thus the signature will no longer be valid and thus the transaction ID invalid.

Thank you for responce.
Is there any documentation how "scriptSig" is constructing for given transaction?
There is probably something about it on https://bitcoin.org/en/developer-documentation. Otherwise you can look in the code.
[/quote]

Picture from https://bitcoin.org/en/developer-examples#offline-signing



It seems that signed only scriptPubKey for the previous transaction.
"PubKey Script" for the new transaction is not signed and new transaction is not signed too! So anyone may change scriptPubKey for unconfirmed transaction.  Sad
legendary
Activity: 3472
Merit: 4801
staff
Activity: 3458
Merit: 6793
Just writing some code
April 08, 2016, 07:44:41 AM
#4
Nope, not possible. The scriptsig, if using sighash all (the default), is a signature of the hash of the transaction. If part of the transaction is changed, the hash will no longer match and thus the signature will no longer be valid and thus the transaction ID invalid.

Thank you for responce.
Is there any documentation how "scriptSig" is constructing for given transaction?
[/quote]
There is probably something about it on https://bitcoin.org/en/developer-documentation. Otherwise you can look in the code.
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 07:04:16 AM
#3
Hi,
I'm learning the basics of Bitcoin protocol and have a question.

When i push raw transaction to the network, all nodes may read it for checking...

If some "bad-hacker" node will save my "scriptSig" for transaction inputs, but will change my "scriptPubKey" for outputs. Then the scammer may send a fake transaction to other nodes and there's a possibility to lose my money?


Nope, not possible. The scriptsig, if using sighash all (the default), is a signature of the hash of the transaction. If part of the transaction is changed, the hash will no longer match and thus the signature will no longer be valid and thus the transaction ID invalid.

Thank you for responce.
Is there any documentation how "scriptSig" is constructing for given transaction?
staff
Activity: 3458
Merit: 6793
Just writing some code
April 08, 2016, 06:41:05 AM
#2
Hi,
I'm learning the basics of Bitcoin protocol and have a question.

When i push raw transaction to the network, all nodes may read it for checking...

If some "bad-hacker" node will save my "scriptSig" for transaction inputs, but will change my "scriptPubKey" for outputs. Then the scammer may send a fake transaction to other nodes and there's a possibility to lose my money?


Nope, not possible. The scriptsig, if using sighash all (the default), is a signature of the hash of the transaction. If part of the transaction is changed, the hash will no longer match and thus the signature will no longer be valid and thus the transaction ID invalid.
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
April 08, 2016, 03:44:41 AM
#1
Hi,
I'm learning the basics of Bitcoin protocol and have a question.

When i push raw transaction to the network, all nodes may read it for checking...

If some "bad-hacker" node will save my "scriptSig" for transaction inputs, but will change my "scriptPubKey" for outputs. Then the scammer may send a fake transaction to other nodes and there's a possibility to lose my money?

Jump to: