<p>If you want the standard client to ignore a part of a script, you should add it in with OP_PUSH and remove with OP_DROP, essentially making it a comment. This schema is similar to how HTML and javascript work. As long as the rest of the transaction confirms to the Bitcoin Protocol, you can put whatever data you want between those two operations, allowing you to create custom scripts.</p>

<p>However, such functionality is very non-standard. You would need to develop your own software for handling such scripts, and as far as I know, there isn't a program that allows you to encode messages in transaction comments easily (I've been looking for one for a long time and I wasn't able to find it).</p>

<p>Alternatively, you could create your own version of Bitcoin and incorporate your non-standard scripts into it, similarly to how Namecoin operates. This would take more effort, but offer a lot more freedom.</p>

CC BY-SA 3.0
2012-07-06T22:51:09.293Z
2012-07-06T22:51:09.293Z
ThePiachu
<p>It would require a change in the protocol to allow for the use of external validation routines, or any bitcoins spent using the "special" script will never again be spendable by any standard Bitcoin client.</p>

<p>None of the currently available clients offer this feature.</p>

CC BY-SA 3.0
2012-07-06T22:26:45.163Z
2012-07-06T22:26:45.163Z
Chris Moore
<p>The only data belonging in the block chain is what is necessary for the world to verify it is valid. Anything else is essentially private information between the sender and the receiver.</p>

<p>I don't think there is much point in having nodes with local stricter additional validation rules. What if a transaction is sent that you yourself don't accept, but the rest of the world does?</p>

CC BY-SA 3.0
2012-07-07T01:08:25.077Z
2012-07-08T11:06:16.240Z
2012-07-08T11:06:16.240Z
Pieter Wuille
<p>Is it possible to add a hook for custom validation of transactions with a special script "tag" in them? If so, How? In essence, I want to add something similar in  functionality to bitcoin script, but far more complex that what that supports. It doesn't matter if most clients/servers will not recognize the extended bitcoin script , provided they will ignore it.</p>

<p>The idea is that a node, when seeing a transaction with a special script payload, would call some external validation routine and only if that succeeded would it then run the standard integrity checks.</p>

<p>Are there supported hooks for this in the JSON-RPC API, any of the various clients, or would it require extensive modification of the source ? </p>

CC BY-SA 3.0
2012-07-07T08:21:22.867Z
I don't think this will have the effect you expect it to have. All this will do is cause your client to ignore some bitcoins that other clients consider valid -- and this would apply to all bitcoins that ever "passed through" a transaction your logic rejects.
David Schwartz
<transactions><script>
Custom validation logic for transactions/ custom script extensions
imichaelmiers
# Custom validation logic for transactions/ custom script extensions

(Asked by: username_0 on 2012-07-06)

Is it possible to add a hook for custom validation of transactions with a special script "tag" in them? If so, How? In essence, I want to add something similar in functionality to bitcoin script, but far more complex that what that supports. It doesn't matter if most clients/servers will not recognize the extended bitcoin script , provided they will ignore it.

The idea is that a node, when seeing a transaction with a special script payload, would call some external validation routine and only if that succeeded would it then run the standard integrity checks.

Are there supported hooks for this in the JSON-RPC API, any of the various clients, or would it require extensive modification of the source ?

**Tags:** transactions, script

> **Comments:**
> **username_1**: I don't think this will have the effect you expect it to have. All this will do is cause your client to ignore some bitcoins that other clients consider valid -- and this would apply to all bitcoins that ever "passed through" a transaction your logic rejects.  

---

## 3 answers

### Answer by username_2 on 2012-07-06. Score: 1 | Accepted answer

If you want the standard client to ignore a part of a script, you should add it in with OP\_PUSH and remove with OP\_DROP, essentially making it a comment. This schema is similar to how HTML and javascript work. As long as the rest of the transaction confirms to the Bitcoin Protocol, you can put whatever data you want between those two operations, allowing you to create custom scripts.

However, such functionality is very non-standard. You would need to develop your own software for handling such scripts, and as far as I know, there isn't a program that allows you to encode messages in transaction comments easily (I've been looking for one for a long time and I wasn't able to find it).

Alternatively, you could create your own version of Bitcoin and incorporate your non-standard scripts into it, similarly to how Namecoin operates. This would take more effort, but offer a lot more freedom.


---

### Answer by username_3 on 2012-07-06. Score: 1

It would require a change in the protocol to allow for the use of external validation routines, or any bitcoins spent using the "special" script will never again be spendable by any standard Bitcoin client.

None of the currently available clients offer this feature.


---

### Answer by username_4 on 2012-07-07. Score: 0

The only data belonging in the block chain is what is necessary for the world to verify it is valid. Anything else is essentially private information between the sender and the receiver.

I don't think there is much point in having nodes with local stricter additional validation rules. What if a transaction is sent that you yourself don't accept, but the rest of the world does?


---

