Jump to content
rippleHero

Answer: How to decipher specific ripple transaction?

Recommended Posts

Posted (edited)

Hi Bob, I have been looking through a few similar transactions, and I am wondering in this case how the following transaction can be deciphered. (You will have to click on "Show" under TX JSON)

https://bithomp.com/explorer/?r=1A06B8E85C40B3756BE0B24A04DEE76E5BC5B0EFFBABB15F4634860CA78807F4

I am mainly concerned with the 83.40 XRP that is supposedly sent from rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 to elsewhere. In this case it is not specified who this is being sent to. I did notice that XRP send from rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS to addresses [r4najz5nPC2zoYWiereTZN6kxJezP2ZJrD, rGMNHZyj7NizdpDYW4mLZeeWEXeMm6Vv1y, r3bjHrjg5y1xE2VzGLuQYMW97ZTSfgN32x] sum to this number, but there is no indication from the JSON how rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS acquired the XRP. 

Additionally, rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 did have an exchange with rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS, in which the former received 9.680707 XRP, but this is not displayed in the balance changes either? Could it be possible that this 9.6807 was netted with another XRP exchanged involving the same addresses? 

Essentially, this transaction is confusing and was wondering if you could help me decipher how the currency flows through each address. Specifically for the 83.40 XRP mentioned above.

Thanks!

Edited by BobWay
Changed this from Chat to Answer because I put a bunch of work into my response.

Share this post


Link to post
Share on other sites
Posted (edited)

Bithomp is great for looking at regular txs, but for complex ones not so much.

On XRPCharts you can see this is a tx completing a DEX orderbook

https://xrpcharts.ripple.com/#/transactions/1A06B8E85C40B3756BE0B24A04DEE76E5BC5B0EFFBABB15F4634860CA78807F4

DESCRIPTION:
This is a Payment transaction.
The payment is from rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 to rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4.
It was instructed to deliver 321.46072 XLM.ripplefox (rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y) by spending up to 100 XRP.
The actual amount delivered was 321.46072 XLM.ripplefox (rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y)
The transaction's sequence number is 566

MEMOS:
The transaction has no memos.

TRANSACTION COST:
Sending this transaction consumed 0.000012 XRP.

FLAGS:
The transaction specified the following flags:
tfNoDirectRipple
tfPartialPayment
tfLimitQuality

 

Edited by retryW

Share this post


Link to post
Share on other sites

Hi. Thanks for the response. This is still confusing when looking at XRP charts. It is just a list of numbers and I am not sure how to relate them in any way. Could you elaborate on what I mentioned in my question concerning the 83.40 XRP? 

So from your post, what does XLM.riplefox mean? Did rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4  trade XRP for XLM with rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y?

 

Share this post


Link to post
Share on other sites

Bithomp isn't giving you the REALLY RAW data that rippled does. Bithomp has parsed and reformatted it to make it easier to follow. I could give them some hints on making it even easier though. 

Let's use Bitthop's for simplicity, but notice that Bithomp (probably accidentally) left out the destination amount the payment was intended to deliver. That makes these RAW results slightly opaque about the user was attempting to do.

But if you lookup to the top of the bithomp web page, you see they did put it there.

    Delivered amount:321.460719 XLM (Ripple Fox)

It delivered 321.460719 so that must have been related to what the transaction was trying to do.

----
You can also look at that transaction this way. Thank Rome Reginelli for that beautiful hack. 

https://xrpcharts.ripple.com/#/transactions/1A06B8E85C40B3756BE0B24A04DEE76E5BC5B0EFFBABB15F4634860CA78807F4

Let's let Rome tell us what this transaction was trying to do.

    DESCRIPTION:

        This is a Payment transaction.
        The payment is from rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 to rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4.
        It was instructed to deliver 321.46072 XLM.ripplefox (rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y) by spending up to 100 XRP.
        The actual amount delivered was 321.46072 XLM.ripplefox (rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y)
        The transaction's sequence number is 566

Brilliant!

FLAGS:

    The transaction specified the following flags:
        tfNoDirectRipple
        tfPartialPayment
        tfLimitQuality

The last two flags are important. They mean give me as much as you can, but only what's available at a favorable price. These and the circular nature of this payment, tell me the sender was trying to take advantage of some bad pricing along the path in order to get a good deal on Lumin. I don't have his next transaction, but I would be he converts that XLM back to XRP and ends up with more XRP than he started with. If so that represents circular arbitrage. If not, the sender just wanted a good price on XLM.

If you switch to the RAW tab, you can see the even more complicated version that rippled returns. No wonder bithomp wants to simplify it right?

----

The key to figuring it out starts by first understanding what was rippled asked to do. That is what the specification sub-object is for.

    "specification": {
    "source": {
        "address": "rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4",
        "maxAmount": {
            "currency": "XRP",
            "value": "100"
        }
    },

Specifically, inside that you need to decode the path that ripple was asked to take through the Ripple ledger graph.

    "paths":  
        "[
            [
                {    
                    "currency": "STR", 
                    "issuer": "rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS", 
                    "type": 48, 
                    "type_hex": "0000000000000030"
                }, 
                {    
                    "account": "rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS", 
                    "type": 1, 
                    "type_hex": "0000000000000001"
                }, 
                {    
                    "currency": "XLM", 
                    "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", 
                    "type": 48, 
                    "type_hex": "0000000000000030"
                }, 
                {    
                    "account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", 
                    "type": 1, 
                    "type_hex": "0000000000000001"
                }
            ]
        ]"

The "path" array, there can be many inside the "paths" array, here has only a single path so that make my explaination easer. But the path represents only the middle section of the path. To that you need to add the source and destion endpoints around the path.

    "destination": {
        "address": "rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4"
    },

Please note:
                    "type": 48, 
means you want to go through a orderbook
                    "type": 1,
means you want to ripple through the specified party


Notice the source and distination are the same so this payment path represents is an attempt as circular arbitrage.

Also I see these two flags set. This tells me this transaction is an attempt to arbitrage bad pricing somewhere along the path. "allowPartialPayment" means

        "allowPartialPayment": true,
        "limitQuality": true


That gives you the end-to-end graph of the parties involved. Then you draw a graph of that in the notation I haven't showed you yet. But it is very similar to the Ripple graph explorer on the XRP Charts section of the Ripple website. 

This is the source address and all its trust line relationships to other parties. If you hover over those counterparty circles you can see there addresses as well. If you double click ones with an outscribed circle, they'll expand to show you their trust lines as well.

https://xrpcharts.ripple.com/#/graph/rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4

Unfortunately the browser is a bit frustrated by the fact that XRP isn't accounted for using trust lines, so it can't draw the complete graph. The notation I use, treats XRP as a trust line to a single XRP issuing entity (representing the ledger itself). If you do that, the transaction path becomes much easier to follow.

https://xrpcharts.ripple.com/#/graph/
rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS


Once you have the graph drawn out, and only then for me, do you begin to approach understanding what rippled ACTUALLY DID in processing your request.

The resutls of transaction request are specified in the outcome sub-object. 

    "outcome": {

         "balanceChanges": {
   
This specifies every balance that rippled updated. This includes both trust line and XRP balances. Unfortunately, these are not in path order, which is why you need your hand drawn graph.

        "orderbookChanges": {

This specifies the changes to the markets that executing the payment caused. Bithomp has formatted this better than rippled, but like rippled the results are not in path order. So you need your paper graph even more.

It turns out, the results are probably easer to follow using Rome's parsed version.

I'm not going to finish the analysis because my head hurts, and I spent time typing all this up rather than drawing the path graph like I should have.

But this should get you started.


 

Share this post


Link to post
Share on other sites
2 hours ago, rippleHero said:

Hi. Thanks for the response. This is still confusing when looking at XRP charts. It is just a list of numbers and I am not sure how to relate them in any way. Could you elaborate on what I mentioned in my question concerning the 83.40 XRP? 

So from your post, what does XLM.riplefox mean? Did rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4  trade XRP for XLM with rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y?

 

This payment path starts in XRP, uses STR as a bridge currency, then ends up in XLM. It goes though the XRP/STR market and then through the STR/XLM market.

Rome describes it. But he does not put the results in path order either. I swapped them below.

It modified a XRP/STR Offer node of rGMNHZyj7NizdpDYW4mLZeeWEXeMm6Vv1y
    The offer's Sequence number is 293916.
    the offer was partially filled.
    TakerPays decreased by 67.85405700000001
    from 232.57633 to 164.722273 XRP
    TakerGets decreased by 231.990345952928
    from 795.16931 to 563.178964047072 STR.~mrr (rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS)


It modified a STR/XLM Offer node of rMxkau5LJiidEk1S9X8RxxnX1uCx1zryvb
    The offer's Sequence number is 119367.
    the offer was partially filled.
    TakerPays decreased by 221.63955258639703
    from 1,585.0945 to 1,363.454947413603 STR.~mrr (rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS)
    TakerGets decreased by 224.13924600000018
    from 1,602.9715 to 1,378.832254 XLM.~ripplefox (rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y)
 

Share this post


Link to post
Share on other sites
Posted (edited)

Okay thanks Bob. This really clears things up. One last thing. 

Concerning the 83.401513 XRP that rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 pays. I can deduce that it either is paid to rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y or rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS. I know from the transaction detail that rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS ends up exchanging XRP with 3 addresses, which, in sum is equivalent to 83.401513 XRP. So I assume that this amount was sent to rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS. Can I make this assumption?

Edited by rippleHero

Share this post


Link to post
Share on other sites
33 minutes ago, rippleHero said:

Concerning the 83.401513 XRP that rsdMbYxHmYswHCg1V6vBsnxmHuCjpn6SC4 pays. I can deduce that it either is paid to rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y or rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS. I know from the transaction detail that rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS ends up exchanging XRP with 3 addresses, which, in sum is equivalent to 83.401513 XRP. So I assume that this amount was sent to rB3gZey7VWHYRqJHLoHDEJXJ2pEPNieKiS. Can I make this assumption?

You'll have to go to the order changes, to know the details of what happened. Market hops can effect lots of trust lines and addresses, because multiple offers can be taken at the same time.

Balance changes tell the NET change to each balance. That might be split into a bunch of different changes detailed in the order changes.

Share this post


Link to post
Share on other sites

I apologize, but one more question. Sorry, there is essentially no documentation helping to interpret the transactions. I know there is documentation concerning the interpretation of fields. 

For this TX: https://bithomp.com/explorer/49522DFAD0A35174663285BD6149437C3D4F2B6F1456E33C26129332915981D7

There are no balance changes, but there is an orderbook change. Was there anything transacted? It seems like there was according to the orderbook change, but nothing was delivered and there are no balance changes. Thanks!

Share this post


Link to post
Share on other sites
4 hours ago, BobWay said:

But Xpring would probably pay for that one.

How would one actually get in contact with them though and what do they want, proposal wise? "I propose to build a proper web interface for visualizing transactions properly for XX.XXX USD, here's my bank account!" probably won't fly I guess, on the other hand this stuff is impossible to monetize (yes, even with Coil existing).

1 hour ago, rippleHero said:

Sorry, there is essentially no documentation helping to interpret the transactions.

https://developers.ripple.com/transaction-formats.html - There's plenty of information...

https://xrpcharts.ripple.com/#/transactions/49522DFAD0A35174663285BD6149437C3D4F2B6F1456E33C26129332915981D7 took out the fee from the sending account and just decreased amounts on an open offer in an order book by the same user. Looks a bit funny though, but in essence the user said "I want to convert some of my CNY to USD" while having offers for both currencies open, so it just reduced the amounts of these offers accordingly instead of having to actually trade on the market. Issuing a payment to yourself is just a way to automatically trigger pathfinding.

Share this post


Link to post
Share on other sites

So currency was traded, but it is not shown because no value was lost? 

I am essentially trying to determine if anything actually occurred in this transaction. For example if I wanted to scrape transactions, would I want to scrape this information?

Share this post


Link to post
Share on other sites

No, nothing was traded:

1 hour ago, Sukrim said:

it just reduced the amounts of these offers accordingly instead of having to actually trade on the market

 

9 minutes ago, rippleHero said:

For example if I wanted to scrape transactions, would I want to scrape this information?

Depends on what you want to scrape...? I mean it is a transaction after all, but it didn't do a lot. I already told you the things that occurred in the transaction (2 offers' amounts were reduced and a few drops burned for fees). A proper "scraper" of course should know that this transaction exists (it is a valid historic transaction on the main chain), it depends on what information you want to extract from the data afterwards if you think that this is relevant for your analysis. If you want to check how many XRP were burned per day that's a different story than if you were to look at how much value was transfered in total (that would be a really tough thing to define in the first place).

Share this post


Link to post
Share on other sites

×
×
  • Create New...