Author

Topic: Manipulating data with the bitcoin scripts (Read 581 times)

newbie
Activity: 26
Merit: 0
June 09, 2014, 11:44:40 PM
#4
There's a subtle distinction here:
  • Invalid transactions are just refused no matter what. They're either badly formatted, use an unsupported opcode (like string manipulation ones), try to double-spend, etc.
  • Non-standard transactions are valid and accepted as such but not relayed. They can be included in a block only by mining pools that accept them (like Eligius).
sr. member
Activity: 770
Merit: 250
There are a few ways to do what you propose. You could use OP_PICK or OP_ROLL. If you want to be more creative, you can do that with the alt stack as well, look at OP_TOALTSTACK and OP_FROMALTSTACK.

I'm not aware of a better documentation source than the wiki unfortunately. You do know that non-standard scripts aren't relayed though, right?

Thank you! And yes, that much I know... but I might be getting something wrong there; those you mentioned are standard, right? I don't know where I could give that much stuff on to the stack to use ROLL for example, can I give many different items at once to be held on the stack as separate pieces of data? I guess it's just the lack of examples on how to use that stuff. No collections yet? Anyway, thanks a lot. I will keep looking, maybe I'll get something.
newbie
Activity: 26
Merit: 0
There are a few ways to do what you propose. You could use OP_PICK or OP_ROLL. If you want to be more creative, you can do that with the alt stack as well, look at OP_TOALTSTACK and OP_FROMALTSTACK.

I'm not aware of a better documentation source than the wiki unfortunately. You do know that non-standard scripts aren't relayed though, right?
sr. member
Activity: 770
Merit: 250
It is late and all but I think I could not find these answers on my own that well. I took a look at the tx scripting possibilities and some fun things popped into my mind, but as of now I think it's not possible to get a chunk of data and compare the first 3 bytes of the data to the next 3 bytes, for example.

Am I correct in that and also in that it could be done with the disabled features such as splicing?
Are those features planned to be used on the mainnet later on?

That would allow for some cool things, to me at least... but the wiki page is kind of difficult to navigate. Is there a clearer presentation somewhere, like a simplified version with the functions and some visual aid? There is a possibility for an additional stack, what else... a manual would be nice. I guess the flow control instructions should be simple enough, for one, but I really can't figure out what kind of input it needs and from where. Some examples would go a long way.

I am sure some pretty things have been done with it, I would be interested in seeing a collection and some interesting scripts people have devised, even if with the disabled features.

Thanks for anyone who can answer.
Jump to: