<blockquote>
  <p>Therefore, I am not quite understand why we need to save</p>
</blockquote>

<p>Because scripting system allows more possibilities. <a href="https://en.bitcoin.it/wiki/Script#Scripts" rel="nofollow">https://en.bitcoin.it/wiki/Script#Scripts</a></p>

CC BY-SA 3.0
2016-01-15T03:25:55.290Z
Why Bitcoin need to provide that kind of the flexible, but use some enum to restrict the possible transaction type.
Carpemer
CC BY-SA 3.0
2016-01-14T19:07:39.953Z
2016-01-14T19:07:39.953Z
amaclin
<p>I am not fully understanding the design purpose of the scriptPubKey in the <a href="https://en.bitcoin.it/wiki/Transaction" rel="nofollow">transaction output</a>.</p>

<p>I think the tx's (say tx1 here) output could just be the receiver's public key's hash.</p>

<p>Then when the receiver want to send the money to another one, he only needs to create the transaction tx2 (with receiver's public key and the sig of the previous transaction).</p>

<p>Then the bitcoin net work could check:</p>

<ol>
<li>Is the public hash(tx2.public_key) = t1.output.hash_public_key?</li>
<li>Verify(tx2.sign, tx2.public_key, tx1)</li>
</ol>

<p>a+b can approve that this transaction is created by the receiver.</p>

<p>Therefore, I am not quite understanding why we need to save 
OP_DUP OP_HASH160 next_receiver_public_key_hash OP_EQUALVERIFY OP_CHECKSIG
in the tx.output.</p>

<transactions><public-key><output>
Why scriptPubKey is a series of commands?
Carpemer
# Why scriptPubKey is a series of commands?

(Asked by: username_0 on 2016-01-14)

I am not fully understanding the design purpose of the scriptPubKey in the [transaction output](https://en.bitcoin.it/wiki/Transaction).

I think the tx's (say tx1 here) output could just be the receiver's public key's hash.

Then when the receiver want to send the money to another one, he only needs to create the transaction tx2 (with receiver's public key and the sig of the previous transaction).

Then the bitcoin net work could check:

1. Is the public hash(tx2.public\_key) = t1.output.hash\_public\_key?
2. Verify(tx2.sign, tx2.public\_key, tx1)

a+b can approve that this transaction is created by the receiver.

Therefore, I am not quite understanding why we need to save
OP\_DUP OP\_HASH160 next\_receiver\_public\_key\_hash OP\_EQUALVERIFY OP\_CHECKSIG
in the tx.output.

**Tags:** transactions, public-key, output


---

## 1 answers

### Answer by username_1 on 2016-01-14. Score: 3 | Accepted answer

> Therefore, I am not quite understand why we need to save

Because scripting system allows more possibilities. <https://en.bitcoin.it/wiki/Script#Scripts>

> **Comments:**
> **username_0**: Why Bitcoin need to provide that kind of the flexible, but use some enum to restrict the possible transaction type.  

---

