xDai is a new network created by POA Network in which Dai, a stablecoin, is the native currency of that chain. POA and Etherisc have joined forces to showcase how decentralized insurance DApps can be used on xDai, with the additional benefits of much faster transactions without the price volatility. Igor Barinov and Dmitry Savitsky presented the results of this joint effort at D1Conf.
These slides are courtesy of Igor Barinov, POA Network and Dmitry Savitsky, Etherisc
2. Ethereum dAPP in a minute or less.
● The heart of a
decentralized app is
a family of logical
contracts
permanently
deployed to
blockchain.
● The deployer has
no power over the
contracts apart
from the privileges
explicitly
described in
contracts
themselves.
● The only interface for
change of contract
state is through
blockchain
transactions, which
must be signed and
paid for by a certain
account.
● Any web-interface
is usually just a
guideline for the
user’s local
ethereum network
client on what
data to send in a
direct transaction
to the network.
4. Issue #1. Transaction speed.
One block
averages on
around 15
seconds.
Need at least
two blocks to
underwrite a
policy.
(At the moment, it’s 14,1 seconds. But still.)
9. Issue #3. ETH Volatility.
ETH price chart for the last 90 days
10. Issue #3. ETH Volatility.
ETH price chart for the last 90 days
11. About POA Networks
- Ethereum Sidechains
- 2nd Layer Scalability
Solution
- Usability, Scalability,
Interoperability
- Launched xDai Chain, an
Ethereum sidechain with
stable native token
12. Sidechains vs Mainnet 2/2
POA xDai Chain POA Core Chain Ethereum Mainnet
Block Time 5 sec 5 sec 15 sec
Gas Price Fixed (1GWei) Fixed (1GWei) Auctioned (1-100
GWei)
Blocks Empy Empty Full
Platform usage price Fixed in Dai (USD) Volatile Volatile
13. What is Dai
- Each Dai is worth $1
- All Dai are backed by real assets, a surplus of collateral that
has been escrowed into smart contract on Ethereum
Mainnet
- It’s solvency doesn’t rely on trusted counterparties
- It’s a currency that lives entirely on blockchain
- It’s stability is unmediated by locality
14. What is xDai Chain
- The first ever “USD stable Blockchain” with Dai bridged
from Ethereum
- “Hard spoon” sidechain
- No emission
- No premine
- Total supply of sidechain equals to bridged Dai
15. Benefits for developers of POA xDai Chain
- Compatible with Ethereum
- Benefits of tools, scalability, and interoperability of POA
- Stable platform for smart contracts
- Smart contract price is stable
- Platform usage is stable
- Balances are stable
Editor's Notes
Hello, my name is Dmitri, I am an engineer working for Etherisc, the team involved in development of the insurance service called FlightDelay.
+ FlightDelay is a pilot insurance application Etherisc let out into the blockchain wilds to test the concept. So over the course of its development and evolution, a number of problems arose that needed to be solved in order for it to work out. Spoiler alert: everything turned out pretty fine in the end, but these solutions made the resulting product more complex than it could potentially be. And it is my belief that the thing is perfect not when there is nothing more to add, but when there is nothing left to remove.+
Please, raise your right hand if you have a general idea of how an application operating on blockchain works. Good, now raise your left hand if you understand how insurance process is usually organized, the stuff with premiums, risk models, risk pools, insurers and reinsurers. If you have both hands up, you can now go “Weeee…”.
The heart of a decentralized app is a family of logical contracts permanently deployed to blockchain.
The deployer has no power over the contracts apart from the privileges explicitly described in contracts themselves.
The only interface for change of contract state is through blockchain transactions, which must be signed and paid for by a certain account.
Any web-interface is usually just a guideline for the user’s local ethereum network client ( wallet ) on what data ( contract number, contract function name, function parameters ) to send in a direct transaction to the network
So how does a basic insurance ethereum-app look and work? That would be a specific case of the previous, in which the end-user has one main operation to perform - ordering an insurance policy. He transfers the premium amount and provides some basic data on which flight he needs to be insured - date and flight number - and than the process is taken over by the smart-contracts.
First thing that needs to be done after that request is an underwrite procedure - the contracts need to consult an external source, called Oracle, for the statistical data for the specified flight. And than decide, according to their internalized risk model, what amount of payout can be offered for the given premium, if any.
The first problem Fight Delay stumbled upon after the launch was in the long transaction times. An Ethereum network operates on a 15-second block length, and some of the transactions just can’t be in the same block. Who would have guessed it, but for the modern user, the wait time of over 30-something seconds is a big deal.
But that’s not all. 30-something seconds to wait is actually the case of an absolutely best scenario. You see, the volume of transactions that actually gets into any given block is limited by the properties of the network. And for Ethereum network, it is often less than the accumulated volume of all pending transactions for the moment. Which means that some of them get left behind, to queue for the spot on the next block.
And it is not a first-come-first-served queue. Because the entities that assemble the blocks get to pick and choose, and naturally they choose the ones that offer the largest amounts of compensation per operation performed. Or just the ones who offer a certain amount. And there are indeed periods of crazes that fill the network with high-fee transactions. So if you set too low of an incentive on the transaction you send, you are stuck waiting for the low-tide periods of the network. Mind you, that is the parameter that the end-user sets, actually. And even if Flight Delay app could do anything but propose an amount - that would be one more constantly fluctuating variable to keep track of.
In the end, the wait times got too long even for the users who understood the limitations of the technology and were ready to sit down and watch the spinner for some time. We had to notify the user that the transaction was pending, but could take an indefinite amount of time. Essentially, it boiled down to having to send an email after the fact that would notify the insurer of the outcome. And, honestly, the application could do without that integration, and without storing the user email addresses.
On top of that all, with the expensive transactions taking priority, the network gradually evolved to take up more gas per transaction, requiring the end-user and us, app providers, to spend non-negligible sums on processing as well. There is a certain minimum amount that you must be willing to pay if you want the transaction to go through at all. And after that you need to pay three times more if you want it to be fast, and up to nine times more if you want priority treatment.
The third major problem here was around volatility of the cryptocurrencies used to fuel the whole machine. You see, whenever things go during the lifetime of the insurance policy, somebody is unhappy.
If the prices of the currency go down, than if the undesired incident occurs - the buyer is getting less than he expected, and he is twice as unhappy.
If the price goes up - than he is getting paid essentially extra, making the risk pool holder extremely unhappy.
In the end, it is hard to persuade any license provider to deal in pure Ethereum. So Flight Delay is an insurance application keeping a public ledger of policies on-chain. The user has an option to go through the usual credit card payment process, and the initial transactions are made on his behalf, and with the transaction costs converted and subsidized, by the app. The resulting payout gets converted and paid back in the currency of the premium as well.
As you probably could guess, all these conversions in and out do significantly complicate the process and the logic of the application as well.
What it boils down to, it is hard to persuade any license provider to deal in pure Ethereum. So Flight Delay is an insurance application keeping a public ledger of policies on-chain. The user has an option to go through the usual credit card payment process, and the initial transactions are made on his behalf, and with the transaction costs converted and subsidized, by the app. The resulting payout gets converted and paid back in the currency of the premium as well.
As you probably could guess, all these conversions in and out do significantly complicate the process and the logic of the application as well.