We do a little learning

Account Abstraction - Part 2
Welcome back to part 2 of the Account Abstraction (AA)! Last post we covered the concept of AA, the benefits of AA, and the infrastructure needed to utilize SCAs in the manner proposed by ERC-4337. This week we'll take a look under the hood and discuss how ERC-4337's components actually interact with each other to make AA a reality. You'll remember that every transaction that occurs on Ethereum currently requires an EOA to initiate the transaction (by signing the transaction with a private ke...

Stablecoins
For this post, we'll be diving into one of the crypto industry's most popular use cases - stablecoins. As of November 2023, USDT and USDC, the two biggest stablecoins by market cap, have a combined market cap of ~$110 billion within the crypto industry's entire $1.48 trillion market cap. However, this rise in popularity of stablecoins has not come without its controversies. If you've spent any amount of time following or participating in the crypto industry, you've no doubt seen the barrage o...

Nostr
Tired of the Twitter/X drama? Don't know what the heck Mastodon is or how to use it? Do you like ostriches? Well then there is a protocol for you! In this post, we'll actually be veering off the blockchain-specific beaten path and delving into an exciting protocol that can best be described as crypto-adjacent - the Nostr protocol! Nostr (short for Notes and Other Stuff Transmitted by Relays) is an exciting protocol that aims to be a fully fleshed out decentralized social network and so much m...

Subscribe to 0xhubman.eth

Account Abstraction - Part 2
Welcome back to part 2 of the Account Abstraction (AA)! Last post we covered the concept of AA, the benefits of AA, and the infrastructure needed to utilize SCAs in the manner proposed by ERC-4337. This week we'll take a look under the hood and discuss how ERC-4337's components actually interact with each other to make AA a reality. You'll remember that every transaction that occurs on Ethereum currently requires an EOA to initiate the transaction (by signing the transaction with a private ke...

Stablecoins
For this post, we'll be diving into one of the crypto industry's most popular use cases - stablecoins. As of November 2023, USDT and USDC, the two biggest stablecoins by market cap, have a combined market cap of ~$110 billion within the crypto industry's entire $1.48 trillion market cap. However, this rise in popularity of stablecoins has not come without its controversies. If you've spent any amount of time following or participating in the crypto industry, you've no doubt seen the barrage o...

Nostr
Tired of the Twitter/X drama? Don't know what the heck Mastodon is or how to use it? Do you like ostriches? Well then there is a protocol for you! In this post, we'll actually be veering off the blockchain-specific beaten path and delving into an exciting protocol that can best be described as crypto-adjacent - the Nostr protocol! Nostr (short for Notes and Other Stuff Transmitted by Relays) is an exciting protocol that aims to be a fully fleshed out decentralized social network and so much m...
Share Dialog
Share Dialog


With all the talk and excitement around current Ethereum layer 2s such as Optimism, Arbitrum, and Base, it might surprise you to learn that Bitcoin was actually one of the first blockchains to have a widely available layer 2 - the Lightning Network. The Lightning Network was first proposed by Joseph Poon and Thaddeus Dryja in a whitepaper published in 2016 and eventually deployed to mainnet in early 2018. Within that whitepaper, the Lightning Network was described as a layer 2 solution designed to increase the scalability of the Bitcoin network. But you might be wondering, why does Bitcoin need a layer 2 scaling solution? Well to provide a bit more context, a new block is mined on the Bitcoin network roughly every 10 minutes, with an average block size of 2MBs. Although the amount of transactions and size of transactions within these blocks will vary, the general estimate is that Bitcoin has a whopping throughput of 7 transactions per second (tps). Compare that against Ethereum mainnet handling an average 14 tps, Solana handling an average 5,000 tps and major credit card companies handling an average of 10s of thousands of tps - Bitcoin has a long way to catch up if it aims to be the world's reserve currency and medium of exchange for everyday purchases. But why not just increase the block space or speed up the block time? Both of those options have been implemented by various Bitcoin hard forks, but inevitably these options would weaken the Bitcoin network's security, either via increased centralization due to large blocks or conflicting ledgers due to blocks being mined too fast - no bueno.
So then how does the Lightning Network help scale the Bitcoin network? The Lightning Network's secret sauce involves moving a significant amount of Bitcoin transactions from on-chain (i.e., the Bitcoin mainnet) to off-chain (i.e., the Lightning Network) to enable cheaper and faster transactions. To help flesh out that statement, consider the following example. At most salaried jobs, employees are paid on a bi-weekly basis. The employer internally tracks each day the employees work during the pay period, but only squares up with them every other Friday when payroll goes out. You could consider each day the employee works but does not get paid as an 'off-chain transaction', and every other Friday when payroll goes out as an 'on-chain transaction' as that's when the employer and employee square up for the work performed. If payroll were to be paid each day an employee performs work, this would most likely lead to increased loads on banking services and longer wait times for deposits to confirm.
Now with the above example in mind, the method by which off-chain transactions happen on the Lightning Network is accomplished via two on-chain transactions explained below.
Alice and Bob agree to open a Lightning Network payment channel which acts as an off-chain ledger that records their transactions between each other. This payment channel is opened via an on-chain funding transaction, where both users deposit some amount of BTC into a multi-sig wallet. For example, Alice could deposit 1 BTC and Bob could deposit 5 BTC. Once the BTC is deposited and the payment channel is open, Alice and Bob's BTC balance on the Lightning Network will show up in their Lightning wallet, which is separate from their Bitcoin wallet.
Once the payment channel is established, Alice and Bob can execute as many off-chain transactions between themselves as desired, as long as the transactions do not exceed the total amount of BTC deposited into the on-chain multi-sig wallet. Bob could repeatedly pay Alice in small increments until his 5 BTC balance runs out, or Alice and Bob could send 0.5 BTC back and forth between each other indefinitely just for the fun of it. All transactions in these off-chain payment channels are private, near instant, and have incredibly low fees since they are not broadcasted to the Bitcoin network. In other words, Alice and Bob are simply changing their ownership of the share of total BTC deposited into the multi-sig wallet.
Side note, it is possible to deposit additional BTC into the multi-sig wallet once a payment channel is open to increase its capacity. This is known as 'rebalancing' or 'topping up' a payment channel.
Once Alice and Bob decide they've had their fun, they can choose to close the payment channel. Closing the payment channel requires another on-chain transaction and can be done one of two ways:
Cooperative Close - Alice and Bob agree on the final state of their off-chain balances and both sign the on-chain transaction to square up on the Bitcoin network. For example, if Alice's final balance was 3 BTC and Bob's final balance was 3 BTC, each user would receive 3 BTC from the multi-sig wallet.
Non-Cooperative Close - if there is a dispute between Alice and Bob on the final state of their off-chain balances, one user can close the channel by broadcasting an on-chain transaction called a "force close". This on-chain transaction contains the most recent channel state and requires additional confirmation times on the Bitcoin network to finalize. Users will receive BTC from the multi-sig wallet according to the final channel state that was included in the transaction.
After reading all that you might be thinking "Sending payments between friends is great and all, but what if I want to send BTC to someone I don't have a payment channel open with"? Excellent question and the Lightning Network has got you covered! In that case, you would utilize a routing node that acts as an intermediary between you and your intended recipient. To start this transaction, your intended recipient would create a payment invoice that contains the payment amount and request. This payment invoice would then prompt your Lightning wallet to search for the most efficient route through the Lightning Network via routing nodes willing to forward your payment for a small fee, similar to how lightning naturally finds the path of least resistance from the sky to the ground. Once your payment is submitted and successfully routed to your intended recipient you will see a confirmation appear in your Lightning wallet.
So the Lightning Network sounds pretty great, right? Enabling cheap and fast Bitcoin transactions has entrenched the Lightning Network as Bitcoin's most widely adopted layer 2. However, the Lightning Network is not without its faults. The biggest problem currently facing the Lightning Network is its UX. While the UX has come a long way since 2018, the Lightning Network is still considerably more complicated for users to interact with than most other products in market. Another pain point is executing successful payments through routing nodes. A whole host of issues can impact routing nodes, such as payment channels unexpectedly closing or payment channels not containing enough liquidity to support the routed payment. Lastly, to participate in the Lightning Network, users' Lightning wallets and/or nodes must constantly remain online. This creates a large attack surface for user funds within the Lightning Network, given the best practice for Bitcoin mainnet is to keep funds held offline in cold storage.
However despite these drawbacks and a bear market for Bitcoin, the Lightning Network has seen an explosion of growth, with 2023 being one of its best years yet. According to a recent research report from River, a Bitcoin technology and financial company, the Lightning Network has seen an uptick in various metrics, such as:
1,212% increase in number of transactions since August 2021 (6.6M txns vs 503k txns)
546% increase of publicly routed funds since August 2021 ($78.2M vs $12.1M)
Average of ~600k monthly active users on the network
Increase in global distributed of Lightning nodes
Additionally, industry leading exchanges such as Coinbase and Binance have both implemented Lightning withdrawal services for users. Lastly, the Lightning Network has found PMF within the micropayments space for tipping, gaming, streaming and decentralized social media (such as Nostr), as the average Lightning transaction size is roughly $12, a payment amount that would not be feasible on Bitcoin mainnet.
For those of you who are now ready to ride the lightning and are thunderstruck about the Lightning Network and its future possibilities, below are some additional resources to further charge you up.
Until next time!
With all the talk and excitement around current Ethereum layer 2s such as Optimism, Arbitrum, and Base, it might surprise you to learn that Bitcoin was actually one of the first blockchains to have a widely available layer 2 - the Lightning Network. The Lightning Network was first proposed by Joseph Poon and Thaddeus Dryja in a whitepaper published in 2016 and eventually deployed to mainnet in early 2018. Within that whitepaper, the Lightning Network was described as a layer 2 solution designed to increase the scalability of the Bitcoin network. But you might be wondering, why does Bitcoin need a layer 2 scaling solution? Well to provide a bit more context, a new block is mined on the Bitcoin network roughly every 10 minutes, with an average block size of 2MBs. Although the amount of transactions and size of transactions within these blocks will vary, the general estimate is that Bitcoin has a whopping throughput of 7 transactions per second (tps). Compare that against Ethereum mainnet handling an average 14 tps, Solana handling an average 5,000 tps and major credit card companies handling an average of 10s of thousands of tps - Bitcoin has a long way to catch up if it aims to be the world's reserve currency and medium of exchange for everyday purchases. But why not just increase the block space or speed up the block time? Both of those options have been implemented by various Bitcoin hard forks, but inevitably these options would weaken the Bitcoin network's security, either via increased centralization due to large blocks or conflicting ledgers due to blocks being mined too fast - no bueno.
So then how does the Lightning Network help scale the Bitcoin network? The Lightning Network's secret sauce involves moving a significant amount of Bitcoin transactions from on-chain (i.e., the Bitcoin mainnet) to off-chain (i.e., the Lightning Network) to enable cheaper and faster transactions. To help flesh out that statement, consider the following example. At most salaried jobs, employees are paid on a bi-weekly basis. The employer internally tracks each day the employees work during the pay period, but only squares up with them every other Friday when payroll goes out. You could consider each day the employee works but does not get paid as an 'off-chain transaction', and every other Friday when payroll goes out as an 'on-chain transaction' as that's when the employer and employee square up for the work performed. If payroll were to be paid each day an employee performs work, this would most likely lead to increased loads on banking services and longer wait times for deposits to confirm.
Now with the above example in mind, the method by which off-chain transactions happen on the Lightning Network is accomplished via two on-chain transactions explained below.
Alice and Bob agree to open a Lightning Network payment channel which acts as an off-chain ledger that records their transactions between each other. This payment channel is opened via an on-chain funding transaction, where both users deposit some amount of BTC into a multi-sig wallet. For example, Alice could deposit 1 BTC and Bob could deposit 5 BTC. Once the BTC is deposited and the payment channel is open, Alice and Bob's BTC balance on the Lightning Network will show up in their Lightning wallet, which is separate from their Bitcoin wallet.
Once the payment channel is established, Alice and Bob can execute as many off-chain transactions between themselves as desired, as long as the transactions do not exceed the total amount of BTC deposited into the on-chain multi-sig wallet. Bob could repeatedly pay Alice in small increments until his 5 BTC balance runs out, or Alice and Bob could send 0.5 BTC back and forth between each other indefinitely just for the fun of it. All transactions in these off-chain payment channels are private, near instant, and have incredibly low fees since they are not broadcasted to the Bitcoin network. In other words, Alice and Bob are simply changing their ownership of the share of total BTC deposited into the multi-sig wallet.
Side note, it is possible to deposit additional BTC into the multi-sig wallet once a payment channel is open to increase its capacity. This is known as 'rebalancing' or 'topping up' a payment channel.
Once Alice and Bob decide they've had their fun, they can choose to close the payment channel. Closing the payment channel requires another on-chain transaction and can be done one of two ways:
Cooperative Close - Alice and Bob agree on the final state of their off-chain balances and both sign the on-chain transaction to square up on the Bitcoin network. For example, if Alice's final balance was 3 BTC and Bob's final balance was 3 BTC, each user would receive 3 BTC from the multi-sig wallet.
Non-Cooperative Close - if there is a dispute between Alice and Bob on the final state of their off-chain balances, one user can close the channel by broadcasting an on-chain transaction called a "force close". This on-chain transaction contains the most recent channel state and requires additional confirmation times on the Bitcoin network to finalize. Users will receive BTC from the multi-sig wallet according to the final channel state that was included in the transaction.
After reading all that you might be thinking "Sending payments between friends is great and all, but what if I want to send BTC to someone I don't have a payment channel open with"? Excellent question and the Lightning Network has got you covered! In that case, you would utilize a routing node that acts as an intermediary between you and your intended recipient. To start this transaction, your intended recipient would create a payment invoice that contains the payment amount and request. This payment invoice would then prompt your Lightning wallet to search for the most efficient route through the Lightning Network via routing nodes willing to forward your payment for a small fee, similar to how lightning naturally finds the path of least resistance from the sky to the ground. Once your payment is submitted and successfully routed to your intended recipient you will see a confirmation appear in your Lightning wallet.
So the Lightning Network sounds pretty great, right? Enabling cheap and fast Bitcoin transactions has entrenched the Lightning Network as Bitcoin's most widely adopted layer 2. However, the Lightning Network is not without its faults. The biggest problem currently facing the Lightning Network is its UX. While the UX has come a long way since 2018, the Lightning Network is still considerably more complicated for users to interact with than most other products in market. Another pain point is executing successful payments through routing nodes. A whole host of issues can impact routing nodes, such as payment channels unexpectedly closing or payment channels not containing enough liquidity to support the routed payment. Lastly, to participate in the Lightning Network, users' Lightning wallets and/or nodes must constantly remain online. This creates a large attack surface for user funds within the Lightning Network, given the best practice for Bitcoin mainnet is to keep funds held offline in cold storage.
However despite these drawbacks and a bear market for Bitcoin, the Lightning Network has seen an explosion of growth, with 2023 being one of its best years yet. According to a recent research report from River, a Bitcoin technology and financial company, the Lightning Network has seen an uptick in various metrics, such as:
1,212% increase in number of transactions since August 2021 (6.6M txns vs 503k txns)
546% increase of publicly routed funds since August 2021 ($78.2M vs $12.1M)
Average of ~600k monthly active users on the network
Increase in global distributed of Lightning nodes
Additionally, industry leading exchanges such as Coinbase and Binance have both implemented Lightning withdrawal services for users. Lastly, the Lightning Network has found PMF within the micropayments space for tipping, gaming, streaming and decentralized social media (such as Nostr), as the average Lightning transaction size is roughly $12, a payment amount that would not be feasible on Bitcoin mainnet.
For those of you who are now ready to ride the lightning and are thunderstruck about the Lightning Network and its future possibilities, below are some additional resources to further charge you up.
Until next time!
<100 subscribers
<100 subscribers
No activity yet