r/btc•
GregGriffith

Possible SLP Spec Issue. Am I missing something?

I have a miscalculation in my description of the percieved problem below. It turns out yes, i was missing something. For some reason when i initially went over the problem i wrote down that OP_PUSHDATA4 was much smaller than it is. Making my noticed issue essentially a nitpick.

Formal issue has been opened here: https://github.com/simpleledger/slp-specifications/issues/14

Posted May 9, 2019, 2:10 AM UTC · edited

125
jonald_fyookballElectron Cash Developer•

Great point. You're not missing anything. We just had that unspoken assumption that the OP_RETURN limit is there and limits things. We should examine it from this angle and see what are the implications.

10
markblundeberg•

Right now the maximum possible op_return size is just short of 1 MB. Although it's non-standard, miners can mine them. SLP is designed to take this into mind. (In other words, the conventional length limit for relay does not play a role in SLP validity.)

Data pushed to OP_RETURN typically uses the <length><data> format where the value of <length> is the number of bytes that is <data>.

Typically yes, but not always. SLP standard is clear that you have to handle chunks being pushed in any of four forms: https://github.com/simpleledger/slp-specifications/blob/master/slp-token-type-1.md#formatting There are also unit tests for conforming implementations to check this: https://github.com/simpleledger/slp-unit-test-data/

Feel free to open issues for this kind of thing by the way: https://github.com/simpleledger/slp-specifications/issues

6
GregGriffithOP•

Miners can mine a size just short of 1 MB, but iirc none of the full nodes do this by default so i stated the standard limit.

ok, I will open an issue on this.

2
jscramer•

> The length field is different sizes causing an issue for anyone trying to parse the data because it is impossible to tell how many bytes are needed to figure out the length of data.

SLP data is delineated using script data push opcodes, so this way you can use those opcodes to know the length of the data field. hope this helps.

1
GregGriffithOP•

the script data push opcodes dont cover the length of infinity issue. they still have a finite amount of data you would pull for the length which if over this would still break.

1