Bruce
22 posts

Bruce
@sinotrinity
Bitcoin builder since 2017. Founder of @op_catlayer #OPCAT

首个真正意义上的CAT20应用落地! @dot_swap 上线了 #CAT20 的订单簿交易市场! dotswap.app/i/catMarket 那么CAT20协议和Runes、BRC20这些协议交易上到底有什么不一样呢? 交易原理 Runes、BRC20协议:在挂单过程中,卖家会签署一个部分签名比特币交易(PSBT),这相当于完成了交易的一半。当用户进行购买时,买方会签署PSBT的另一半,两个部分合并成一个完整的签名交易。 CAT20协议:在用户挂单过程中,他们会将CAT代币转移至智能合约地址。该合约设定了代币的解锁单价。只有当卖方确认收到付款,合约才会根据交易金额,将相应数量的CAT代币释放给买家。 CAT20的优势 完全的去中心化。Runes的PSBT是由交易市场保管的,如果MagicEden愿意,它完全可以操控价格,只放出高价的PSBT,自己偷偷把低价的PSBT匹配购买了。之前早期交易就出现过,即便用户提高了挂单价格,订单仍可能以原先的低价成交,因为原始的低价PSBT可能被他人保存并随时可以签名。相比之下,CAT20的所有交易均由智能合约执行,有效杜绝了中间人干预。 自定义购买数量。CAT20支持用户自定义购买数量,面对大额代币订单,买家可以选择购买其中的部分数量。这种灵活性在Runes中是不存在的,Runes要求买家必须一次性购买整个订单。 支持买单。进一步增强了市场的双向流动性。不过目前dotswap还没上线这个功能。







Part 1: How marketplaces work Part 2: Your buys not executing and full-RBF PART 1 To understand what happens with RBFs and your buys, we first need to understand how the PSBTs from the current marketplaces work. 1. How #Bitcoin and UTXOs work Each Bitcoin transaction contains certain inputs (money in) and certain outputs (money out). When a UTXO (unspent transaction output) gets into a transaction it is considered "spent" and it cannot participate in any future transactions. When I want to send 0.5 Bitcoin from A to B, I might involve 2 utxos in that transaction (let's say 0.3 and 0.4 Bitcoin). I build a transaction with these two utxos as inputs, a 0.5BTC output to wallet B and 0.2BTC ( the change ) back to wallet A. This is how every blockchain involving UTXOs works. 2. The PSBT signed by the seller If you picture every UTXO as a bundle of specific satoshis (according to the FIFO tracking of the #Ordinals theory), then your inscription is in one of these bundles. When you want to sell an asset in a trustless manner, you sign a PSBT with SIGHASH_SINGLE|ANYONECANPAY. What that means is that you agree to involve that UTXO (that contains the asset) in a transaction (as input) if and only if you get an output with the desired amount of BTC back. The SIGHASH_SINGLE means that you sign for a single input/output pair (involve the utxo with the ordinal and receive a utxo with x amount). The ANYONECANPAY part means that the output can be created by any Bitcoin address, as long as it has the desired amount. IMPORTANT!!! SIGHASH_SINGLE|ANYONECANPAY doesn't put any restriction on how the rest of the transaction looks. 3. The PSBT fulfillment process After the seller signs that input/output pair, it sends it privately to the marketplace. Note that at this point, no one other than the marketplace has this signed PSBT. When the buyer decides to go for the trade, the marketplace gets the buyer to sign the other inputs of the transaction ( the full transaction is shown in the image below). Buyer signs the transaction, sends it to the marketplace and the marketplace puts together the full Bitcoin transaction and submits it. Note that the seller's signature isn't made public, not even to the buyer. It is only made available when the marketplace sends the full tx in the mempool. 4. Trade transactions and the reason we need padding utxos To conduct a trade with a single inscription, there are two requirements that need to be satisfied: - Signing with SIGHASH_SINGLE requires the signed input/output pair to be at the same offset in the inputs/outputs order. - Since the tracking of Ordinal Theory is FIFO (first in first out), if the inscription utxo enters the transaction after :1200 sats (as shown in the image below: inoput1 (600) + input2(600), then the inscription UTXO somewhere in the third input after the 1200 sats inserted by the first two inputs), it will also exit the transaction after :1200 sats. In other words, the output that goes to the buyer needs to have the same size as the inscription input and needs to be at the same offset Here's what padding UTXOs do: In order to have the buyer receive the inscription, while still having the input with the inscription at the same index as the output with the payment, we need two random inputs from the buyer on positions 0 and 1, and an output with the sum of these two inputs at index 0, so the output at index 1 can be reserved for the inscription (having the same number of sats as the input with the inscription and going to the buyer). By doing this, we can safely add the third output that pays the seller without worrying that the inscription will go back to the seller or to any other party. Input number 4, or subsequent inputs represent utxos used by the buyer to pay for the whole thing. Outputs 4-7: - pay the marketplace commission (output 4) - create two new padding UTXOs for the buyer (output 5 and 6) so there's no need to "prepare wallet" for future transactions - and return the remaining amount to the buyer (output 7), since the payment utxos usually amount to more sats than needed for the transaction Now that you've understood how the trades work, in PART 2, we'll dive into full-RBF and how it is done by third parties to overwrite your pending buys. If you find this information useful and are eager to know more about hijacking buys, please retweet (and maybe follow me, @const_quary, and turn 🔔 on). It motivates me to write these educational posts. See you soon! 🫡






"Craig Wright's "Negative Gamma" and the Curious Lack of Intellectual Curiosity in the Crypto Space" yours.org/content/191f72…





Tune in for the funeral

@WolfgangLohmann @scryptplatform @BSV_Assn @RealCoinGeek @MonkishRex @ProjectBabbage @shruggr @kurtwuckertjr youtube.com/live/K-VfNXeGh… There are four videos I think.











