Coming on the heels of the successful Dynamic Federations key transition, is the latest release of Elements, the free, open-source codebase that Liquid is built on. In version 22.1, we brought Elements up to date with Bitcoin Core 22.1 and added native support for Liquid Testnet and a slew of smaller improvements, including:
- Update RPC:
decodepsbtand fix check for
- Fix PSET swap example
- Add missing field
Review the full changelog to dig into the finer points of the release, and tell us what you like or what we could improve by posting feedback on the developers page of the Build On L2 (BOL2) community.
Testing the Waters
One of the benefits of building on Liquid is harnessing powerful smart contracting capabilities through its library of opcodes (i.e., CAT, DETERMINISTICRANDOM, CHECKSIGFROMSTACK). These new opcodes enable next-gen financial products such as non-custodial options contracts, infrastructure like decentralized exchanges, and trustless swaps to reduce the overall need for trust in capital markets.
For developers seeking to experiment with these advanced smart contracts first-hand, there is now a Liquid Testnet native function in Elements. Gone are the days of spinning up a test network with a bloated config file! Good riddance! Simply run
elementsd chain=liquidtestnet, and you are done (this also works in elements-qt).
Testnet is a valuable tool when building on Liquid because it has the internal functionality of the production chain without the burden of having to spend real bitcoin for transaction fees. The only feature missing in Liquid Testnet is the ability to peg-in and peg-out from Bitcoin. After running Liquid Testnet on Elements with
elementsd chain=liquidtestnet, you can send yourself testnet L-BTC, TEST assets, or even testnet AMP tokens (if you are interested in exploring digital securities) using the official Liquid faucet and start building away.
Liquid is the most popular configuration of Elements, focusing on financial markets and digital securities issuance, and is the default node when you run elements-qt. When running your own Liquid node, you can trustlessly validate L-BTC peg-ins and supply by enabling the
validatepegin=1 option, which is also the default setting. Note this feature needs a Bitcoin node available via RPC. You can also send, receive and issue Liquid assets, and perform bitcoin peg-ins to Liquid using the
getpeginaddress RPC and send the coins directly to that address. After the transfer has reached final settlement (102 Bitcoin blocks or ~16 hours), you can claim those funds from your Liquid node. Read the tutorial here on the Elements Projects site for further instructions.
We are always thinking of new ways to optimize Elements Core and how Liquid runs under the hood. The community has expressed the desire for a more lightweight Elements node client compatible with off-the-shelf DIY hardware like the very low-end versions of the Raspberry Pi. We are prioritizing this request in the lead-up to the next release, with internal benchmarks already showing a reduction in memory usage of around 50%. We hope to have this production ready soon and will continue optimizing the software with the goal of being able to run Bitcoin, Lightning, and Liquid nodes concurrently on the most accessible, inexpensive hardware available.
For a more detailed walk-through of setting up and running Liquid Testnet and a Liquid node, read through the how-to guide on the new Developer Documentation Portal.
Joining the Liquid Community
You can familiarize yourself with Elements and Liquid by exploring the new BOL2 community platform. We are hosting an AMA on the new 22.1 release and fielding any questions the community may have throughout the day. The platform is a great resource for learning more about building on Bitcoin’s second layer and connecting with like-minded Liquid developers and users.
We look forward to seeing you there!
This article was originally posted on the Blockstream blog at: https://blog.blockstream.com/elements-v22-0-2-pset-spec-and-dynafed-updates/