@lamingtons is on PowPing!

PowPing is a place where you can earn Bitcoin simply by socializing, for FREE.
Never tried Bitcoin? It's OK! Just come, socialize, and earn Bitcoin.
Check out lamingtons's activities

Bitcoin Script

visit channel home
Total Economy: 0.08 USD
had an idea for paying people to sort numbers. to spend this you need to provide the indexes of numbers in sorted order. what do you think of this output: 00 00ff11 00ff12 00ff13 00ff18 00ff19 00ff20 00ff14 OP_FROMALTSTACK OP_PICK OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY input: 01 OP_TOALTSTACK 02 OP_TOALTSTACK 03 OP_TOALTSTACK 00 OP_TOALTSTACK 04 OP_TOALTSTACK 05 OP_TOALTSTACK 06 OP_TOALTSTACK
joe tipped:
0.02 USD
1 year ago
musiq tipped:
0.02 USD
1 year ago
venezia tipped:
0.01 USD
1 year ago
For this to be practical, u need a mechanism to prevent relaying nodes from stealing your solution, which is public. Maybe some sort of R-Puzzle.
venezia tipped:
0.01 USD
1 year ago
musiq tipped:
0.01 USD
1 year ago
lamingtons replied:
oh yeah, ill try it in a real transaction soon
Great idea! Yes, we can verify are the inputs sorted. OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY OP_OVER OP_GREATERTHANOREQUAL OP_VERIFY OP_TRUE : main check_sort_verify ; : check_sort_verify ( a1 a2 ... an -- ) times 0 do over greaterthanorequal verify loop true ; \ compare times, equal to length-1 \ if length is 5 : times 4 ;
joe tipped:
0.01 USD
1 year ago
joe replied:
Although you've verified that the inputs are sorted, you haven't verified if they're the same as the numbers presented by the challenger. I think that's why@lamingtons is sorting by indices.
venezia tipped:
0.01 USD
1 year ago
venezia replied:
Absolutely right! Using index is a good idea. It is more convenient to use binary to store the sequence of numbers. Save a lot of push operators in unlock script. Here is how to get an element by index from an array. ``` : get ( array index -- array element ) \ keep the origin array in altstack over tas \ [..., e, ...] -- [e, ...] unit * split nip \ [e, ...] -- e unit split drop \ reset origin array fas swap ; \ the byte size of the element in array : unit 2 ; : main <<100:16, 101:16, 102:16, 103:16>> 2 get <<102:16>> equalverify ; ``` 0064006500660067 OP_2 OP_OVER OP_TOALTSTACK OP_2 OP_MUL OP_SPLIT OP_NIP OP_2 OP_SPLIT OP_DROP OP_FROMALTSTACK OP_SWAP 0066 OP_EQUALVERIFY
"paying people to sort numbers" => If this model works (which is very cool), probably you would be paying machines to sort instead of people 😁
lamingtons replied:
yea machines :D, maybe if you had enough numbers, and someone had a really fast sorting machine. but the transaction would be so large
musiq replied:
couldn't you build a mergesort version of this and crowdsource it? multiple small machines could sort and you could merge them.
lamingtons replied:
i don't want to do any merging its where most of the work would happen. i just pull the answer out once the output is spent.
Haha, nice! Unfortunately, the alt-stack isn't shared between the ScriptSig and ScriptPubKey. So, your "input" can't use the alt stack :/
lamingtons tipped:
0.02 USD
1 year ago
venezia tipped:
0.01 USD
1 year ago
lamingtons replied:
ah, ill try to fix it then
adonsats replied:
yep. welcom to bitcoin script