Today, a freelance developer focused on Bitcoin and the Lightning Network, Super Testnet, unveiled his latest invention, Hedgehog, a protocol for asynchronous layer two bitcoin payments.
“This is a protocol similar to the Lightning Network,” said Super Testnet. “And that it is a layer 2 for Bitcoin payments, only in this layer, unlike the Lightning Network, the two parties do not both have to be online, it is asynchronous. One party can send the other money and then its them offline.”
One of the hallmarks of Hedgehog channels is their simplicity compared to lightning channels, according to the project’s Github. Status updates in Hedgehog channels simply require the sender to propose an update, which the recipient can then accept at their leisure. This asynchronous nature allows for greater flexibility and efficiency in payment processing.
The protocol works by using a primitive Bitcoin script known as ‘revocable connectors’. These connectors are built on two even more primitive components: revocable scripts and connector exits. Revocable scripts allow either party to revoke a transaction after a certain period of time, adding an extra layer of security and control. Connector output allows you to construct a pre-signed transaction that issues a separate UTXO in addition to the connector output, allowing the transaction to be invalidated by issuing the connector output itself.
To illustrate how Hedgehog channels work, consider a scenario in which Alice opens a channel with Bob by sending a certain amount of bitcoin to a multisig address. Using the revocable connectors, Alice can then send off-chain payments to Bob while he is offline. These payments are embedded in a piece of text, similar to a check, and can be sent via email or other communication methods.
When Bob comes online, he has the option to accept or decline the payment. If he agrees, he can co-sign the transaction and broadcast it to update the channel balance. If he declines, he can suggest an alternative transaction for Alice to consider.
For example, one of the potential problems that Hedgehog must solve is that if one party sends money to the counterparty, they lose the ability to forcibly close the channel because they do not have the other party’s signature. The protocol provides for a conditional withdrawal mechanism. This mechanism is intended to allow the sender to conditionally revoke a previous status, giving both parties time to reverse the transaction if necessary.
In addition, Hedgehog addresses the problem of money being tied up on a multisig address if one party is permanently unavailable. By including time slot conditions in the script, the protocol can ensure that funds can still be accessed after a certain period of time, even if a party is unable to sign.
Super Testnet reported that he has an idea on how to use Hedgehog channels to build a federated CoinPool that he called Burrow. Anyone interested can find out more about it here.