• bitcoinBitcoin (BTC) $ 69,131.00
  • ethereumEthereum (ETH) $ 2,468.56
  • tetherTether (USDT) $ 0.999660
  • bnbBNB (BNB) $ 559.55
  • solanaSolana (SOL) $ 163.22
  • usd-coinUSDC (USDC) $ 0.999888
  • xrpXRP (XRP) $ 0.503610
  • staked-etherLido Staked Ether (STETH) $ 2,467.69
  • dogecoinDogecoin (DOGE) $ 0.151723
  • tronTRON (TRX) $ 0.165171
  • the-open-networkToncoin (TON) $ 4.81
  • cardanoCardano (ADA) $ 0.335340
  • wrapped-stethWrapped stETH (WSTETH) $ 2,920.36
  • wrapped-bitcoinWrapped Bitcoin (WBTC) $ 69,021.00
  • shiba-inuShiba Inu (SHIB) $ 0.000017
  • avalanche-2Avalanche (AVAX) $ 23.64
  • wethWETH (WETH) $ 2,469.27
  • bitcoin-cashBitcoin Cash (BCH) $ 342.59
  • chainlinkChainlink (LINK) $ 10.82
  • usdsUSDS (USDS) $ 1.00
  • leo-tokenLEO Token (LEO) $ 6.01
  • suiSui (SUI) $ 1.93
  • polkadotPolkadot (DOT) $ 3.81
  • litecoinLitecoin (LTC) $ 67.17
  • nearNEAR Protocol (NEAR) $ 3.69
  • wrapped-eethWrapped eETH (WEETH) $ 2,595.87
  • aptosAptos (APT) $ 8.21
  • uniswapUniswap (UNI) $ 7.09
  • pepePepe (PEPE) $ 0.000008
  • internet-computerInternet Computer (ICP) $ 7.20
  • daiDai (DAI) $ 0.999815
  • bittensorBittensor (TAO) $ 440.75
  • fetch-aiArtificial Superintelligence Alliance (FET) $ 1.14
  • moneroMonero (XMR) $ 155.98
  • ethena-usdeEthena USDe (USDE) $ 1.00
  • whitebitWhiteBIT Coin (WBT) $ 18.94
  • kaspaKaspa (KAS) $ 0.108610
  • stellarStellar (XLM) $ 0.090832
  • ethereum-classicEthereum Classic (ETC) $ 17.90
  • first-digital-usdFirst Digital USD (FDUSD) $ 0.999018
  • polygon-ecosystem-tokenPOL (ex-MATIC) (POL) $ 0.302108
  • okbOKB (OKB) $ 37.45
  • blockstackStacks (STX) $ 1.48
  • dogwifcoindogwifhat (WIF) $ 2.08
  • filecoinFilecoin (FIL) $ 3.36
  • aaveAave (AAVE) $ 133.23
  • crypto-com-chainCronos (CRO) $ 0.071804
  • arbitrumArbitrum (ARB) $ 0.483099
  • mantleMantle (MNT) $ 0.563484
  • immutable-xImmutable (IMX) $ 1.10
  • optimismOptimism (OP) $ 1.44
  • celestiaCelestia (TIA) $ 4.48
  • render-tokenRender (RENDER) $ 4.46
  • thorchainTHORChain (RUNE) $ 5.09
  • fantomFantom (FTM) $ 0.594593
  • injective-protocolInjective (INJ) $ 16.95
  • hedera-hashgraphHedera (HBAR) $ 0.043067
  • vechainVeChain (VET) $ 0.019877
  • bitget-tokenBitget Token (BGB) $ 1.12
  • cosmosCosmos Hub (ATOM) $ 3.99
  • binance-peg-wethBinance-Peg WETH (WETH) $ 2,467.15
  • popcatPopcat (POPCAT) $ 1.36
  • mantra-daoMANTRA (OM) $ 1.37
  • sei-networkSei (SEI) $ 0.348812
  • the-graphThe Graph (GRT) $ 0.137098
  • rocket-pool-ethRocket Pool ETH (RETH) $ 2,760.26
  • bonkBonk (BONK) $ 0.000018
  • pyth-networkPyth Network (PYTH) $ 0.331714
  • jupiter-exchange-solanaJupiter (JUP) $ 0.886569
  • mantle-staked-etherMantle Staked Ether (METH) $ 2,581.03
  • flokiFLOKI (FLOKI) $ 0.000123
  • kucoin-sharesKuCoin (KCS) $ 9.00
  • gatechain-tokenGate (GT) $ 8.40
  • solv-btcSolv Protocol SolvBTC (SOLVBTC) $ 69,013.00
  • theta-tokenTheta Network (THETA) $ 1.05
  • worldcoin-wldWorldcoin (WLD) $ 1.74
  • makerMaker (MKR) $ 1,172.88
  • heliumHelium (HNT) $ 5.92
  • ethenaEthena (ENA) $ 0.337700
  • bitcoin-svBitcoin SV (BSV) $ 47.38
  • renzo-restaked-ethRenzo Restaked ETH (EZETH) $ 2,532.91
  • coinbase-wrapped-btcCoinbase Wrapped BTC (CBBTC) $ 69,118.00
  • algorandAlgorand (ALGO) $ 0.109229
  • arweaveArweave (AR) $ 13.84
  • ondo-financeOndo (ONDO) $ 0.625833
  • fasttokenFasttoken (FTN) $ 2.69
  • msolMarinade Staked SOL (MSOL) $ 200.96
  • raydiumRaydium (RAY) $ 3.27
  • lido-daoLido DAO (LDO) $ 0.961885
  • jasmycoinJasmyCoin (JASMY) $ 0.016957
  • beam-2Beam (BEAM) $ 0.015490
  • based-brettBrett (BRETT) $ 0.080689
  • matic-networkPolygon (MATIC) $ 0.302325
  • bittorrentBitTorrent (BTT) $ 0.00000081
  • cat-in-a-dogs-worldcat in a dogs world (MEW) $ 0.008541
  • usddUSDD (USDD) $ 1.00
  • ether-fi-staked-ethether.fi Staked ETH (EETH) $ 2,465.59
  • flowFlow (FLOW) $ 0.486197
  • tokenize-xchangeTokenize Xchange (TKX) $ 9.32
  • lombard-staked-btcLombard Staked BTC (LBTC) $ 69,012.00
  • aerodrome-financeAerodrome Finance (AERO) $ 1.09
  • coredaoorgCore (CORE) $ 0.800155
  • starknetStarknet (STRK) $ 0.345748
  • kaiaKaia (KAIA) $ 0.123574
  • pendlePendle (PENDLE) $ 4.46
  • galaGALA (GALA) $ 0.018027
  • bridged-usdc-polygon-pos-bridgeBridged USDC (Polygon PoS Bridge) (USDC.E) $ 0.999721
  • axie-infinityAxie Infinity (AXS) $ 4.48
  • mog-coinMog Coin (MOG) $ 0.000002
  • spx6900SPX6900 (SPX) $ 0.730013
  • tether-goldTether Gold (XAUT) $ 2,738.61
  • solv-protocol-solvbtc-bbnSolv Protocol SolvBTC.BBN (SOLVBTC.BB) $ 69,040.00
  • apecoinApeCoin (APE) $ 0.926711
  • ordinalsORDI (ORDI) $ 31.52
  • arbitrum-bridged-wbtc-arbitrum-oneArbitrum Bridged WBTC (Arbitrum One) (WBTC) $ 69,069.00
  • fraxFrax (FRAX) $ 0.995665
  • neoNEO (NEO) $ 9.11
  • flare-networksFlare (FLR) $ 0.012546
  • ecasheCash (XEC) $ 0.000032
  • nexoNEXO (NEXO) $ 0.980868
  • eosEOS (EOS) $ 0.417511
  • elrond-erd-2MultiversX (EGLD) $ 22.67
  • jupiter-staked-solJupiter Staked SOL (JUPSOL) $ 171.27
  • conflux-tokenConflux (CFX) $ 0.134337
  • notcoinNotcoin (NOT) $ 0.005939
  • tezosTezos (XTZ) $ 0.600402
  • paypal-usdPayPal USD (PYUSD) $ 0.998874
  • l2-standard-bridged-weth-baseL2 Standard Bridged WETH (Base) (WETH) $ 2,470.40
  • gigachad-2Gigachad (GIGA) $ 0.061958
  • dydx-chaindYdX (DYDX) $ 0.905556
  • safeSafe (SAFE) $ 1.15
  • wormholeWormhole (W) $ 0.212395
  • kelp-dao-restaked-ethKelp DAO Restaked ETH (RSETH) $ 2,531.63
  • zcashZcash (ZEC) $ 37.56
  • akash-networkAkash Network (AKT) $ 2.28
  • neiro-3Neiro (NEIRO) $ 0.001336
  • mina-protocolMina Protocol (MINA) $ 0.474077
  • the-sandboxThe Sandbox (SAND) $ 0.233327
  • nervos-networkNervos Network (CKB) $ 0.012154
  • axelarAxelar (AXL) $ 0.653866
  • pax-goldPAX Gold (PAXG) $ 2,747.87
  • gnosisGnosis (GNO) $ 207.81
  • goatseus-maximusGoatseus Maximus (GOAT) $ 0.538925
  • ethereum-name-serviceEthereum Name Service (ENS) $ 16.01
  • superfarmSuperVerse (SUPER) $ 1.17
  • beldexBeldex (BDX) $ 0.078950
  • turboTurbo (TURBO) $ 0.007592
  • arbitrum-bridged-weth-arbitrum-oneArbitrum Bridged WETH (Arbitrum One) (WETH) $ 2,469.21
  • decentralandDecentraland (MANA) $ 0.271296
  • chilizChiliz (CHZ) $ 0.055488
  • book-of-memeBOOK OF MEME (BOME) $ 0.007245
  • arkhamArkham (ARKM) $ 1.67
  • true-usdTrueUSD (TUSD) $ 0.994928
  • coinbase-wrapped-staked-ethCoinbase Wrapped Staked ETH (CBETH) $ 2,670.82
  • terra-lunaTerra Luna Classic (LUNC) $ 0.000083
  • roninRonin (RON) $ 1.32
  • eigenlayerEigenlayer (EIGEN) $ 2.42
  • pancakeswap-tokenPancakeSwap (CAKE) $ 1.62
  • aioz-networkAIOZ Network (AIOZ) $ 0.390305
  • zksyncZKsync (ZK) $ 0.120519
  • sats-ordinalsSATS (Ordinals) (SATS) $ 0.00000020
  • apenftAPENFT (NFT) $ 0.00000043
  • havvenSynthetix Network (SNX) $ 1.29
  • dexeDeXe (DEXE) $ 7.38
  • dydxdYdX (ETHDYDX) $ 0.904764
  • frax-etherFrax Ether (FRXETH) $ 2,457.52
  • usdbUSDB (USDB) $ 0.996382
  • oasis-networkOasis (ROSE) $ 0.060109
  • trust-wallet-tokenTrust Wallet (TWT) $ 0.970110
  • xdce-crowd-saleXDC Network (XDC) $ 0.026885
  • hashnote-usycHashnote USYC (USYC) $ 1.07
  • super-oethSuper OETH (SUPEROETHB) $ 2,467.74
  • grassGrass (GRASS) $ 1.62
  • ondo-us-dollar-yieldOndo US Dollar Yield (USDY) $ 1.06
  • bitcoin-avalanche-bridged-btc-bAvalanche Bridged BTC (Avalanche) (BTC.B) $ 69,144.00
  • blurBlur (BLUR) $ 0.192552
  • virtual-protocolVirtuals Protocol (VIRTUAL) $ 0.383363
  • astarAstar (ASTR) $ 0.051264
  • quantixaiQuantixAI (QAI) $ 90.72
  • bitcoin-goldBitcoin Gold (BTG) $ 21.43
  • iotaIOTA (IOTA) $ 0.106705
  • binance-peg-busdBinance-Peg BUSD (BUSD) $ 1.00
  • dog-go-to-the-moon-runeDOG•GO•TO•THE•MOON (Runes) (DOG) $ 0.003642
  • l2-standard-bridged-weth-blastL2 Standard Bridged WETH (Blast) (WETH) $ 2,466.50
  • polygon-pos-bridged-weth-polygon-posPolygon PoS Bridged WETH (Polygon POS) (WETH) $ 2,468.18
  • compound-governance-tokenCompound (COMP) $ 40.78
  • stepnGMT (GMT) $ 0.120578
  • usual-usdUsual USD (USD0) $ 0.998852
  • iotexIoTeX (IOTX) $ 0.036799
  • binance-staked-solBinance Staked SOL (BNSOL) $ 164.80
  • layerzeroLayerZero (ZRO) $ 3.10
  • baby-doge-coinBaby Doge Coin (BABYDOGE) $ 0.00000000
  • livepeerLivepeer (LPT) $ 9.42
  • kavaKava (KAVA) $ 0.307465
  • theta-fuelTheta Fuel (TFUEL) $ 0.048980
  • memecoin-2Memecoin (MEME) $ 0.010712
  • echelon-primeEchelon Prime (PRIME) $ 6.49
  • swethSwell Ethereum (SWETH) $ 2,647.35
  • safepalSafePal (SFP) $ 0.646573
  • constitutiondaoConstitutionDAO (PEOPLE) $ 0.061543

The Witness Discount: Why Some Bytes Are Cheaper Than Others

0 130

This year has seen a massive upswing in demand for the limited space available within bitcoin blocks, leading to higher fees for on chain transactions. Much of the demand is for transactions revealing inscriptions. The contents of these inscriptions are revealed as part of the witness data1 of a bitcoin transaction. This witness data1 is discounted to one quarter the cost of other transaction data. Why are we giving these inscriptions a discount? Should we soft-fork out the witness discount?

Why are some bytes cheaper than other bytes?

Money in general and bitcoin in particular operate on the back of human incentives. Bitcoin aligns the incentives of miners and transactors through the use of the native bitcoin token to pay miners for inclusion of particular transactions in the blocks they construct. The same cannot be said of aligning the incentives of node runners with miners and transactors, nor of aligning incentives between senders and recipients.

There have been 3 major improvements to bitcoin’s incentive alignment to date:

1. Limiting block size

2. Shifting the cost of complex scripts from sender to recipient (P2SH)

3. Aligning the costs of data between node runners and transactors (SegWit)

Limiting The Block Size

Transactors want to make lots of transactions and miners want to collect lots of transaction fees; but node runners have to relay, verify, and store all of that transaction data and they are not compensated like miners for doing so. Early in bitcoin’s history, Satoshi worked to address this by adding a fixed block size limit (enforced by nodes). The limit was 1 million bytes per block, and put an upper bound on the amount of data that nodes would need to download and verify. At the time, Satoshi wrote, «[w]e can phase in a change later if we get closer to needing it.» Later, referring to a patch to increase the limit, he noted, «[d]on’t use this patch, it’ll make you incompatible with the network», meaning that increasing the block size limit is a hard fork change and requires more coordination even than a soft fork. In the years that followed, bitcoin deliberately avoided such incompatible hard fork changes, which has also meant keeping the 1 million byte block size limit.

Shifting Complex Script Costs From Sender To Recipient

Because bitcoin is secured by locking scripts, it has always been possible to lock it with advanced scripts, including multisig. Under the original design, the sender of a bitcoin transaction would place the recipient’s full locking script in their transaction, and pay any fees to get that locking script included in a block. Developers realized that as fees increased, senders might become hesitant to pay users of larger locking scripts due to the higher cost of paying those users. These complex locking scripts also posed a problem for encoding into addresses and sharing via low bandwidth mechanisms such as QR Code.

To resolve this, P2SH was added to bitcoin as a soft fork. Under the rules of this fork, instead of putting the recipient’s entire locking script in the output of the transaction, the sender simply includes a hash of it. When the recipient inevitably spends that output, they include the full script in the spending transaction, which is checked against the hash of the script the coin is locked to before being validated. With this change, a redeem script of any size could be represented by a locking script of a fixed length and senders no longer had a need (or ability) to discriminate between recipients based on their spending conditions.

Aligning The Costs Of Data Between Node Runners And Transactors

The most fundamental verification that nodes perform on bitcoin transactions is that the bitcoin they attempt to spend does, in fact, exist. To do this, each node maintains an index of each unit of spendable bitcoin (unspent transaction output, UTXO). The larger this index, the greater the cost of running a node and verifying future transactions2. As a result, a transaction which increases the size of this index (having more outputs than inputs) costs more over time than a transaction with the same number of bytes that reduces the index size.

The largest part of most bitcoin unlocking scripts is the cryptographic signatures. These signatures are about twice the size of their corresponding public keys, which makes the unlocking scripts (even without P2SH) larger than the locking scripts.

The significantly higher cost of consuming vs. creating UTXOs creates an incentive conflict between node runners and transactors. Transactors are disincentivized from spending their small UTXOs (especially at times with high fees), preferring instead to spend large UTXOs and create more small change UTXOs. Meanwhile node runners pay the cost for this accumulation of small UTXOs in higher validation costs for all transactions.

Odd as it may seem, the verification that each UTXO spent by a transaction in the historical blockchain has its locking script satisfied by a corresponding unlocking script is significantly less fundamental. For that matter, a bitcoin node running default bitcoin core 26.x will not validate the full locking script execution for transactions before block 804000 (August 19, 2023).

All of the above means that there are different costs imposed on bitcoin nodes by different portions of the blockchain. Data required to determine the effects of each transaction must be validated by each node syncing from the genesis block3, transaction outputs tend to be more costly than transaction inputs in the long run (especially if they are long lived), and much of the witness data isn’t even checked except for the most recent transactions.

Enter Segregated Witness

The segregated witness (SegWit) soft fork is the most ambitious change made to bitcoin to date. The greatest motivation for the change was to fix the long standing problem of TXID4 malleability5 in bitcoin. In order to fix this malleability, the unlocking script is replaced with a newly created «witness». By removing the authorization data (which can often be changed by third parties without changing the effects of the transaction) from the TXID, protocols (such as Lightning) which depend on unchanging TXIDs become possible.

With the authorization data moved out of the original transaction structure, it no longer counts against the 1 million byte block limit. A new limit is required. Many approaches to limiting the segregated witness data were discussed at the time: A separate witness byte limit6, a combined limit of < 1 million bytes7, or a weighted combined limit. In the end, the weighted combined limit was chosen, with segregated witness data weighted at 1-unit, transaction data weighted at 4-units, and a 4 million weight block limit. Each weight unit is treated as 1/4 of a virtual byte (vByte) for the purpose of fee calculations.

Why these weights? Let’s look at the cost of transaction inputs and outputs with and without segregated witness:

The first thing to note from this table is how the witness script types (P2WPKH, P2WSH) have nearly the same number of input and output bytes (which are charged a full vByte each). The spender of a witness script is then charged 1/4 vByte for the data authorizing the spend, much of which is not verified for any but the most recent transactions, and none of which has an ongoing cost in the UTXO index. The other thing worth noting here is how the cost of using a more secure 2-of-3 multisig compared to a single signature is reduced from 147 vBytes to 36.25 vBytes.

Taproot And Inscriptions Change Everything (Or Nothing)

As I said at the outset, bitcoin rides on human incentives, and here we can see how changes have been made to bitcoin over the years to improve the alignment of incentives between the parties using the network.

Taproot itself is «just» an alternative way of locking bitcoin using segregated witness. It doesn’t change these incentives significantly. One of the changes that came along with Taproot was to remove certain limits on script size. This was done to reduce the complexity of designing analysis tools for bitcoin scripts, and as an acknowledgement of the relative cost of different types of data. Removing these limits made inscriptions simpler than they were before Taproot, but didn’t fundamentally change the incentive structure of the network.

Now to the crux of the matter. Inscriptions are revealed in the witness, so they’re only charged 1/4 vByte per byte of inscription data. Is this an abuse of the witness discount? The truth is that inscription data is some of the cheapest data for nodes on the network to validate. The script structure used by inscriptions explicitly skips execution of the inscription data, so the only verification done on it is a single hash check (ensuring that the revealed inscription is what the inscriber planned to reveal). This data is hashed once and then never looked at again by nodes. It has a very low computational cost (an order of magnitude lower than an equivalent size multisig script).

But inscriptions are driving up fees and pushing out other users.

Yes! With the current software available for interacting with the bitcoin network, inscriboooors have greater economic incentive to make their inscriptions than many folks have to make other transactions.

This throws into stark relief the value of increasing the economic density of bitcoin transactions. The Lightning Network takes a huge step toward this by enabling hundreds, thousands, or millions of economic transactions to be packed into a single bitcoin transaction. The greater the economic density of each byte in a transaction the lower the fee paid for that economic activity. As the economic density of bitcoin transactions increases, other uses of block space have been and will continue to be priced out9.

It’s worth noting that if off chain multisig protocols such as MuSig2 or FROST, or adaptor signatures become prevalent; it may make sense to reduce or eliminate the witness discount. These protocols can enable otherwise large spending conditions to be represented by a single signature. This, combined with Taproot’s efficient key path spending could bring the cost of an input with nearly arbitrarily complex conditions down to only 105 Bytes.

Conclusion

The response to high fees caused by inscriptions is the same as to any other supposed sky is falling scenario in the history of bitcoin: Patiently build, patiently build. There’s a lot we can do to increase the economic density of bitcoin transactions from building better Lightning wallets to Ark to discrete log contracts and beyond. Removing the witness discount (prematurely), rolling back taproot, or similar counter-productive actions will only serve to reduce the economic density of current bitcoin transactions and exacerbate the situation.

Stay humble, stack sats, and build.

Footnotes

  1. The term witness was adopted into bitcoin from cryptography jargon where it refers to data needed to efficiently verify a cryptographic claim. BIP141 defines it as any «data required to check transaction validity but not required to determine transaction effects». Cryptographers may have picked the term up from manufacturing witness marks used to efficiently verify the alignment of components.
  2. The Utreexo project aims to change this for a subset of bitcoin nodes by allowing them to efficiently accumulate UTXO inclusion roots and then receive the inclusion paths along with the spends of those UTXOs. If this becomes a common way to use bitcoin, it shifts the cost of more UTXOs from the nodes to the holders of those UTXOs.
  3. The ZeroSync project aims to change this for some nodes in some contexts.
  4. Transaction ID: Reversed byte order double SHA256 of the pre-segwit network format transaction.
  5. Multiple valid transactions with the same inputs and outputs have different txids if they are signed in different ways or have their signatures modified by a third party.
  6. Can be any value without a hard fork because old nodes are not aware of the segregated witness data.
  7. 1-million or less to maintain compatibility and prevent a hard fork.
  8. Assuming the use of compact public keys and 71-byte low-R/S DER signatures.
  9. Anyone remember Satoshi Dice?

This is a guest post by Brandon Black. Opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or Bitcoin Magazine.

Source

Leave A Reply

Your email address will not be published.