-
Notifications
You must be signed in to change notification settings - Fork 23
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
Support Auction Swaps #430
Conversation
Hi, could you update the wasm api? |
Yes, I think I finishing it today. |
Suppose we have a seller who wanted to sell 5 items and wants to sell via sequential swap. Throughout operations, the UTXO related to assets may decrease to smaller fractions until it turns to dust. As the seller no longer changes the PSBTs after the start of the auctions (the coordinator manages it), I thought about making a "minimum satoshis for operation" rule for the RGB20 and RGB21 wallets, what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good work on this! I like the clarification on some of the terminology, like server -> marketplace and presig -> strategy. Also, good catch on realizing we're using PSBTv0. As you might know, there's no PSBTv1... Only v0 and v2.
I just have one issue with code organization in carbonado.rs... It's really making that file quite a bit more complex than it should be. If I had to guess, that logic is being put in the wrong place. Do you agree?
@@ -78,6 +83,43 @@ mod server { | |||
Ok((filepath, body)) | |||
} | |||
|
|||
pub async fn auctions_store( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to abstract this out so it's not in src/carbonado.rs
methods? Ideally this file would be cleaner and simpler, more focused and have less duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so, but I feel like it will lose some of its purpose. I centralized in this file all the calls that are sometimes made by the client and sometimes made by the server.
But yes, I can carry out another separation.
What do you guys think, @cryptoquick and @josediegorobles ? |
@crisdut We should always have an input from the buyer for paying fees and paying for the dust output. Also, there's no way to batch transfers with auctions because they're separate PSBTs, correct? That's fine so long as multiple sequences can be spent within the same block. |
* Update struts in typescript * Camel Case * Update structs * Live metrics (#435) * Switch to in-memory metrics. * Metrics fixes. * Also write metrics to disk as a backup. * Disable LN swaps tests since these often fail. (#437) * Update struct rgbofferresponse * Update lib/web/rgb.ts Co-authored-by: Armando CD <crisdut@users.noreply.github.com> --------- Co-authored-by: Hunter Beast <hunter@cryptoquick.com> Co-authored-by: Armando CD <crisdut@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Fix structs * Add methods to web.rs and update rgb.ts * Update web.rs Co-authored-by: Armando CD <crisdut@users.noreply.github.com> * Update rgb.ts Co-authored-by: Armando CD <crisdut@users.noreply.github.com> * Update rgb.ts Co-authored-by: Armando CD <crisdut@users.noreply.github.com> --------- Co-authored-by: Jose Diego Robles Pardo <jdrobpar@Joses-Laptop.local> Co-authored-by: Armando CD <crisdut@users.noreply.github.com>
Description
This PR intent supports sequential swaps and unifies the previous swap operations (now called "strategies").
Now, BMC have three ways to make swap operations:
Then, the coordinator updates the next available offer with the new UTXO (in case of the collections). All offers of the collections are publish and allow to receive bids.Also, It was necessary to carry out some refactorings to increase the maintainability of the swaps in BMC, according to the checklist below:
Sequential Swaps (epic)
HotSwap
instead ofpresig=false
flagP2P
instead ofpresig=true
flagAuction
to allow use coordinatorinternal_create_buyer_bid
to allow reuse stepinternal_create_seller_offer
to allow reuse stepbundle_id
create_auction_bid
to allow create bid (sequential swaps)create_auction_offers
to allow create one or more offers (collections in sequential swaps context)create_auction_offers
needs return all offers published in orderbooktapret commits
only DH (Diffie–Hellman) carbonado dataCloses #413
Closes #365
Closes #422
PS: I added #422 here because we can resolve all offers/bids in one "big" L1 transaction.