Conversation
|
Everything is looking good right now, just few things we might consider adding:
The taker/maker separation is clean and the scoring logic makes sense. |
0783917 to
3fb4271
Compare
|
went thru a messy rebase bc of #14 . will look thru history and clean it up again |
885e280 to
7e3e43f
Compare
Miner addr
Given an order book of UTXOs and a takers utxos which order book utxos we generate a list of cospends candidates.
To maker and taker
This action costs more if you have payment obligations. Or if you already have a input registered. In the future this can be smarter and internalize the cost of registering specific inputs with respect to the po's and privacy budget.
As its replaced by create cospend. And explicitly assign cost to accepting the co spend.
Return registered inputs from order book
Mark po's as success if they are handled in the a cospend.
This commit also folds all action outcomes into on Outcome struct which defines how the wallet state has changes. This allows us to reconcile cost terms to one metacost function and eval global wallet changes in one place.
As its replaced by create cospend methods
First run all unilateral actions available to a strategy, find what inputs are common in all plans, register than inputs.
| BatchSpend(Vec<PaymentObligationId>), | ||
| /// Pay a payment obligation while consolidating all UTXOs into change | ||
| ConsolidateSelf(PaymentObligationId), | ||
| UnilateralPayments(Vec<PaymentObligationId>, CoinSelectionStrategy), |
There was a problem hiding this comment.
For future work: This may need happen at two level:
generate different alt payment sequences
and then if these look good then we decide on coin selection.
You may want to consider different coin selection strats for a specific payment.
| BatchSpend(Vec<PaymentObligationId>), | ||
| /// Pay a payment obligation while consolidating all UTXOs into change | ||
| ConsolidateSelf(PaymentObligationId), | ||
| UnilateralPayments(Vec<PaymentObligationId>, CoinSelectionStrategy), |
There was a problem hiding this comment.
This action should fully define what inputs are going to be spent. Coinselection strat should be evaluate before
| .collect() | ||
| }) | ||
| .collect(); | ||
| let common_input: Option<Outpoint> = per_action_spent |
There was a problem hiding this comment.
TODO comment for picking your "luckiest" coins per the random beacon strategy https://gist.github.com/nothingmuch/f5b9a559958c6116606d9da0d4d884f2
| .collect() | ||
| }) | ||
| .collect(); | ||
| let common_input: Option<Outpoint> = per_action_spent |
There was a problem hiding this comment.
The distinction between maker and taker should be removed.
Orderbook utxos are utxos that capture some metadata including: amount and owner.
7e3e43f to
504e821
Compare
Confirmed or broadcasted
504e821 to
bd8737d
Compare
|
In its current state this PR implements the maker, taker and aggregator roles. |
All order book entries are considered atm. Takers will want to be selective and assign a payoff to each order book entry. At somepoint the cospend will be "good enough" (this will vary by wallet preference). Makers will register their input. The cost should consider their current payment obligation's deadlines.
In this current state the taker will prefer orderbook inputs that are closer in magnitude to its own inputs that it picked. I think we are missing two angles here:
other todos (maybe for future Prs):