Hedgehog - Protocol for Asynchronous Layer 2 Bitcoin Payments

Hedgehog

Pasted image 20240423220133.png

Hedgehog is a protocol for two party payment channels. Hedgehog channels are similar to lightning channels but with a few comparative benefits.

  • Hedgehog channels are simpler than lightning channels
  • State updates only require the sender to propose an update and the recipient to accept it
  • The recipient can wait to accept a state change til they want to propose another one

The properties mentioned above allow for an improved payment experience. Using hedgehog feels similar to using an ecash protocol like cashu or fedimint, except with no server. If you have a channel with someone, you can -- without their assistance -- create a payment for them, embed it in a piece of text (think of it like a cheque), and send it to them via email or some other communication method. Then you can go offline. When they get online, they can either accept the state change (the cheque) and update their balance without your further assistance, or they can reject it. If they accept the state change (the cheque) they can even use their new balance to pay you back later by making another state change (another cheque) that builds on the previous state change (i.e. spends the cheque to make a new cheque). And they can send the new state change (the new cheque) to you even if you are still offline. Or, if they reject your state change, they can propose an alternative one and wait for you to accept that.

Hedgehog is a protocol for two-party payment channels that works by combining two primitives: revocable scripts and connector outputs. Revocable scripts allow one party to revoke their ability to spend funds in an address after a certain number of blocks. Connector outputs allow one party to create a signature that sends funds from a multisig address to another party, but only if a specific UTXO (the "connector") is also spent.

  1. Alice opens a channel with Bob by funding a 2-of-2 multisig address.
  2. To send Bob some bitcoin off-chain, Alice creates two transactions:
    a. One that creates a revocable "dust" output spendable by Bob after a timelock.
    b. Another that sends funds to Bob, but requires spending the revocable dust output as an input (acting as a "connector").
  3. Alice sends the signatures for these transactions to Bob. Bob can either accept the new state by broadcasting the transactions after the timelock expires, or reject it.
  4. If Bob wants to send funds back to Alice, he revokes the previous revocable output and creates new transactions following the same pattern, sending the new state back to Alice.
  5. This process can continue indefinitely, with Alice and Bob taking turns updating the latest state off-chain.

Comparison to Lightning Network

Pasted image 20240423220739.png

Pasted image 20240423220403.png

Pasted image 20240423220301.png

Burrow

Pasted image 20240423215948.png

Burrow is a proposal for a federated coinpool on top of hedgehog channels. The coinpool can have a bunch of cool properties:

  • a single-honest-party assumption, so the federation can't rug any user unless the keyholders in the federation are all scoundrels
  • users can onboard into the pool without an on-chain transaction (e.g. maybe you send in coins via lightning, or maybe another user gives you your first coins from within the pool)
  • every onboarded user gets their own wallet interface with their own personal balance and Send/Receive buttons
  • no transfer fees within the pool, and internal transactions happen faster than lightning (due to no need for pathfinding, and no liveness assumption about the recipient -- only the server must be online)
  • users can issue off-chain "cheques" which are essentially vtxos that you give someone else the right to spend. The recipient does not need to be in the coinpool, they can be literally anyone. The cheque issuer can send the cheque to the recipient e.g. via email, and the recipient can redeem it off-chain even if the issuer is offline (but the server has to be online for this part, and can censor, though the issuer can override censorship via a force closure)
  • a lightning gateway can allow transferring sats into or out of the pool, e.g. for users who want to withdraw to a fully self custodial wallet (mining fees would apply there if you send to a base layer wallet, and routing fees if you send to a lightning wallet)

More Resources

Sponsors

USD/BTC