Bitcoin Forum
May 08, 2024, 07:38:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Manipulating data with the bitcoin scripts  (Read 566 times)
kuverty (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 250


View Profile
June 10, 2014, 03:14:42 AM
 #1

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.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715197086
Hero Member
*
Offline Offline

Posts: 1715197086

View Profile Personal Message (Offline)

Ignore
1715197086
Reply with quote  #2

1715197086
Report to moderator
1715197086
Hero Member
*
Offline Offline

Posts: 1715197086

View Profile Personal Message (Offline)

Ignore
1715197086
Reply with quote  #2

1715197086
Report to moderator
1715197086
Hero Member
*
Offline Offline

Posts: 1715197086

View Profile Personal Message (Offline)

Ignore
1715197086
Reply with quote  #2

1715197086
Report to moderator
mriou
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
June 10, 2014, 03:52:42 AM
 #2

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?
kuverty (OP)
Sr. Member
****
Offline Offline

Activity: 770
Merit: 250


View Profile
June 10, 2014, 04:00:07 AM
 #3

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.
mriou
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
June 10, 2014, 04:44:40 AM
 #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).
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!