Stefan Thomas [ARCHIVE] on Nostr: 📅 Original date posted:2012-07-29 📝 Original message:OP_WITHIN is ...
📅 Original date posted:2012-07-29
📝 Original message:OP_WITHIN is lower-bound-inclusive, but upper bound exclusive, so 1 0 1 WITHIN is false.
bool fValue = (bn2 <= bn1 && bn1 < bn3);
https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L854On 7/29/2012 6:31 PM, Amir Taaki wrote:
> Hi!
>
> Is this a valid script?
>
> ["1 0 1", "WITHIN NOT"]
>
> The first value (1) is tested to make sure it is between the lower (0) and upper (1) value. This evaluates to true, placing on the stack a single byte of [01]. NOT then inverses this to a 0 byte false value of [].
>
> What am I missing here?
>
> Thanks
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/bitcoin-development>
Published at
2023-06-07 10:26:40Event JSON
{
"id": "c06711bdd9289ea92e5d3e5ff770cbe55c03c252c22715b119b421189f262ffa",
"pubkey": "49f07bd32c0108a2903a0fa59f904ed312e0ea427d3269eb5fa910eb4a9e22c4",
"created_at": 1686133600,
"kind": 1,
"tags": [
[
"e",
"dd1f257463410e44aa15ec4321365a60c6bee35557ebfeae22c2291a7c455d03",
"",
"root"
],
[
"e",
"2b10f2d904364e475e740af1f26e0a5ab85ebb159392d03ad41166d2d4c01bb3",
"",
"reply"
],
[
"p",
"c86b2a2e41d61aaf7ab7198ba65cf5a35c015f3117a71eaba5e19bb537b20051"
]
],
"content": "📅 Original date posted:2012-07-29\n📝 Original message:OP_WITHIN is lower-bound-inclusive, but upper bound exclusive, so 1 0 1 WITHIN is false.\n\n\nbool fValue = (bn2 \u003c= bn1 \u0026\u0026 bn1 \u003c bn3);\n\nhttps://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L854\n\nOn 7/29/2012 6:31 PM, Amir Taaki wrote:\n\u003e Hi!\n\u003e\n\u003e Is this a valid script?\n\u003e\n\u003e [\"1 0 1\", \"WITHIN NOT\"]\n\u003e\n\u003e The first value (1) is tested to make sure it is between the lower (0) and upper (1) value. This evaluates to true, placing on the stack a single byte of [01]. NOT then inverses this to a 0 byte false value of [].\n\u003e\n\u003e What am I missing here?\n\u003e\n\u003e Thanks\n\u003e\n\u003e ------------------------------------------------------------------------------\n\u003e Live Security Virtual Conference\n\u003e Exclusive live event will cover all the ways today's security and \n\u003e threat landscape has changed and how IT managers can respond. Discussions \n\u003e will include endpoint security, mobile security and the latest in malware \n\u003e threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/\n\u003e _______________________________________________\n\u003e Bitcoin-development mailing list\n\u003e Bitcoin-development at lists.sourceforge.net\n\u003e https://lists.sourceforge.net/lists/listinfo/bitcoin-development\n\u003e",
"sig": "9b17a482332a5519d84dd71147bb3c5f5a24316d84240e60efaee05400b4ff529eb9d570b3f4d59384111b41aba71fa7b3a46bb18bb0314fabe2be5ce33d789d"
}