How bitcoin transaction fromat design can be explained?

0

Can someone clarify?

  • Why is there bitcoin address in the transaction, when the bitcoin script already contains the pubkey hash?
  • Why isn't the amount a part of the script?
  • Why does bitcoin script allow to sign only parts of the transaction?

Michael Kruglos

Posted 2018-01-16T20:07:27.760

Reputation: 101

Looking at the type of questions, one might come to the conclusion, that you have ideas behind, that are not stated. Is the“why“ just a statement for wanting to know? I feel like you seem to see additional value, if the amount would be part of the script, or the whole tax would be signed... ?pebwindkraft 2018-01-16T20:36:52.763

Answers

1

Why is there bitcoin address in the transaction, when the bitcoin script already contains the pubkey hash?

Contrary to popular belief, this is not true. Addresses are not part of transactions at all, nor are they part of the protocol. The address is only used to encode the pubkey hash or script hash which is then used to create the output script.

Why isn't the amount a part of the script?

It does not need to be. The script is a program, it does not care about the amount.

Why does bitcoin script allow to sign only parts of the transaction?

To allow for special transactions where only part of the transaction needs to be signed. This allows people to do things like anyone-can-pay transactions or for people to sign only for specific outputs created by the transaction.

Andrew Chow

Posted 2018-01-16T20:07:27.760

Reputation: 40 910

But why isn't the amount signed?Michael Kruglos 2018-01-16T20:24:57.567

The amount is signed. It's part of the transaction and the whole transaction except for the signatures themselves is signed.Andrew Chow 2018-01-16T20:30:04.630