chaincodelabs / bitcoin-tx-tutorial

A technical tutorial for understanding how bitcoin transactions are created and signed
105 stars 42 forks source link

Clarify statement about recipient specifying scriptPubKey #21

Closed naiyoma closed 8 months ago

naiyoma commented 8 months ago

I recently started going through the tutorial, and i need clarification on whether the scriptpubkey is specified by the sender or the receiver ?

this statement in this section seems to imply that its bob specifying the scriptpubkey.

"When Alice sends Bob bitcoin, Alice does so by creating a new transaction where one (or more) of the outputs has a scriptPubKey (aka 'locking script') specified by Bob."

DariusParvin commented 8 months ago

Think of the scriptPubKey as the destination for where the output is sending bitcoin to. It is the raw/serialized version of a bitcoin address.

If we use email as an analogy for a bitcoin transaction, if I ask you to send me (Bob) an email, I need to give you my email address (scriptPubKey) so you know where to send it to (or you need to look it up somewhere). I was the one who created my email address, and that's what we mean by 'specified by Bob'.

Let me know if that's not clear. I think the text is accurate and concise but if have some suggestion for how it could be clearer feel free to open a PR :)

naiyoma commented 8 months ago

@DariusParvin thanks for the clarification, the statement is clearer now,