Skip to content
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

transaction list ATTOKEN -b output #209

Closed
buhtignew opened this issue Oct 26, 2024 · 4 comments
Closed

transaction list ATTOKEN -b output #209

buhtignew opened this issue Oct 26, 2024 · 4 comments
Labels
anomaly If something works not as expected question Further information is requested

Comments

@buhtignew
Copy link
Collaborator

buhtignew commented Oct 26, 2024

I'm still thinking about what I've accidentally discovered here.

Of course the transaction list ATTOKEN -b usage (like transaction list ATTokenNotPoB -b for instance) is wrong, but the transactions that are being outputted shouldn't be there in any case or at least I'm not able to give them any explanation.

For instance if I run transaction list ATTokenNotPoB -b there is transaction b8f04a83ede9a21e7df2071513019c598c7ed7d857a75a67a3165a1a57f64ff3 in the list, but its transaction show b8f04a83ede9a21e7df2071513019c598c7ed7d857a75a67a3165a1a57f64ff3 -s is like this:

{
    'inputs': [
        {'sender': ['mixcqdAy4aFtuBV7uRebqBTjiFWCcS4UEp'], 'value': 226.91}
    ],
    'outputs': [
        {'receivers': ['mmSLiMCoinTestnetBurnAddress1XU5fu'], 'value': 1.0},
        {'receivers': ['mixcqdAy4aFtuBV7uRebqBTjiFWCcS4UEp'], 'value': 225.9}
    ],
    'blockheight': 203615
}

which doesn't have anything to do with the ATTokenNotPoB deck, for instance the P2TH address of that deck, muhhYam1NXMSUqKx4uSrfjS7N7Fcz6j6Qx is not involved in this transaction.

So for the sake of discovering something bigger wouldn't it make sense understanding what are those results provided by that wrong command usage?

@buhtignew buhtignew added question Further information is requested anomaly If something works not as expected labels Oct 26, 2024
@d5000
Copy link

d5000 commented Oct 27, 2024

This is actually easy to explain and totally expected. What you are seeing there are burn transactions.

The transaction list -b / -g command searches for transactions which spend any amount of coins to a specific address. If you give -g, then it will use the at_address of the deck (the gateway address). Instead if you use -b, then it will always use the burn address, which is the same for all PoB tokens.

So it looks like if you use transaction list -b the deck would not make any difference, as always the same burn transactions would be shown. But there's actually one use case: if the deck has a startblock or endblock, i.e. it only accepts burn transactions in a specific block range, then this will limit the transactions which are shown in this command.

Thus what happens when you use an AT token which is not a PoB token with transaction list -b?

  1. It will pre-select the burn transactions.
  2. If the AT token has a block limitation, it will show only those between the startblock and endblock.

Thus if you use -b with an AT token without any block limitation it will show all burn transaction it knows. It would basically the same like not providing a deck at all.

If you use -b with an AT token with a block limitation, it will show all burn transaction inside the block range specified by the deck.startblock and deck.endblock attributes of the AT token. So this output doesn't make any sense as you see.

I get this may lead to confusion, but again this is one of the cases where the user is using a wrong command combination.

However, as this problem is easy to catch and above all the second case may be very confusing (if the burn transactions of a limited block range are shown) I've added a check now that the -b command can only be used with PoB tokens and will reject AT tokens with an error. I'll commit it later with another change.

PS: As you wrote about a P2TH address, there may be a bit of more confusion: Neither burn nor gateway transactions spend to P2TH addresses. They are simple transactions (even may have only one output) to the burn/gateway address.

@buhtignew
Copy link
Collaborator Author

Everything solved here.
I'm closing.
Thank you for your explanation.

@buhtignew
Copy link
Collaborator Author

buhtignew commented Oct 28, 2024

I was about to delete this suggestion in Nice to have thread, but I've suddenly reminded that we have tokens that are not PoD tokens nor PoB, nor ATtokens or also old protocol tokens.
So I was wondering whether it would make sense to output just the same message for PoD, ATtokens and all the others that are not burn tokens, saying that the decks to be used in case of -b can be PoB only, as mentioned in the suggestion above?

@buhtignew
Copy link
Collaborator Author

buhtignew commented Oct 29, 2024

I'm closing this since your reply here that probably refers to this thread has made your point very clear to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anomaly If something works not as expected question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants