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

blip-29: enhance tap_rfq with in_asset_id, out_asset_id #3

Closed
wants to merge 1 commit into from

Conversation

ffranr
Copy link

@ffranr ffranr commented Apr 11, 2024

Towards solving lightninglabs/taproot-assets#859

Refactors tap_rfq to support explicit asset identification for both incoming and outgoing assets in RFQ requests. Previously, tap_rfq implied BTC as one of the assets in a swap, limiting asset flexibility. The introduction of in_asset_id and out_asset_id enables clear directionality for swaps, indicating the asset to send and to receive.

This update mandates that either in_asset_id, or out_asset_id, or both must be specified. If one is omitted, BTC is assumed as the default asset for the unspecified direction.

Refactors `tap_rfq` to support explicit asset identification for both
incoming and outgoing assets in RFQ requests. Previously, `tap_rfq`
implied BTC as one of the assets in a swap, limiting asset flexibility.
The introduction of `in_asset_id` and `out_asset_id` enables clear
directionality for swaps, indicating the asset to send and to receive.

This update mandates that either `in_asset_id`, or `out_asset_id`, or
both must be specified. If one is omitted, BTC is assumed as the default
asset for the unspecified direction.
@@ -924,21 +924,26 @@ accept if favorable

##### Request For Quote (`tap_rfq`)

When a receiver wishes to receive `N` units of TAP asset ID `asset_id`, a new
When a receiver wishes to receive `N` units of TAP asset ID `in_asset_id`, a new
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Term here assumes only receiver, but now can be receiver/sender based on the new fields below.

p2p message `tap_rfq` is sent with the following structure:

1. type: ?? (`tap_rfq`)
2. data:
* [`32*byte`:`rfq_id`]
* [`32*byte`:`asset_id`]
* [`32*byte`:`in_asset_id`]
* [`32*byte`:`out_asset_id`]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing it laid out now, do we also need to split the asset_amt field as well?

Before this change, asset_amt here was the amount of USD (or w/e) tied to the invoice. So we were asking for a price quote in BTC/asset_id.

My interpretation now is that if you only specify in_asset_id (assume USD-X), then in the LN setting, it's a quote for receiving asset_id. If you only specify out_asset_id, then in the LN setting, it's a quote for sending asset_id.

Does that match your interpretation? Perhaps we can make it a bit more concrete by outlining some typical user flows near the end of the document.

@ffranr
Copy link
Author

ffranr commented Jul 24, 2024

Closed in favour of #4 which will include all RFQ changes.

@ffranr ffranr closed this Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants