Open jeroz1 opened 3 years ago
Some brainstorm thoughts from Blondfrogs:
Would be an awesome feature to have a running pool of signed partials built-in to the nodes, would enable direct client integration and easily support future rpc commands like getswaps
or something similar.
A signed partial can pass a validity test before being accepted, quick criteria would be
SINGLE|ANYONECANPAY
Note: this effectively makes the VIN UTXO a unique identifier for an order as well since those are unique themselves.
For context a signed partial is about 192 Bytes (varies a little it seems), so 1MB of memory could store ~5.5k signed partials in an ideal case.
The biggest outstanding question to me, is how to handle the situation where a second order for the same UTXO comes into the pool, what behavior should be allowed and how bad is the surface area for manipulation if we have a mechanism for updating orders. (ie: miners could change their logic to ignore sale-order resubmissions at a higher listing price for example. the old signed partial is valid as long as the UTXO is, so they could just execute the old one instead of the newer more expensive one)
- On each node, you should check the transaction to see if there is an input that belongs to your wallet. If there is, you should store it. Showing a notification or flag to the user, so they can sign it.
The signed partial only has the single VIN from the creating party on it, so a user's wallet would have to check "do I have enough funds/assets to meet the require VOUT" to determine if they can sign it, at which point they add their side of inputs/outputs, and sign/complete the transaction. Which means they would see a LOT of orders, anything that have enough RVN to purchase.
I wonder if some kind of query + subscribe/notify system would be needed where a user could specifically look at an asset's buy/sell orders (remember quantities are fixed, so you might not always take bid price) and/or even subscribe to updates (which would allow for client-sided limit orders)
It is possible to custom-write an extension to the bitcoin p2p protocol for this purpose as BF describes. But a few years ago I remember there was a proof-of-concept done for bitcoin-cash to show that it was fairly straight-forward to apply Libp2p (which is what IPFS uses for p2p communication) to the bitcoin network for a variety of add-on applications. That provides a lot of capability out-of-the-box.
The project is still here: https://github.com/bonedaddy/overlaynetwork And Libp2p is here: https://docs.libp2p.io/
I'd like to request for nodes to allow sending partial txes to each other.
This allows a decentralized store for atomic swap buy and sell orders. Any node that is enabled to receive and send these txes could see them and allow users to pick them up and complete them if they want to take this buy or sell order.
Once the tx is complete, miners can grab them and write them into blocks on the chain.
Discuss! :D