<blockquote>
<p>Aren't all the transactions forced to have a destination address?</p>
</blockquote>
<p>No.</p>
<p>Transactions never contain addresses. Transaction outputs contain only a locking script and a numeric amount.</p>
<p>There are no addresses in the Bitcoin blockchain.</p>
<p>Addresses are a way for a payee to construct a barcode that can be shown to a payer, from the barcode the payer can construct a standard locking script that only the payee can unlock.</p>
<p>To spend an output as an Input in a new transaction you only have to write an unlocking script that sets up values in the stack that cause evaluation of the locking script to produce a boolean value of true.</p>
<p>It is trivial to create a locking script that always evaluates to true.I</p>
<p>See</p>
<ul>
<li><a href="https://bitcoin.stackexchange.com/q/113631/13866">In what format does a block store the transaction data?</a></li>
</ul>

CC BY-SA 4.0
2023-07-09T08:46:43.957Z
2023-07-09T08:46:43.957Z
RedGrittyBrick
<p>In Bitcoin coins are not send to addresses. Instead, coins are locked with locking scripts. You own the coins that you can unlock.</p>
<p>Addresses are how receiving wallets inform paying wallets on how they want their coins locked.</p>
<p>For example, if I'm paying you and your wallet send me this address <code>1N9Cby5NDPsLDnLnTEsYXP4eyWGrfuen7C</code> she's telling my wallet that she wants their receiving coins locked in a P2PKH (Pay to Public Key Hash) with the public key hash <code>e7e7a79d7d9d23b9dc7dcbd81fead779b2d7167d</code></p>
<p>So, my wallet will broadcast a transaction, which will unlock some previous coins I have, and lock them to the following script:</p>
<p>OP_DUP OP_HASH160 e7e7a79d7d9d23b9dc7dcbd81fead779b2d7167d OP_EQUALVERIFY OP_CHECKSIG</p>
<p>Your wallet will be pooling the mempool/blockchain waiting to see this transaction there. The second it sees it, it will tell you &quot;paid&quot; or &quot;confirmed&quot;.</p>
<p>Address prefixes indicate the type of script:</p>
<ul>
<li>starts with 1 = P2PKH</li>
<li>starts with 3 = P2SH</li>
<li>starts with bc1q = segwit</li>
<li>starts with bc1p = taproot</li>
</ul>

CC BY-SA 4.0
2023-07-10T06:57:36.320Z
2023-07-10T06:57:36.320Z
bordalix
<p>I just learned that Mike Hearn created a Bitcoin Puzzle transaction where the first person to solve its scriptPubKey, could claim that transaction's amount as a reward.</p>
<p>The thing is... Aren't all the transactions forced to have a destination address? So, even if the winner solves the scriptPubKey, how can then he/she divert the funds to another destination address?</p>

<transactions><script><utxo>
How can one make a transaction that any address can claim it just by solving the scriptPubKey?
Pedro D.
# How can one make a transaction that any address can claim it just by solving the scriptPubKey?

(Asked by: username_0 on 2023-07-09)

I just learned that Mike Hearn created a Bitcoin Puzzle transaction where the first person to solve its scriptPubKey, could claim that transaction's amount as a reward.

The thing is... Aren't all the transactions forced to have a destination address? So, even if the winner solves the scriptPubKey, how can then he/she divert the funds to another destination address?

**Tags:** transactions, script, utxo


---

## 2 answers

### Answer by username_1 on 2023-07-09. Score: 0 | Accepted answer

> Aren't all the transactions forced to have a destination address?

No.

Transactions never contain addresses. Transaction outputs contain only a locking script and a numeric amount.

There are no addresses in the Bitcoin blockchain.

Addresses are a way for a payee to construct a barcode that can be shown to a payer, from the barcode the payer can construct a standard locking script that only the payee can unlock.

To spend an output as an Input in a new transaction you only have to write an unlocking script that sets up values in the stack that cause evaluation of the locking script to produce a boolean value of true.

It is trivial to create a locking script that always evaluates to true.I

See

* [In what format does a block store the transaction data?](https://bitcoin.stackexchange.com/q/113631/13866)


---

### Answer by username_2 on 2023-07-10. Score: 1

In Bitcoin coins are not send to addresses. Instead, coins are locked with locking scripts. You own the coins that you can unlock.

Addresses are how receiving wallets inform paying wallets on how they want their coins locked.

For example, if I'm paying you and your wallet send me this address `1N9Cby5NDPsLDnLnTEsYXP4eyWGrfuen7C` she's telling my wallet that she wants their receiving coins locked in a P2PKH (Pay to Public Key Hash) with the public key hash `e7e7a79d7d9d23b9dc7dcbd81fead779b2d7167d`

So, my wallet will broadcast a transaction, which will unlock some previous coins I have, and lock them to the following script:

OP\_DUP OP\_HASH160 e7e7a79d7d9d23b9dc7dcbd81fead779b2d7167d OP\_EQUALVERIFY OP\_CHECKSIG

Your wallet will be pooling the mempool/blockchain waiting to see this transaction there. The second it sees it, it will tell you "paid" or "confirmed".

Address prefixes indicate the type of script:

* starts with 1 = P2PKH
* starts with 3 = P2SH
* starts with bc1q = segwit
* starts with bc1p = taproot


---

