Stolen Bitcoin? Anti-Theft Feature Gets Second Life on Sidechains

A concept that could enable new functionality for bitcoins on the bitcoin blockchain is being tested by Blockstream.

AccessTimeIconNov 4, 2016 at 5:35 p.m. UTC
Updated Sep 11, 2021 at 12:35 p.m. UTC
10 Years of Decentralizing the Future
May 29-31, 2024 - Austin, TexasThe biggest and most established global hub for everything crypto, blockchain and Web3.Register Now

At its core, bitcoin is about giving users better control of their money.

Often called "programmable money", bitcoin has scripts that limit how future bitcoin transactions can be spent (and that control variables like who can spend them). One such script ensures the correct person is spending the bitcoin by checking if the correct signature was used before unlocking and sending the funds.

This week, Blockstream core tech developer Russell O'Connor revealed he's been testing a couple of new scripts on an Elements Alpha sidechain (which is pegged to the bitcoin testnet) that could add new functionality.

Called "covenants", the new style of scripts potentially opens up possibilities for how bitcoin users can control, or restrict, spending of their money — possibly for their protection. (This is an idea that was previously explored by researchers Malte Möser, Ittay Eyal, and Emin Gun Sirer).

One use case for these scripts is to help users rein in their coins in the case of a hack (an all too common occurrence in bitcoin).

When asked what he thinks of the new covenant work, Eyal said it was potentially a boon to bitcoin users who may be worried about losing their bitcoins or otherwise having them compromised or stolen.

Eyal told CoinDesk:

"It's also going to increase user-side security in a way that's invaluable."

Extending bitcoin's scripts

The idea is notable as a script that can limit how bitcoins can be spent hasn't been implemented in bitcoin before, a fact noted by Eyal.

In particular, there are two new covenant scripts that Blockstream explored, each of which take parameters and outputs whether the script is valid, or whether or not the transaction is currently spendable based on its restrictions.

It's worth noting that bitcoin’s scripting system is currently quite simple for security's sake. There aren't limitless rules in bitcoin right now because new additions can be potentially dangerous and developers note that they take time to test.

This is where sidechains may come in handy, although they are not yet pinned to the main blockchain.

Bitcoin startup Blockstream has been working on these interoperable blockchains for experimenting with new features that could potentially be added to bitcoin since June of last year, and this is an example of how these new chains can be used to test new features.

These new proposed opcodes may work as the foundations for new functionalities, ones that could even come to help stop bitcoin exchanges and users from losing stolen funds.

Use cases

But while Blockstream is running with the idea, it began with researchers at Cornell.

In February, researchers Malte Möser, Ittay Eyal and Emin Gun Sirer proposed the idea of bitcoin vaults (implemented with their own version of covenants) where users could pull bitcoin back in the case of a hack. (It then gained new life following the hack on Bitfinex, in which the exchange lost nearly 120,000 BTC).

"If the attacker can't gain control of the money, it takes away the motivation for stealing it in the first place," Eyal explained.

But he noted that these two requirements are often conflicting: if a user creates new keys to avoid losing them, that means it's easier for them to be stolen. Meanwhile, if you create a smaller number of total keys, it's easier to lose them.

While Blockstream tested vaults as a potential use case, there might be other future uses for the covenant scripts, including lending.

The idea seems to have been dormant for a while and developers were debating its viability even just a couple of months ago.

But these sidechain tests might mean a step towards implementation.

And while covenants and vaults had drawn some skepticism before (Peter Todd has questioned whether such a functionality should be built in the infrastructure layer of the code at Scaling Bitcoin), there seems to be optimism that it could work.

When asked if the new scripts were safe, Bitcoin Core developer Greg Maxwell responded:

"Trivially so if implemented correctly."

Disclosure: CoinDesk is a subsidiary of Digital Currency Group, which has an ownership stake in Blockstream.

Electronics image via Shutterstock


Please note that our privacy policy, terms of use, cookies, and do not sell my personal information has been updated.

CoinDesk is an award-winning media outlet that covers the cryptocurrency industry. Its journalists abide by a strict set of editorial policies. In November 2023, CoinDesk was acquired by the Bullish group, owner of Bullish, a regulated, digital assets exchange. The Bullish group is majority-owned by; both companies have interests in a variety of blockchain and digital asset businesses and significant holdings of digital assets, including bitcoin. CoinDesk operates as an independent subsidiary with an editorial committee to protect journalistic independence. CoinDesk offers all employees above a certain salary threshold, including journalists, stock options in the Bullish group as part of their compensation.

Learn more about Consensus 2024, CoinDesk's longest-running and most influential event that brings together all sides of crypto, blockchain and Web3. Head to to register and buy your pass now.