@dylan 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 dylan's activities

Bitcoin Script

visit channel home
Total Economy: 0.8 USD
Playing around with scrypt... and have another question that I'm sure is simple. I've written a basic bytewise AND contract (see attached image). My understanding is if I were to put OP_1, and OP_2 as the two inputs to this contract, it would be '0x51 & 0x52' which should be 0x50... but I cannot get the contract to evaluate to true. Am I missing something obvious?
musiq tipped:
0.01 USD
1 year ago
I can get this to work for anything that doesn't AND to 0x50... i.e. OP_1 & OP_3 evaluates to OP_1 no problem (0x51 & 0x53 == 0x51). Wondering if it's just how scrypt is putting 0x50 on the stack in the unlocking script?
musiq replied:
Does it work if you do require(this.and(this.x, this.y) == z)?
venezia replied:
To binary number, OP_1 is 01, OP_2 is 10. So the & result should be 00.
xhliu replied:
Opcode OP_1 is 0x51 in hex format. But it pushes 1, NOT 0x51, onto stack. To push 0x51, just use 0x51.
dylan tipped:
0.79 USD
1 year ago
xhliu replied:
dylan replied:
Thanks xhliu! Makes a ton of sense now. Will join the slack channel!