Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: titeuf_87 on May 17, 2011, 11:28:36 AM



Title: Some questions about scripts
Post by: titeuf_87 on May 17, 2011, 11:28:36 AM
Hi everyone,

I've been looking at the script parts now of the Bitcoin protocol and have the following questions about it:

1) Right now there are only two (I think) different scripts whitelisted and it's not possible to do custom scripts. If a miner starts accepting transactions with non-standard scripts and creates a new block using them, will they also be accepted by the Bitcoin client?

I'm guessing they will, because the transactions being in a block already means they are valid transactions. I'm just asking for confirmation.

2) If I create a nonstandard transaction, with a valid and normal TxIn but with a special TxOut that has a script that always evaluate to true, everyone will be able to claim those bitcoins and use them for their own needs. In this situation, I'm assuming the first person that has a transaction in a valid block will be the "winner" and all the others that tried to use those coins will have their transactions never confirmed?

Thanks!
Titeuf


Title: Re: Some questions about scripts
Post by: Pieter Wuille on May 17, 2011, 11:43:07 AM
Hi everyone,

I've been looking at the script parts now of the Bitcoin protocol and have the following questions about it:

1) Right now there are only two (I think) different scripts whitelisted and it's not possible to do custom scripts. If a miner starts accepting transactions with non-standard scripts and creates a new block using them, will they also be accepted by the Bitcoin client?

I'm guessing they will, because the transactions being in a block already means they are valid transactions. I'm just asking for confirmation.

Exactly.

2) If I create a nonstandard transaction, with a valid and normal TxIn but with a special TxOut that has a script that always evaluate to true, everyone will be able to claim those bitcoins and use them for their own needs. In this situation, I'm assuming the first person that has a transaction in a valid block will be the "winner" and all the others that tried to use those coins will have their transactions never confirmed?

Again correct, but I'm not sure the default client will be able to create a corresponding txIn 9even though it's trivial).


Title: Re: Some questions about scripts
Post by: ribuck on May 17, 2011, 01:19:41 PM
... if a miner starts accepting transactions with non-standard scripts ...

Luke-jr already accepts non-standard transactions and mines them into blocks (http://bitcointalk.org/index.php?topic=4028.0), if you include a fee of 0.00004096 bitcoins per 512 bytes, and connect your (modified) client to his node using "-addnode=nat.router.dashjr.org".


Title: Re: Some questions about scripts
Post by: titeuf_87 on May 17, 2011, 02:02:09 PM
...
Exactly.
...

Again correct, but I'm not sure the default client will be able to create a corresponding txIn 9even though it's trivial).
Thanks Sipa, I think I start to understand the bitcoin protocol more completely now :)

Luke-jr already accepts non-standard transactions and mines them into blocks (http://bitcointalk.org/index.php?topic=4028.0), if you include a fee of 0.00004096 bitcoins per 512 bytes, and connect your (modified) client to his node using "-addnode=nat.router.dashjr.org".

That's nice to know. Are there any non-standard transactions in the blockchain yet? Blockexplorer shows three under "Latest strange transactions", are there more?


Title: Re: Some questions about scripts
Post by: theymos on May 17, 2011, 03:22:49 PM
That's nice to know. Are there any non-standard transactions in the blockchain yet? Blockexplorer shows three under "Latest strange transactions", are there more?

That's all of them on the main network. There are a few more on testnet:
http://blockexplorer.com/testnet
(The public key sizes for these transactions is odd.)


Title: Re: Some questions about scripts
Post by: titeuf_87 on May 17, 2011, 04:56:17 PM

That's all of them on the main network. There are a few more on testnet:
http://blockexplorer.com/testnet
(The public key sizes for these transactions is odd.)

Thanks!

That pretty much answers all my questions about scripts (for now). If I find anything else I don't understand, I'll ask :)