v10.7.0
Release Notes - Counterparty Core v10.7.0 (2024-11-11)
This is a protocol upgrade that includes a refactor of the UTXO Support feature that fixes some bugs in the original design and simplifies the implementation significantly. It also includes bugfixes for the fair minting functionality in addition to the usual set of miscellaneous improvements to the node API.
Upgrading
This upgrade is mandatory and must be performed before block 871,900 (around November 25th).
A reparse from the block 869,900 block is mandatory and will be performed automatically.
Composition functions for attach and detach transactions are disabled between block 871,888 and 871,900.
ChangeLog
Protocol Changes
UTXO Support
This update includes significant changes to the UTXO Support feature, and in particular to address a vulnerability where an atomic swap could be frontrun by a detach transaction. Further feedback from the community, in particular the OpenStamps team and DerpHerpenstein, have allowed us to simplify the implementation of this feature significantly. With this protocol change, messages with ID 100 will be disabled at the same block that messages with IDs 101 and 102 are enabled. 12 blocks before this activation block, the functions compose_attach and compose_detach will be deactivated to avoid having transactions with ID 100 confirmed after activation. The protocol and API have changed as follows:
- The
attachfunction no longer accepts adestinationparameter. It now accepts an optionaldestination_voutparameter (by default the first non-OP_RETURNoutput). This parameter allows one to designate the index of the output to use as the destination. The transaction is invalid ifdestination_voutdoes not exist or if it is anOP_RETURN. - The
destinationparameter of thedetachfunction is now optional. If not provided, the default destination is the address corresponding to the UTXO. - The
detachfunction no longer acceptsassetandquantityparameters. Thedetachfunction detaches all assets attached to all transaction inputs every time.
In addition to resolving the above frontrunning vulnerability, this update brings a number of improvements:
- It is now cheaper and easier to construct
attachanddetachtransactions. The size of messages is always less than 80 bytes, so anOP_RETURNoutput can store all of the necessary data. - It is possible to execute several
detachoperations in a single transaction to save fees. - It is no longer possible to make a
detachand a UTXOmovein the same transaction. - A UTXO move with a transaction that contains only a single
OP_RETURNoutput behaves like adetach - Correct the gas calculation for
attachoperations
Fairminter
-
When there are fewer tokens remaining than
max_mint_per_txin a free Fair Minter with a hard cap, the last mint receives whatever remains instead of triggering an error. -
Fixed a bug that prevents updating an asset's description after a fairminter's automatic closure.
Bugfixes
- Take Rust fetcher's
rollback_heightinto account in the block-height ordering check - Fix subasset name handling when creating a Fair Minter by preserving the
asset_longnamefield whenasset=<subasset_name>is specified andasset_parentis not specified - Fix
disable_utxo_locksparameter in compose API - Fix
gas.get_transaction_count_for_last_period() - Fix
update_assets_info()when a fairmint is parsed into the mempool before the corresponding fairminter - Fix asset cache initialization
- Takes into account the commission to check if the hard cap is reached
- Soft cap deadline block must be greater than start block
- Fix
legder.get_fairmint_quantities()function - Fix `fee_paid`` field when closing fairminter
- Fix
premint_quantitychecking when no hardcap - Fix
premint_quantitydestruction when soft cap is not reached - Add an index on
(utxo, asset)fields in thebalancestables
Codebase
- Have
transactions.compose()accept atx_infothat contains a source in the form of a UTXO instead of an address. When a UTXO is used, this UTXO must be spent in the corresponding transaction. - Refactor
compose_moveutxo()to use this newtransactions.compose()feature - Have the Rust fetcher now only store entries in its database required for Bitcoin reorganization checks. This greatly reduces the size of the database and significantly increases the speed of the catch-up process.
- Support Bitcoin Core 28.0, having updated the Rust Bitcoin dependencies (bitcoin 0.32.4 and bitcoincore-rpc 0.19.0)
API
- Make the
destination,assetandquantityparameters tocompose_detach()optional (assetandquantitywill be ignored after the protocol change) - Add a
destination_voutparameter to thecompose_attach()endpoint (thedestinationparameter will be ignored after protocol change) - Add the
validateargument to compose API - Add sortable
get_priceandgive_pricefields for orders - Add sortable
pricefield for dispensers - Fix
lockedinasset_infofield - Add
/v2/bitcoin/transaction/decoderoute to proxy bitcoindecoderawtransactionmethod inputs_setnow supports UTXOs in the format<txid>:<vout>:<amount>:<script_pub_key>- Skip transaction sanity check when
validate=false - Take
asset_longnameinto consideration when sorting onassetfield
CLI
Credits
- OpenStamp
- DerpHerpenstein
- Ouziel Slama
- Wilfred Denton
- Adam Krellenstein