We've been referring back to Bitcoin a lot since it's one of the oldest and most popular
blockchain systems, so it's subject to a lot of talk about scalability – especially
since it's been studied extensively and many scalability solutions have been proposed
for it.
Again to recap Bitcoin, transactions have very long delays.
On average, 6 confirmations on a transaction will take 1 hour.
Transaction fees are also pretty inconsistent – historically during winter 2018, becoming
insanely high.
Here's a graph of the daily transaction fees in US dollars per transaction.
As you can see, in winter 2018, transaction fees spiked to 37 dollars per transaction.
Nowadays, it's around just a couple cents.
But the inconsistencies, and also the upper bound in the possible transaction fees just
comes to show that Bitcoin really isn't economical for low value items.
I drink a lot of coffee, and I don't want to be paying up to 10 times what I normally
pay.
So the idea here is that since transaction fees are so expensive, clearly, just using
the blockchain at all is expensive.
Why can't two users Alice and Bob make payments between themselves without always needing
to consult the blockchain?
Perhaps they could transaction amongst themselves for a bit – perhaps Alice is a regular customer
at Bob's coffee shop – and then only consult the blockchain every once in a while to settle
an aggregate amount.
After all, paying a single transaction fee for what was actually a month's worth of
transactions for example would be pretty good.
We could call this a private payment channel – just between two users, Alice and Bob.
So how would we actually implement a private payment channel between Alice and Bob?
Well, they could maintain a private balance sheet, tracking each of the transactions they
conduct amongst themselves.
Initially, the private balance sheet would start off with however much money both Alice
and Bob have set aside.
So in the diagram below, say Alice starts off with 10 bitcoins, and Bob has 5 bitcoins.
After purchasing an extremely rare cup of coffee, Alice pays Bob 2 bitcoins, and they
both agree to update their balance to the following: Alice now has 8 bitcoins ,and Bob
has 7.
Say again that Alice is a regular customer at Bob's super high end coffee shop, and
they'd like to settle their net balances weekly, so they'd consult the blockchain
then.
This way, they could avoid having to undergo the high fees and long confirmation times
of regular on chain transactions.
This is how Alice and Bob's payment channel would look like.
First, Alice and Bob open a private balance sheet, letting it be known that this is the
case on the blockchain.
They both start off with some initial balances.
Alice and Bob then make several private transactions amongst each other.
When Alice and Bob want to close their private payment channel later on, they publish it
and their net balances on the blockchain.
So we'd want to be able to create blockchain enforceable contracts between users.
This could be done with smart contracts, and in Bitcoin's case, be written in Bitcoin
script.
This way, we can encode the proper functionality so that neither party in a payment channel
can cheat the other.
In blockchain, we call them payment channels, but we generally also mean to specify the
technical mechanism by which we achieve payment channel functionality, and that's with Hash
TimeLock Contracts, or HTLCs.
HTLCs use tamper evidence techniques to make sure that neither party cheats, and for integrity
of information, hence the H in HTLC, standing for Hash.
The TL stands for TimeLock, and is the name for the mechanism by which we can schedule
an action in the future, for example the refunding of transactions.
Implementation details.
And we would like to implement this as a contract of some sort on a blockchain system.
The goal of this all is to enable a bi-directional payment channel so that both parties in a
payment channel can pay each other with the guarantees of a contract governing all actions
– including incentives for not cheating.
So let's walk through a short little demo for a payment on a payment channel.
Say two users Alice and Bob set up a payment channel, and this is the initial state – state
0 – of their private balance sheet.
To do so, they need to create essentially a 2-of-2 multisig between them, and each pay
in their initial amounts.
For example, here, Alice has 10 bitcoins, and Bob has 0, for a total of 10 bitcoins
in this payment channel.
There exists an issue of trust within the payment channel though.
We don't want to require Alice to completely trust Bob in the payment channel, so we can
design around that.
We won't get too deep into the implementation details of HTLCs, but suffice it to say that
at any point in time, either Alice or Bob can attempt to exit out of their payment channel.
What they need for this is to get both parties to agree, or to wait a large number of blocks,
say 1000 blocks.
So say Alice pays Bob 3 bitcoins.
Now we're in state 1, where Alice has 10 bitcoins, and Bob has 3.
Again, this is all done off chain, so for this transaction, neither Alice nor Bob had
to incur high transaction fees or long confirmation times.
So if both Alice and Bob are happy with their transactions, they can at any point post back
to the blockchain to settle their final balances.
And this is done with each others' signatures and secret information.
On the other hand, to bring back the issue of trust, say Alice and Bob don't trust
each other, and for good reason.
So Alice paid 3 bitcoins earlier, but now she wants to revert back to an earlier state,
to before she paid Bob the 3 bitcoins.
She does this by attempting to exit the HTLC with their previous balances.
However, the only way she can do this without Bob's signature is to wait 1000 blocks.
And at any time, Bob can see that Alice is trying to cheat him out of his money, and
then claim all the funds in channel – an incentive to prevent cheating.
Now some key observations from our payment channel demo, and of payment channels in general.
Firstly, we have a mechanism for countering cheating.
If Alice and Bob are in a payment channel and one of them try to cheat, the other can
always override and take all the money in the deposit.
And that's assuming at least one of the two will try to cheat the other.
If Alice and Bob always cooperate,
then they can stay in their payment channel however long they like, and keep transacting.
Alice and Bob never have to touch the blockchain, except for when they want to create the payment
channel in the first place, and at the very end – whenever they choose – to settle
their final balances after their series of transactions.
And of course the main motivation for payment channels.
It enables huge savings in terms of how much we have to interact with the blockchain.
We saw that the blockchain was inherently slow, and sought to use it as infrequently
as possible.
With payment channels, we only need two transactions on the blockchain: one to initiate a payment
channel, and one to settle the final state.
With only two transactions on the blockchain, we can support any arbitrary number of local
transactions between two users Alice and Bob.
And depending on how many times and how frequently Alice and Bob transact, the scalability could
be pretty high.
There remain some issues though.
Firstly, both participants Alice and Bob need to have capital locked up in the HTLC before
they can send money to each other.
And the money is locked such that it can ONLY be used in the HTLC, meaning that if Alice
transacts with many people other than Bob, then she afford can't lock up all that she
owns.
Also, she has to make sure that she doesn't run out of capital in the existing HTLC.
If she locks up 10 bitcoins to begin with, and purchases a 2 bitcoin coffee every morning
from Bob, then she should probably look into locking up more capital next time she and
Bob enter a HTLC.
It's the most benefit for the underlying blockchain that Alice and Bob conduct as many
transactions as possible off chain before settling the final balance on the blockchain,
since that was our main goal.
So, we would want HTLCs to have bi-directional payments as much as possible.
And that ties right into another issue, which is that with the payment channel enabled by
an HTLC, we're only making it easier for Alice and Bob to send money between themselves.
So what if Alice wants to send money to Charlie, but doesn't have or want a payment channel
set up between herself and Charlie?
Especially if Alice only intends on transacting once or twice with Charlie, it's not worth
to set up a payment channel.
We could potentially set up a network of payment channels.
As long as Alice is connected to Charlie somehow in the network, she can send him money.
For more infomation >> 「猫の街」- 和田明 - Duration: 5:54. 





For more infomation >> Lyrical Video: Shahjaan Dawoodi ^ Yaade Tara Man Dil Daat ^ Saleem Sabit ^ Single Song 2018 - Duration: 6:09. 
For more infomation >> Star Control Origins: Обзор. Прохождение и Гайд на Русском - Duration: 1:17:59.
For more infomation >> これが俺のバイクだ!〜CVOハーレーストリートグライドの巻〜(日本語字幕) - Duration: 25:40.
For more infomation >> Suspect identified in Young's Food Mart shooting - Duration: 0:20. 
For more infomation >> Funny videos Mix Antivirous বলেনতু দেখি এদের মিরগি রোগ নয় কি? - Duration: 5:23. 



Không có nhận xét nào:
Đăng nhận xét