You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the closure of PR #4280, I'd like to start a discussion around adding asynchronous PSBT sell offer capabilities to ord wallet, initially for runes and later for inscriptions.
PSBT Specification
Sell Offer PSBT
A PSBT sell offer consists of a single input and output. The input UTXO holds the offered runes, and the output value equals the input value plus the value required to sell the runes. The input UTXO is signed using the sighash SINGLE|ANYONECANPAY.
Finalized PSBT
The finalized funded PSBT has the following structure:
Input 0: The buyer's input (signed with ALL)
Input 1: The seller's input (signed with SINGLE|ANYONECANPAY)
Input 2+: Additional buyer inputs needed to fund the transaction
Output 0: The buyer's receive output (with postage)
Output 1: The seller's output
Output 2: The buyer's change output (if non-dust)
Runes transfer to the first output by default, so this structure ensures that the seller's runes land on the buyer's receive output, without needing an OP_RETURN in the transaction.
CLI Interface
This feature would add a new subcommand async-offer which can accept any Outgoing. The initial implementation will accept only Outgoing::Rune, with support for Outgoing::InscriptionId to follow in a subsequent PR.
Creating a Runes Sell Offer
A user can offer to sell the rune balance <DECIMAL:RUNE> for AMOUNT using:
ord wallet async-offer create --outgoing <DECIMAL:RUNE> --amount <AMOUNT>
This will generate a partially signed bitcoin transaction (PSBT), which the user can broadcast for anyone to fund and sign.
In the initial implementation, the user may only offer to sell an amount of runes <DECIMAL:RUNE> that equals the exact rune balance in a UTXO in their wallet.
Accepting a Runes Sell Offer
A user can accept the offer in PSBT to sell at least <DECIMAL:RUNE> for AMOUNT using:
ord wallet async-offer accept --outgoing <DECIMAL:RUNE> --amount <AMOUNT> --fee-rate <FEE_RATE>
Additional Thoughts
I included several additional features in PR #4280, which might make sense to discuss if/when rune sell offers get implemented. These features include:
Accept a PSBT with multiple sub-offers for the same rune (i.e. multiple inputs signed with SINGLE|ANYONECANPAY with corresponding outputs)
Create a PSBT with multiple sub-offers (with each sub-offer made at the same price per rune)
Create a PSBT offering the maximum exact balance at or below a given target
Request for Feedback
Is PSBT sell offers something the community wants implemented in ord? I recognize there are concerns about mempool sniping and MEV.
Is there a more efficient way to format the PSBT?
How do we feel about creating a new subcommand async-offer that is distinct from the existing offer subcommand? The idea is to make it clear that the existing offer command is for synchronous trades between a buyer and a seller where all the inputs are signed with sighash ALL.
The text was updated successfully, but these errors were encountered:
Following the closure of PR #4280, I'd like to start a discussion around adding asynchronous PSBT sell offer capabilities to
ord wallet
, initially for runes and later for inscriptions.PSBT Specification
Sell Offer PSBT
A PSBT sell offer consists of a single input and output. The input UTXO holds the offered runes, and the output value equals the input value plus the value required to sell the runes. The input UTXO is signed using the sighash SINGLE|ANYONECANPAY.
Finalized PSBT
The finalized funded PSBT has the following structure:
Input 0: The buyer's input (signed with ALL)
Input 1: The seller's input (signed with SINGLE|ANYONECANPAY)
Input 2+: Additional buyer inputs needed to fund the transaction
Output 0: The buyer's receive output (with postage)
Output 1: The seller's output
Output 2: The buyer's change output (if non-dust)
Runes transfer to the first output by default, so this structure ensures that the seller's runes land on the buyer's receive output, without needing an OP_RETURN in the transaction.
CLI Interface
This feature would add a new subcommand
async-offer
which can accept anyOutgoing
. The initial implementation will accept onlyOutgoing::Rune
, with support forOutgoing::InscriptionId
to follow in a subsequent PR.Creating a Runes Sell Offer
A user can offer to sell the rune balance
<DECIMAL:RUNE>
forAMOUNT
using:This will generate a partially signed bitcoin transaction (PSBT), which the user can broadcast for anyone to fund and sign.
In the initial implementation, the user may only offer to sell an amount of runes
<DECIMAL:RUNE>
that equals the exact rune balance in a UTXO in their wallet.Accepting a Runes Sell Offer
A user can accept the offer in
PSBT
to sell at least<DECIMAL:RUNE>
forAMOUNT
using:Additional Thoughts
I included several additional features in PR #4280, which might make sense to discuss if/when rune sell offers get implemented. These features include:
Request for Feedback
ord
? I recognize there are concerns about mempool sniping and MEV.async-offer
that is distinct from the existingoffer
subcommand? The idea is to make it clear that the existingoffer
command is for synchronous trades between a buyer and a seller where all the inputs are signed with sighash ALL.The text was updated successfully, but these errors were encountered: