Today, an independent developer focused on bitcoin and Lightning Network, Super testnet, sleepless his latest invention, Hedgehog, a protocol for asynchronous layer two bitcoin payments.
“This is a protocol similar to the Lightning Network,” Super Testnet stated. “And that it is a layer 2 for bitcoin payments, only in this, unlike the Lightning Network, the two parties do not have to be online, it is asynchronous. One party can send money to the other and then they are disconnected.”
One of the characteristics of Hedgehog channels is their simplicity compared to Lightning channels, according to the project GitHub. Status updates on Hedgehog channels only require the sender to propose an update, which the recipient can then accept at their convenience. This asynchronous nature allows for greater flexibility and efficiency in payment processing.
The protocol works by leveraging a primitive in the bitcoin script known as “revocable sockets.” These connectors are based on two even more primitive components: revocable scripts and connector exits. Revocable scripts allow either party to revoke a transaction after a set period, adding an additional layer of security and control. Connector outputs allow you to construct a pre-signed transaction by spending a separate UTXO along with the connector output, allowing you to invalidate the transaction by spending the connector output alone.
To illustrate how Hedgehog channels work, consider a scenario where Alice opens a channel with Bob sending a certain amount of bitcoins to a multi-signature address. Using revocable connectors, Alice can send off-chain payments to Bob while he is offline. These payments are embedded in text, similar to a check, and can be sent via email or other communication methods.
When Bob connects, he has the option to accept or reject the payment. If you accept, you can co-sign and transmit the transaction to update the channel balance. If he rejects it, he can propose an alternative transaction for Alice to consider.
One of the potential problems Hedgehog needs to solve is, for example, if one party sends money to its counterparty, it loses the ability to force the channel to close because it does not have the other party's signature. The protocol provides a conditional revocation mechanism. This mechanism is intended to allow the sender to conditionally revoke a previous state, giving both parties a window of time to abort the transaction if necessary.
Additionally, Hedgehog addresses the issue of funds being trapped in a multi-signature address if one party becomes permanently unavailable. By incorporating time lock conditions into the script, the protocol can ensure that funds can still be accessed after a certain period, even if one party is unable to provide their signature.
Super Testnet posted that it has an idea on how to use Hedgehog channels to build a federated CoinPool which it called Burrow. Those interested in that can learn more about it. here.