-
Notifications
You must be signed in to change notification settings - Fork 138
Description
We have a running Taproot node with:
- Taproot Asset channels (TA1, TA2)
- A SATS channel
- An edge node that connects TA channels and the SATS channel (as shown in the diagram)
- The edge node performs asset exchange (SATS ↔ TA) based on quotes from a price oracle.
Scenarios we are dealing with
- Invoice logically for TA1 or TA2, but still created in SATS As a rule, invoices are always created in SATS
- SATS amount is calculated from the accepted quote from the price oracle
- Actual exchange (SATS → TA or TA → SATS) happens at the edge node
- Our goal is to track how much exchange actually happens at the edge node, specifically : at Edge-node
- How much SATS → TA exchange happened
- How much TA → SATS exchange happened
Edge cases we want to identify
- Receiver creates a TA1 invoice and sender also pays using TA1 (TA → TA, no exchange)
- SATS → SATS payments (no exchange)
- Distinguishing these from real exchange cases (TA ↔ SATS)
What we tried so far
1️⃣ SubscribeHTLC
When paying a 1500 SATS invoice via TA1, we receive three events:
1. HTLC created event
2. Preimage forward event
3. Settled event (FORWARD)
Example forward event:
{
"incoming_channel_id": "5031801714840961024",
"outgoing_channel_id": "5120553193939992576",
"incoming_htlc_id": "1236",
"outgoing_htlc_id": "663",
"timestamp_ns": "1767078140297267508",
"event_type": "FORWARD",
"forward_event": {
"info": {
"incoming_timelock": 4811388,
"outgoing_timelock": 4811308,
"incoming_amt_msat": "1501001",
"outgoing_amt_msat": "1500000"
}
}
}
Problem:
- Incoming channel with id 5031801714840961024 is a TA channel, but amounts are still reported in msats and in actual 354 sats are send by the Litd node and TA worth 1501001 msat send by the sender
- No indication of which asset actually flowed
This RPC does not fully meet our requirements.
the actual channel 5031801714840961024 is taproot asset channel as we can see below channel details get from listchannels
{
"active": true,
"scid": "5031801714840961024",
"local_balance": "32004",
"remote_balance": "67092",
"custom_channel_data": {
"funding_assets": [*],
"local_assets": [
{
"asset_id": "TA1",
"amount": 51243843172
}
],
"remote_assets": [
{
"asset_id": "TA1",
"amount": 48756156828
}
],
"outgoing_htlcs": [],
"incoming_htlcs": [],
"capacity": 100000000000,
"local_balance": 51243843172,
"remote_balance": 48756156828,
"outgoing_htlc_balance": 0,
"incoming_htlc_balance": 0
}
}
2️⃣ ForwardingHistory
For the same invoice (HTLC ID 1236), we get:
{
"timestamp": "1767078140",
"chan_id_in": "5031801714840961024",
"chan_id_out": "5120553193939992576",
"amt_in": "1501",
"amt_out": "1500",
"fee": "1",
"fee_msat": "1001",
"amt_in_msat": "1501001",
"amt_out_msat": "1500000",
"timestamp_ns": "1767078140573202673",
"incoming_htlc_id": "1236",
"outgoing_htlc_id": "663"
}
Issues:
- Incoming channel is a TA channel, but values are shown as SATS/msats
- It’s unclear how SATS can be “incoming” from a Taproot Asset channel
- We don’t see any asset-level context here
Question:
Is there any RPC (or planned RPC) that exposes asset-level / custom channel forwarding data at the edge node?
3️⃣ SubscribeRfqEventNtfns
At the edge node, when paying a SATS invoice (1800 SATS) from TA1:
{
"accept_htlc": {
"timestamp": "1767160617000000",
"scid": "17665611975932885740"
}
}
At Edge node we can't conclude anything by this Event to meets our requirement
I tried same RPC At the sender node, for the same flow, we see:
{
"peer_accepted_sell_quote": {
"timestamp": "1767160910878736",
"peer_accepted_sell_quote": {
"peer": "03485565265f26aa58b216787d8ea89b5038d11a4c5f0daa308d765af3cc1021b6",
"id": "rO14UwpWbygtTrv4qhukLdwOlt/NnhYa9m/7RdOlNwk=",
"scid": "17757688133067290377",
"asset_amount": "1688822",
"bid_asset_rate": {
"coefficient": "89355710000",
"scale": 0
},
"expiry": "1767161210850",
"min_transportable_msat": "354001",
"price_oracle_metadata": "",
"asset_spec": null
}
}
}
Problem at sender side:
- Sender does not know whether the receiver received SATS or a Taproot Asset
- similarly Receiver does not know whether the invoice was settled using SATS or a Taproot Asset
- Invoice is always a SATS invoice, so asset context is missing on both sides
- therefore Sender node and Receiver node would not helps us to achive our goal so we have to always make target to Edge node
Core problem
- Both sender and receiver lack enough context
- Edge node forwarding data exposes only SATS-style accounting, even for TA channels
What we are looking for
1. A reliable way to detect and measure actual asset exchange at the edge node
2. A way to identify non-exchange cases (TA1→ TA1,TA2→TA2, SATS → SATS)
3. Any existing RPCs, events, or best practices to correlate:
Any pointers, RPCs we may have missed, or design suggestions would be really appreciated.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status