Açai: a backup protocol for Lightning
Network wallets
Scaling Bitcoin 2019 "Yesod"
September 11th-12th Tel Aviv

Margherita Favaretto
M.Sc.Eng. in Computer Science and Engineering

Presentation Outline
1.

Problem Description

2.

Related Work

3.

Preliminary concepts

4.

Methodology

5.

Açai Protocol: Design and Implementation

6.

Conclusion and Future Work

2 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Problem Description

3 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Problem Description

The Lightning Protocol does not offer a decentralized, trustless recovery
mechanism of bitcoins in case of wallet failure.

4 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Problem Description- Scenario 1

Scenario 1:“I accidentally deleted my lightning
app and lost my channels. How can I
safely recover my funds?” - Alice

5 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Problem Description- Scenario 2
Scenario 2:“I’d like to move my Lightning app toanother machine. How can I safely
recover my funds?” - Bob

6 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Problem
The absence of BIP 39 and BIP 32 in Lightning Network makes
impossible the trustless recovery of unspent transactions.

No portability among different devices and wallets.
No possibility to recover funds inside the Lightning Network if thedevice is damaged or lost.
7 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Related Work

8 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Related Works
Third-party
BackupMechanism

Self
BackupMechanismEx.
- Lightning wallet- Electrum wallet- Olympus

Ex.
- Piln- Breez- Static backup
channel

9 Scaling Bitcoin 2019 "Yesod"

Eltoo?

12 September 2019

Third-party Backup
Main idea:-A third-party cloud service stores the information related to the channels

Weaknesses:-Censorship Risk and Availability
Centralization
On cloud security threats
PrivacyTechnologies: Lightning wallet, Electrum wallet, Olympus

10 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Self Backup
Main idea:-The user is responsible of his own backup solution

Weaknesses:-User experience
Cloud Services Privacy
Data loss risk

Technologies: Piln, Breez, Static backup channel

11 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Eltoo?
Main idea:
The two sides (e.g. Alice and Bob) of a channel share the same commitment.
Weaknesses:
Bob might not be cooperative, sending to Alice a previous channel state to trigger thepenalty.

12 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Can we do better?
1.

Decentralized system

2.

Anonymity, integrity and confidentiality

3.

Simple implementation

4.

Censorship Resistant recovery service

13 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Preliminary concepts

14 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai Protocol
Main Goal

Minor modifications to available protocols

Açai Protocol is based on the following concepts:- Eltoo (seen in Related Works)- Watchtowers- BIP 32, BIP 44, BIP 39

15 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Recovery Mechanism for Bitcoin Wallet
Wallets: Data structure used to store and manage a user’s keys.
Deterministic wallet:
All the keys are derived from a single master key, known as the seed.
HD wallet:
BIP-32 standard for the public key calculation
The most used key derivation
BIP-44:Standard to define a specific logical hierarchy for the HD walletm / purpose' / coin_type' / account' / change / address_index
BIP-39:Seed in hex: 0C1E24E5917779D297E14D45F14E1A1A
Seed as a sequence of the following words (easy to remember and note on paper):army van defence carry jealous true garbage claim echo media make crunch
16 Scaling Bitcoin 2019 "Yesod"

12 September 2019

EltooMain idea:
The two sides (e.g. Alice and Bob) of a channel share the same commitment.
Weaknesses:
Bob might not be cooperative, sending to Alice a previous channel state to trigger thepenalty.

17 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Watchtowers
Use of Watchtowers as a mechanism of back up.

Watchtowers

18 Scaling Bitcoin 2019 "Yesod"-Full nodes
Always online
Monitor status channel when a node is offline
They will store eltoo channels

12 September 2019

Watchtowers for monitoring statuschannels
Alice sends to the Watchtower WO the current status channel
1.

Channel Status changes.

2.

Calculate txid as the hash of commitment with Bob.

3.

Calculate hint= txid[:16].

4.

Calculate blob= Enc(data,txid[16:]).

5.

Alice sends to the Watchtower W0.

19 Scaling Bitcoin 2019 "Yesod"

12 September 2019Watchtowers for monitoring statuschannels
Bob broadcast an older status channel
1.

Bob broadcasts a transaction containing an older channel state.

2.

The Watchtower examines the commitment broadcast by Bob.

3.

The Watchtower notices that the txid[:16] equals to one of the pasthints.

4.

The Watchtower decrypts data, using txid[16:].

5.

The Watchtower broadcasts to the Blockchain the justice transaction.

20 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Methodology

21 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Methodology
Açai Protocol Design

22 Scaling Bitcoin 2019 "Yesod"-Game Theory and Adversarial Thinking-Bitcoin Cryptography Standards-Lightning Network Community

12 September 2019

Methodology
Game Theory andAdversarial Thinking-“Formalizing and Securing Relationships on
Public Networks” by Nick Szabo (1997)“A Cypherpunk’s Manifesto” by Eric Hughes(March 9, 1993)

Source: DTU Electronic Library/IEEE Xplore/
Google Scholar/Nakamoto Institute23 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Methodology
Cryptography--"Bitcoin: A Peer-to-Peer Electronic Cash
System" by Satoshi Nakamoto (October 31,2008)“The Bitcoin Lightning Network: ScalableOff-Chain Instant Payments” by Joseph Poon
Thaddeus Dryja (January 14, 2016)

Source: DTU Electronic Library/IEEE Xplore/
Google Scholar/Nakamoto Institute24 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Methodology
Lightning NetworkCommunity

25 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai Protocol

26 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai protocol
Idea: Use the watchtowers not just for monitoring the channels, butalso as a backup service
Standard Format :Açai Format :27 Scaling Bitcoin 2019 "Yesod"hint= txid[:16]blob= Enc(data, txid[16:])where txid is the commitment hashhintç= txidç[:16]blobç= Enc(dataç, txidç[16:])
where dataç=[txid_Bob, txid_Charlie, txid_Eve]

12 September 2019

Txidç Derivation
Standard Format: txid is the hash of the commitment.
Value for txidç?
-Adopt BIP 39, BIP 32 using in Bitcoin
BIP 44 (m / purpose' / coin_type' / account' / change / address_index)
Derivation Path for Açai Protocol:
m’/108’/0/(account_number)’/0/Current_Blockheighttxidç = 2SHA256(pub-key)
28 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai protocol: how to send data
After each Channel Status change.
Derivation Path =m’/108’/0/(acc.number)’/0/Current_Blockheighttxidç= 2SHA256(pub-key)
hintç= txidç[:16]blobç= Enc(dataç, txidç[16:])dataç=[txid_Bob, txid_Charlie, txid_Eve]

29 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai protocol: how to recover data
Note: Simplified version of the Activity Diagram.
Derivation Path =m’/108’/0/(acc.number)’/0/Current_Blockheighttxidç= 2SHA256(pub-key)
hintç= txidç[:16]blobç= Enc(dataç, txidç[16:])dataç=[txid_Bob, txid_Charlie, txid_Eve]

30 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai protocol: how to recover data
txid_Bob found through the Açai Protocol
hint_Bob= txid_Bob[:16]blob_Bob= Enc(data_Bob, txid_Bob[16:])
data_Bob back up of the channel status with Bob

31 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai protocol: assumptions-Query function for the watchtower: there’s a functionality enabling
Lightning wallets to exchange data with a watchtower.

-Fees: Watchtowers benefit from trustless payments to becomelargely available, e.g. to cover the extra storage and bandwidth forthe service (both for the normal service and the Açai backup).

-Storage: Açai blobs stored in the watchtowers are not deleted,replaced/tampered.

-Directory: Alice knows which Watchtowers can provide her Açaibackups.

32 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Implementation

Results:

33 Scaling Bitcoin 2019 "Yesod"-

BIP32 and BIP 39: Backup bothfor Bitcoin wallet and for Lightning
wallets-Portability between Lightning
Wallets
12 September 2019

Conclusion and Future Works

34 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Results-The Açai Protocol allows having a mechanism to backup data for a
Lightning Network wallet.
It satisfies all the proposed goals:
1.
2.
3.
4.

--

Decentralized system
Anonymity, integrity and confidentiality
Simple implementation
Censorship Resistant recovery service

The Lightning nodes are able to recover all funds both in their
Bitcoin Wallet and in their Lightning Wallet, through their own
mnemonic seed (bip39).
Formalization of Watchtower definition.

35 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Definition of Watchtower
Formalization of Watchtower
We define Watchtower as a full-node, always online, that watch forLightning channel breaches even at times when your wallet is offline.
Watchtowers, by leveraging the Açai Protocol, provide a backup service
if your Lightning-enabled Bitcoin Wallet must be recovered.

36 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Açai:
a Protocol for frequent or sporadic users?
Problem:
For normal users is high consumption calculate the txidç using the value of theBlock height in the Derivation Path.
Derivation Path= m’/108’/0(mainnet)/(account_number)’/0/Current_Blockheight

Solution:
Use as the last parameter a counter.
Derivation Path= m’/108’/0(mainnet)/(account_number)’/0/counter
where counter=0,1,2...n37 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Future Works-

Stack Sats enabling Açai on your Watchtower-

Lightning Wallet including the Açai Protocol-

Introduce Watchtower + IPFS to optimize the Açai Protocol-

Trade-off solution for frequent and sporadic users

38 Scaling Bitcoin 2019 "Yesod"

12 September 2019

Thank you! Questions?

Contact:
Margherita Favaretto(fav.margherita@gmail.com)
39 Scaling Bitcoin 2019 "Yesod"

12 September 2019