-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inscription numbers off by one, or the curious case of transaction c1e0db6368a43...d9e4117151
#2062
Comments
c1e0db6368a43f5589352ed44aa1ff9af33410e4a9fd9be0f6ac42d9e4117151
c1e0db6368a43...d9e4117151
If this is intended behavior, it sounds like a violation of the spec (implicitly or explicitly): one should not be able to inscribe a sat that one does not own. If this is unintended behavior, then this bug likely impacts all Ordinal tools, explorers and marketplaces out there. |
A curious transaction indeed! I'm told this was found by supertestnet, so nice find by them! It shouldn't be possible to inscribe sats that you don't own, so this is a bug. However, fixing the bug by making ord ignore this inscription would change inscription numbers after the curious transaction. I'm honestly not sure what to do! |
Yeah, apparently supertestnet initiated this transaction. |
I am become Math, breaker of jpegs |
Might be a good issue/time for a precedent of preferring correctness over stable inscription numbers. Similar to as with ordinal theory if there was a bug in a counting implementation one would very likely favor correctness. |
So if I do this 545 more times will a bunch of brc20 tokens suddenly belong to the wrong people? |
God I hope so! |
FAAFO everyday ! |
I got one case where it doesn't show up in the explorers but the ord wallet treats it as regular ordinal. not sure if related, but I cannot tell what number it got. |
One thing that bears mentioning is, no fee was paid either, at least, on-chain. This is a PHANTOM SAT |
I released a tool for increasing the off-by-one error: https://github.com/supertestnet/breaker-of-jpegs Please follow the installation and usage instructions and let me know if it works for you |
There was, and we did. Issue #1841 caused hundreds of inscriptions to be tracked incorrectly. It was fixed by #1971 which fixes the tracked location of those inscriptions. The fix requires the index.redb file to be recreated, but the release notes didn't mention that fact so most people are probably still working with incorrect inscription locations, so I don't see why this would be any different. The indexer was incorrectly recognizing inscriptions that it shouldn't, and it needs fixing. I would prefer if the release notes mention that a fix was applied and what the impact was if it makes a significant difference. |
Happy Ordinals Breaking Day! |
it seems this affects "inscription numbers".. does it also affect satoshi ordinal tracking (satoshi numbers) - note these are different things and i hope its just the former |
if its just "inscription numbers" then good, i think inscription numbers should have died a long time ago. |
GUERRILLA WAS HERE |
RED PURDY WAS HERE |
I think the only off-by-one here is that an inscription in the index and associated with the wrong sat, so if that inscription shouldn't have been indexed (because there is no sat in the first output), then the inscription numbers after this one are off-by-one. AFAIU, there shouldn't be any impact to ordinal tracking, only to inscription numbers after this one. |
Bro, you have increased the UTXO set with a (likely) unspendable output:
|
Stop breaking things |
i attempted to summarize the situation here, lmk if anything is wrong! |
you will use soma and you will like it |
ahhh i'm somaaaing |
Running breaker of jpegs until degeneracy improves. |
First I think we should test all possible edge cases, to see how the indexer currently treats it. If nothing too weird happens after testing all possible cases. For example indexer doesn't crash, or if it doesn't ascribe to the next blocks sats. ect. Then we can update the specs to the exact logic the indexer uses, and its fine to continue. One is not really inscribing to a sat they don't own, as this type of inscription (if we end up counting it as one), can only be done if a miner wants to include it. (its nonstandard and default mempool policy nodes dont relay this). TLDR: we need to test all possible cases, and its potentially a nothing burger just would need update the spec to its exact logic. |
The fix is as simple as this:
That is, only recognize inscriptions if there is at least 1 input sat, because then there will be a sat to inscribe on. |
I tested doing this trick in the last tx of a block and the inscription's location was set to 00000000:-1 as expected. It didn't crash the indexer. |
@casey what about these becoming the "official" Vanilla inscriptions? I'm sure you can come up with a much cooler name though 😆. And in all seriousness, I believe this can be tied to deprioritizing inscription numbers. Is still early! |
Brc 20 has been made https://unisat.io/brc20/%20545 |
So does anyone know where the code is that is causing the problem? |
greater than zero might be better |
I think the thing to do is to recognize the inscription, thus not throwing off inscription numbers, but treat it as having no location, i.e. as having not been made on any particular sat, and not having a location, output, or offset on the /inscription page. |
I think I'm in the camp of gradually decreasing the importance of inscription number. They are factually bringing a lot of noise in the ordinal theory and confusing many end users. Inscription number is the info displayed in the forefront of explorers, etc. Sequencing inscriptions with inscription numbers is useful for development purposes, but it’d be for the best if they could become “secondary”, since the sequence is flawed and broken. That being said, I agree on the |
If I want to transfer it to someone am I just out of luck? It feels like the inscription should go into the address I specified as an output so I can send it to someone in return for a payment. It's probably a very valuable inscription at this point. Please don't steal from me by making my inscription unsendable! Just put it where I specified as an output. |
Fixing a bug isn't stealing ;) |
You should try to transfer it today, I'm not convinced you'd be able to - that inscribed sat is included in a sat range that you don't own (the miner does). |
I'm sure @supertestnet knows lol. Inscriptions don't have any definite connection to a sat, it is only a convention. His transaction is one of the best proofs, an inscription without any possible sat to connect it to! 🤯 |
I think it sometimes is. The Ordinal Theory Handbook states: "The inscription content is contained within the input of a reveal transaction, and the inscription is made on the first sat of its first output." source My transaction demonstrates a flawed assumption within that theory: the first output does not necessarily have a first sat. You could fix this bug by modifying ordinal theory so that if there is no sat in the first output the inscription becomes unsendable. But in my opinion a better way to fix it is to modify ordinal theory so that if there is no sat the inscription is sendable, but is not attached to any sat at all. (Similar to how utxos with 0 value are spendable but do not transfer any sats.) If you modify your explorer so that it shows my inscription as belonging to the address I tried to send it to (as seems fair to me), I might assign it to an ordinal by making a new transaction that sends it to an output that has a positive value. Or I might send it to another 0 value output where the address is controlled by someone who wants to buy my inscription. (That way it can retain its unicity and become the first inscription without an associated ordinal.) Regardless of what I choose, I think it should be my choice, and in order to make that choice, I need the inscription. It sounds like you disagree with my opinion about how to fix this bug and you think the inscription should be unsendable. I hope you can see based on my reasoning above why that seems like theft to me. I wanted the inscription in the address I designated, and a bug in your software left it appearing as if someone else's address holds it instead. If you fix the bug by making my inscription totally unusable, rather than making it show up in the address where I wanted it to go, that seems unfair and I don't understand why you would do that. If you compare my proposed solution with your proposed solution, I think the solution where the inscription goes where I tried to send it is more logical, and the solution where the inscription becomes unsendable is more spiteful. But perhaps I am missing something. |
https://ordinals.com/inscription/2814d0a3c9e6dd5b88911a6280fc3899391f5c47072eb11593af2838160fad2fi0 is not an inscription is it normal ? |
Turns out, this bug is a bit more vicious than I thought. If we look at block 788200:
So let's say we have a Block B1, with, in order, the N transactions T1, T2, TN with T2 materializing the sat overflow issue. |
Can we assume that ordinals protocol indexes utxo. |
Lol you're angry. Maybe it's not the way that they think this.
Can you visualise this tx in the actual explorer ? Can you see this inscriptions via
In Bitcoin protocol we can spend this utxo ? |
What is -T2 ?
|
@supertestnet Sorry dude, but your arguments are pretty unconvincing 😂 This is pretty obviously a trivial bug with a simple fix, and the opposing argument is, not to be too harsh, just silly.
Making it possible for an inscriptions to be sendable, but not attached to any particular sat would be a massive change that entirely departs from the existing paradigm of ordinals and inscriptions.
See above, but inscriptions do not and cannot belong to addresses. They belong to sats, which sit in outputs, which have addresses.
This would require an entirely new transfer mechanism to be invented, as opposed to, oh idk, just fixing the bug 😂
So you'd prefer a change which gave you ownership of the inscription, ic ic 😂
Not really. Aside from the above, fixing the bug wouldn't even be theft because you don't currently own the inscription. The inscription is currently owned by the person who owns the sat which was erroneously inscribed.
No you didn't, if you wanted an inscription you would have made a normal one 💁♀️
See above 😘 I do appreciate you finding this bug though! See PR #2107 for the fix. Inscriptions made in transactions with no sats on the inputs are assigned to the Ez bug, ez fix. Ordinal disrespecters should have found something that wasn't a nothing burger to sink their teeth into ;) |
Fixed by #2107. |
@casey Could you please confirm / acknowledge that the related bug mentioned in this comment https://github.com/casey/ord/issues/2062#issuecomment-1553590928 is not fixed and will never be fixed? |
@lgalabru Are you referring to the fact that inscriptions with zero-value inputs are processed out of order in the block in which they're found, so they receive inscription numbers as if they were the last transaction in the block? That's actually quite an annoying wrinkle. PR #2107 changes the order in which they're processed, so that they receive inscription numbers in the "correct" order. I'm not sure this is ideal, but the alternative would require alternative implementations to maintain the pretty odd behavior of assigning inscription numbers as if zero-value input inscriptions are found last in the block. |
I see. So around 5000 inscriptions (2 blocks) will see their inscription number changing with the next release? |
Is it possible that this error https://github.com/casey/ord/issues/2110#issue-1723875952 is coming from this update ? |
Not necessarily. I haven't decided what to do here! I implemented the fix in #2107 not realizing that it would change inscription numbers. |
Should we re-open this issue then? Or open another one to track the fact that anyone running the |
Did you consider.... not spending time on scamming people? |
@raphjaph fixed the renumbering issue and the fix is part of the 0.6.0 release. |
Block
788200
is including a curious transactionInputs:
2814d0a3c9e6dd5b88911a6280fc3899391f5c47072eb11593af2838160fad2f:0 : 0 sats
Outputs:
bc1q6zpf4gefu4ckuud3pjch563nm7x27u4r5j4ua7 : 0 sats
No satoshi at play in this transaction. Yet,
ord
validated the inscription (3492721) attached to the input https://ordinals.com/tx/c1e0db6368a43f5589352ed44aa1ff9af33410e4a9fd9be0f6ac42d9e4117151which sounds like a bug.
Philosophically, the satoshi inscribed was transferred to the miner as a transaction fee, but was nevertheless inscribed by its previous owner.
Even if the miner own this UTXO, this is not how they should be inscribing it, per the protocol (they should be inscribing the coinbase transaction).
As a consequence, all the satoshis inscribed after inscription 3492720 are off by one.
The text was updated successfully, but these errors were encountered: