-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Offers #802
Comments
In offers to buy, can people include change so they an use input uxos of any size? |
This but also for inscriptions |
@cryptoquick This actually covers inscriptions! Since inscriptions are on sats, which transfer using the ordinals protocol, offers to buy and sell individual sats work for inscriptions. (UX obviously needs to be there too!) |
One of the things I think is critical for the design of this feature is that 3rd-parties can be optionally designated as recipients in the transaction. Most notably:
Ordinals will have the same issues as Ethereum in enforcing these, but both of those fees are massive forces for good and we should design offers to support them from the get-go Because if tool-builders and artists know they can participate in the ongoing economy, you'll see an incredible amount of work poured into the ecosystem |
@cryppadotta As far as I can tell, there is no way to implement royalties in an enforcable, technically reasonable way. See https://github.com/casey/ord/discussions/773 for some discussion we've been having on the topic. |
Offers could certainly include a "tip" output to a third-partty, and venues (marketplaces, artist home pages, discords), etc could require that an offer file contain a tip in order to show it one the homepage, etc. I think this would be great. Offers are simple and flexible enough that we can add this in a v2 version. So I think no need to worry about it in the MVP. Offers are off-chain, and easy to upgrade! |
What are the options for writing more protocols around Ordinals - bitcoin script only? Or is it possible to use sapio, stacks/clarity? (or anything else like that). Thanks! |
I know you've taken a look at Chia and ChiaLisp @casey but not sure if you've dived into how Offers are implemented there that may offer some ideas: https://chialisp.com/offers/ The defined NFT1 standard also enforces royalties on-chain via the transfer function part of the standard NFT1 program @cryppadotta There are differences between Chia's coin set model vs Bitcoin's UTXO namely Chia's use of BLS enables signature aggregation in a better way than Schnorr but I'm not sure if there are other shortcomings in Bitcoin Script that makes a similar implementation not possible... |
Stacks is has a separate token, and is only thematically related to Bitcoin, so it and clarity will never be supported. Sapio is an excellent project, and although I believe that @JeremyRubin is no longer working on it, it is open source and someone dedicated could pick up the torch. Sapio would be a great fit for filling in the gaps in Bitcoin Script for markets and services related to ordinals. |
Thanks for the link! I have looked at offers, and they definitely seem similar to what we want to do here.
Royalties cannot be enforced on-chain, because the buyer and the seller can simply use another channel to perform the actual transfer of funds, and lie on chain about the actual sale price. Until I see a good implementation proposed that does not have this and other problems, I do not plan to add any royalty related functionality to
Offers as sketched out don't really use script, only input and output selection, but I would be curious if something is missing. The coin set model and the UTXO model are pretty much the same, so I often actually use the "coin set" terminology when describing bitcoin, because "output" is a pretty unfamiliar term to most people 😅 |
Well of course one can always get around royalties if you are okay with some level of trust. At the extreme I can sell you my private key to my wallet containing the NFT in exchange for cash and no information will take place on chain. The point with on-chain royalties (on Chia) is to create a standard where royalties are enforced when trustless Offer Files are used to exchange assets that follow that standard.
Fair point. BLS aggregation also opens the door to things like aggregation of Offers so multiple can be taken simultaneously. A bit off topic but I heard your interview on Bankless and was intrigued by how you think tokens (like ERC-20 or CAT1 on Chia) can be implemented in a similar way. I think that's what would make Offers very exciting if its utility can go beyond just BTC for ordinal trades (or ordinals for ordinals). |
Someone can probably figure out trustless atomic swaps to remove trust and still use offer files. I want to avoid a scenario where we advertise that we have royalties to artists, but then as the amount of the value in the system increases, it becomes a confusing and chaotic race to the bottom like we're seeing in Ethereum.
I think there's an issue open for fungible ordinals. I'm not sure how to support that, but we could add a metadata field to an inscription that said "the next N sats after this inscription" are fungible tokens. Support in |
@SlowestTimelord Check out #787, I just copied my last comment there. |
Sapio would only need minor changes to support basic ord functionality, but the biggest issue would be convention around fees probably. |
question about incentives: |
Yup, that is correct. Seller should set the price such that it's close to what sellers are willing to pay. If it's below what sellers are willing to pay, then they will increase their "bid" by adding fees, which will go to miners. There are probably a bunch of different auction mechanism, where the value is split in different ways between miners and sellers. On the one hand, you have the #1611 method, where miners get all bids. On the other hand, you have a descending price auction where the seller continually releases PBSTs with lower and lower prices until someone takes it and pays EV - FEE to the seller, where EV is expected value, and FEE is what's required to get it mined, which goes to the miner. |
Something like this:? const bitcoin = require("bitcoinjs-lib"); const mnemonic = "a random mnemonic phrase used as seed for BIP32"; const network = bitcoin.networks.testnet; let psbt = new bitcoin.Psbt({ network }); psbt.addInput({ psbt.addInput({ psbt.addInput({ psbt.addOutput({ psbt.signInput(2, keyPairC, null, bitcoin.Transaction.SIGHASH_SINGLE | bitcoin.Transaction.SIGHASH_ANYONECANPAY); const partiallySignedPsbt = psbt.toBase64(); // Maker broadcasts PSBT psbt = bitcoin.Psbt.fromBase64(partiallySignedPsbt); psbt.addOutput({ psbt.signAllInputs(keyPairB); const signedTransaction = psbt.finalizeAllInputs().extractTransaction().toHex(); // Taker broadcasts transaction // When transaction is mined, maker receives ordinal sats in Y for payment, taker receives cardinal sats in X |
I think the script should use "p2tr" because ordinals are inscribed in the p2tr scripts. |
The latest version of libwally has it, if iiuc. https://github.com/ElementsProject/libwally-core/releases/tag/release_0.8.8 |
Oh that's not consumer grade wallets tho. Yeah no, it'll probably be a good bit before they update. |
If you wanted to play around with it though, that'd be a decent way to try it out. |
There's a really bad bug in the Bid flow fyi, cc @casey. This line is problematic.
Given
SIGHASH_SINGLE on C is equivalent to SIGHASH_NONE. Yikes... The transaction should instead be constructed as follows:
This makes the original instruction correct. Edit: Just realized this doesn't work at all, you'd have to use SIGHASH_SINGLE|SIGHASH_ANYONECANPAY on the signature for C. Otherwise A can't be updated later. Oh just noticed the "Offer to buy is wrong but can be fixed."... except I don't think it can with existing sighash flags and zero-rounds of communication; multiround PSBTv2 or an input version of SIGHASH_GROUP (or OP_TXHASH) i think will fix. Gonna use this as an opportunity to shill @base58btc classes, we cover how SIGHASH works in our in-person classes ;) https://base58.info
PSBTv2 and +1 round trip fixes this iiuc; you separate the compose phase from the sign phase, which lets you use SIGHASH_ALL to sign. This prevents anyone from outbidding you once broadcast. |
In the Asks sections for this shouldn't it say that : Taker adds inputs A and C and output X and finalizes transaction? Being that: Also, could someone please explain why the Dummy UTXO is needed and why it needs to be empty or have less than 1000 Sats? Any help great appreciated! |
Dummy UTXO is required for SIGHASH_SINGLE, so the inputs/output indexes of the maker get lined up/covered for their signature (B + Y have same index position in their respective lists) |
Thank you but I still don't understand this, need to study this more; some diagrams would help! |
Did an inscription swap without dummy UTXO:
Note: Order of inputs and outputs is important however |
Does this not work (for the "buy sats" case discussed above)? 0v = zero value dummy utxo
Then maker can SINGLE|ACP sign over input B with safety right?
Yeah I haven't thought it through at all but I could well imagine all this "jigsaw piece" stuff with single|acp is academic if you start thinking about markets. |
Yeah I think that works nicely. You'd want to use just SIGHASH_SINGLE as originally suggested though, otherwise anyone could swap out the other ordinal input, and change what you're buying. (I hadn't realized it til I saw this tweet, but the ordinal input/output needs to go at the top to make it work out) You can make SIGHASH_ALL work for it and remove the 0v dummy output if the maker's pay-to address is known at the time you're constructing the offer to buy. |
Oh yes, good catch! Huh, interesting that it's different this way round, because the "special" ordinal input isn't owned by the signer at the start. It's interesting how many dimensions these setups have.
Still struggling with this one 😄 Did you mean taker, not maker there (i.e. the guy who has the ordinals and is accepting the offer to buy them?). I guess in case where all inputs and outputs are known in advance then none of this shenanigans is necessary right? You just ALL all of it in the usual way like a traditional coinjoin (except, where the ordering is fixed and no privacy is achieved). |
Yeah exactly :D |
I am trying to write a spec for PSBT to be used in any inscription swap:
Let me know if you have any feedback or opinions |
I don't understand why this is required.
Why not just reorganize to be
Now EDIT: Explained by @niftynei and @rot13maxi . Thank you! For other readers i highly suggest reading the ordinal BIP |
iiuc you're missing how ordinals flow/are reassigned to the outputs from the inputs. The person buying the ordinals needs their address to be at output 0, so they get the sat that the inscription is associated with. |
@niftynei has it. Sats get assigned to outputs in the same order that they are provided as inputs. So if the first sat of the first input is an inscription or otherwise desirable sat (rare/exotic?), then it will go to the first sat of the first output. If the seller provides the first input and the first output with SINGLE|ANYONECANPAY, they will just be sending that sat to themselves. |
@rot13maxi thanks for the helpful answer... |
Yes, 0 value OP_RETURN outputs are valid and standard. |
Hey folks. What's the safest way to parse out sats without messing up dummy utxo for ordinals ? So that you can inscribe a specific art to a specific sat and sell it eventually. What's the best known method for creating dummy UTXO's today? |
@ep150de you should create a Discussion or a new Issue for that. Sounds related but separable |
Could you offer the detailed solution, hard for me to understand. Thanks! |
I have started working on a marketplace which uses multisig instead of SIGHASH_SINGLE | ACP and there is no conceot of dummy UTXO |
In practice, how do you create a zero-value output? I understand that OP_RETURNs can be created, but OP_RETURNs are not spendable right? It seems instead a practical path is to use two small dummy utxos, like they do here: https://github.com/magiceden-oss/msigner So that the final transaction looks like this: Inputs: Outputs With this flow, the maker signs with sighash-single | anyone-can-pay on input/output # 2 and broadcasts that PSBT, then the taker can come along and add all their inputs and outputs and sign with Sighash-All Am i understanding correctly? |
This doesn't need to be done for mainnet, but we need to make sure that it can be done eventually.
Ask: Offer to sell sats
Inputs
Outputs
Steps
SIGHASH_SINGLE | SIGHASH_ANYONECANPAY
. Due to A, B and Y have same indexBid: Offer to buy sats
Inputs
Outputs
Steps
SIGHASH_SINGLE
Notes:
Related:
The text was updated successfully, but these errors were encountered: