-
Notifications
You must be signed in to change notification settings - Fork 121
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
[feature]: create RFQ wire messages #780
Comments
On the I don't we're representing expiry optimally. Right now, I think we should have a field called |
I don't understand the motivation for the |
I think |
In choosing the custom message type numbers we might want to consider doing the following: Custom message types start at Using that offset, the quote request message can have type |
On I think I think the word "tick" has a particular meaning in finance that confuses what we're trying to explain here. We could use the word
We might also want to also consider adding a scaling exponent field ( (Similarly for |
These comments are also on the BLIP PR: lightning/blips#29 @Roasbeef please let me know what you think when you have time. |
I think that makes sense. No strong feelings around renaming or not, but this was the intended semantics. Consider that any price quote returned from the
The intent was to authenticate the data, which can also allow portions of the implementation to be more stateful. They can just keep track of the set of relevant IDs, then verify incoming signatures of the quotes send in the onion payload. This was for an earlier version of the system though, and then I realized we can just move into using the I think we can leave it on for now, and just not specify it. But then specify that if present in the TLVs, then it should be verified against the TLV serialization with the sig field stripped out.
I think an error code w/ some optional metadata is better as we're able handle the error code programmatically vs needing to parse out some custom fields.
What does this achieve? I don't think we need to pin down the exact numbers until later in development, as we'd move closer to finalizing the bLIP. No strong feelings at all on exactly what integer range the messages take on. At present, we have no issues re protocols colliding that integer range.
Seems minor, this is something pretty deep in the protocol. We can get feedback on the API level if needed, though it wouldn't be visible there, as we'd convert w/e rate into the tick format.
Good point. I think an open question is: exactly how much precision is actually needed? For USD quotes, you maybe just need up to 3 or 4 decimal places. |
Parent issue: #683
In this issue we finalise the RFQ wire messages golang package. Here's what we currently have in the BLIP:
Request For Quote (
tap_rfq
)When a receiver wishes to receive
N
units of TAP asset IDasset_id
, a newp2p message
tap_rfq
is sent with the following structure:tap_rfq
)32*byte
:rfq_id
]32*byte
:asset_id
]BigSize
:asset_amt
]BigSize
:suggested_rate_tick
]where:
rfq_id
is a randomly generate 32-byte value to uniquely identify this RFQrequest
asset_id
is the asset ID of the asset the receiver intends to receiveasset_amt
is the amount of units of said assetsuggested_rate_tick
is the internal unit used for asset conversions. A tickis 1/10000th of a currency unit. It gives us up to 4 decimal places of
precision (0.0001 or 0.01% or 1 bps). As an example, if the BTC/USD rate was
$61,234.95, then we multiply that by 10,000 to arrive at the
usd_rate_tick
:$61,234.95 * 10000 = 612,349,500
. To convert back to our normal rate, wedecide by
10,000
to arrive back at$61,234.95
.Given valid
rfq_id
, we then define antap_rfq_scid
by taking the last8
bytes of the
rfq_id
and interpreting them as a 64-bit integer.Accepting Quotes (
tap_rfq_accept
)If it can, then it should send
tap_rfq_accept
that returns the quote amountthe edge node is willing to observe to move
N
units of assetasset_id
:tap_req_accept
)32*byte
:rfq_id
]BigSize
:`accepted_rate_tick]BigSize
:expiry_seconds
]64*byte
:rfq_sig
]TODO(roasbeef): tlv err where?
where:
rfq_id
matches the existingrfq_id
of a settap_rfq
accepted_rate_tick
is the proposed rate for the volume unit expressed inthe internal unit of a
tick
.expiry_seconds
is the amount of seconds to use for the expiry of both thequote and the invoice
rfq_sig
is a signature over the serialized contents of the messageRejecting Quotes (
tap_rfq_reject
)In the event that an edge node is unable to satisfy a quote request, then they
should send
tap_rfq_reject
, identifying the rejected quote ID. A quote mightbe rejected if the channel cannot accommodate the proposed volume, or if the
edge node is unwilling to carry any HTLCs for that
asset_id
.tap_req_accept
)32*byte
:rfq_id
]where:
rfq_id
is the quote ID that they wish to rejectThe text was updated successfully, but these errors were encountered: