Skip to content

Propose co spends #12

Draft
arminsabouri wants to merge 7 commits intomasterfrom
create-co-spends
Draft

Propose co spends #12
arminsabouri wants to merge 7 commits intomasterfrom
create-co-spends

Conversation

@arminsabouri
Copy link
Copy Markdown
Collaborator

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:

  • Takers run BNB and then consider orderbook utxos. But they could pick other utxos that BNB would not select that would be "closer" to the a subset of order utxos.
  • Maybe there are no good order book utxos. The cost needs to be considered and if its high enough the take should then prefer a unilateral batch.

other todos (maybe for future Prs):

  • change decomposition
  • counter party payoffs (how much does a taker prefer a orderbook utxo -- privacy budget)
  • ensuring monotonic decreasing cost as information is learned. Given the inputs in the cost spend and my own decomposition, I should be happy with subset sum density. And new information (output registration) should not worsen subset sum desnsity. TBD

@0xZaddyy
Copy link
Copy Markdown
Contributor

Everything is looking good right now, just few things we might consider adding:
in the cospend.rs file, the generate_candidates function assumes all entries are valid

  • i think adding a filter to check for spent/invalid UTXOs before scoring will be necesaary.
  • also a check for duplicates if a UTXO appears multiple times in order book.

The taker/maker separation is clean and the scoring logic makes sense.

Given an order book of UTXOs and a takers utxos which
order book utxos we generate a list of cospends candidates.
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.
@arminsabouri arminsabouri force-pushed the create-co-spends branch 2 times, most recently from 0783917 to 3fb4271 Compare April 2, 2026 20:31
@arminsabouri
Copy link
Copy Markdown
Collaborator Author

went thru a messy rebase bc of #14 . will look thru history and clean it up again

Mark po's as success if they are handled in the a cospend.
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