lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
456 stars 110 forks source link

[feature]: Provide "forwarding history" for Edge Nodes #1005

Open MegalithicBTC opened 1 month ago

MegalithicBTC commented 1 month ago

Currently, when an Edge Node performs a swap between a Taproot Asset and Bitcoin, my understanding is that the only way to see the "results" or "history" of this transaction is with a combination of these commands:

lncli fwdinghistory

{
    "forwarding_events": [
        {
            "timestamp": "1720647207",
            "chan_id_in": "3152629690323894272",
            "chan_id_out": "3152616496185344000",
            "amt_in": "101",
            "amt_out": "100",
            "fee": "1",
            "fee_msat": "1000",
            "amt_in_msat": "101000",
            "amt_out_msat": "100000",
            "timestamp_ns": "1720647207538098949",
            "peer_alias_in": "testnet.laisee.org",
            "peer_alias_out": "VelasCommerce-Testnet"
        }
    ],
    "last_offset_index": 1
}

AND.....

lncli listchannels

{
    "channels": [
        {
            "active": true,
            "remote_pubkey": "03acb2b721d403396a5af53ee84ec0728b8057f5e86124359d0063c5f34bc0223d",
            "channel_point": "c321db4ed04140608d1475bb92a97a0889fba74b898415a017154b5df53bd732:0",
            "chan_id": "3152629690323894272",
            "capacity": "500000",
            "local_balance": "396631",
            "remote_balance": "99899",

The fwdinghistory shows the event, and the results of that event are then shown in the change in the local_balance vs remote_balance.

Maybe some kind of extra database table or other structure is needed so the Edge Node can "keep records" on their activity?

Roasbeef commented 1 month ago

Great idea! We definitely have some visibility/accounting gaps to fill.