Hacker News new | past | comments | ask | show | jobs | submit login
Real Problems That Web3 Solves, Part 2 (billprin.com)
13 points by waprin on Jan 12, 2022 | hide | past | favorite | 5 comments



Fair markets... where unregulated wash trades happen with even more wealth concentration than IRL?

Not a complete picture here, just enough to be convenient to the author's goals


This is the best article I've read on the topic here. Thank you for sharing. I'd love see a history of defi from the author at some point. It's such an interesting space, and the critics talking about how a use case for blockchain hasn't been discovered in 11 years seem to miss that defi is basically a fetus at this point.

And real-world applications for blockchain tech outside of finance have yet to be conceived.

For anyone interested in non-defi applications of decentralized applications, this talk by Vitalik Buterin is really good: "Things that matter outside of defi" (https://www.youtube.com/watch?v=oLsb7clrXMQ)


A couple questions:

- if a “defi” currency swap is happening between two parties, how is it performed without a centralized application making the trade?

- if there is in fact a centralized application making the trade, who owns it and how are they making money?


Currency swaps typically happen with automated market makers, where users deposit liquidity into pools, and people who want to swap add the token they want to dispose of and receive the token they want to trade it for (there are other types of automated market makers, but the most popular is the Uniswap v2 model because it's open source and relatively simple).

These pools are managed by smart contracts which run on the blockchain. People providing liquidity deposit their tokens, and as the pool grows from swap fees being added to it, the users' share of the pool also grows.

Here's a random transaction of someone swapping north of 1 quadrillion MGCHI tokens for ~1.3 ethereum: https://etherscan.io/tx/0x3ba500dbf1ba316798f14a98d0d12e8d2e...

The transaction created by the user (whose account address starts with 0x68...) called the `swapExactTokensForETHSupportingFeeOnTransferTokens` function of the Uniswap v2 router contract and sent the MCGHI tokens to it (tokens are actually managed by smart contracts governed by Ethereum's ERC standards as well, so if a user has some number of tokens, the contract for the token actually accounts for that).

The contract being interacted with can be seen here (https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb...)

However, this contract apparently interacts with many other contracts which handle (I'm assuming) routing their trade through different pools to give them the best rate, and unwrapping the wETH (wrapped Ethereum which follows the ERC20 standard) into native Ethereum (the native token of the Ethereum blockchain). The reason for this is because wrapped Ethereum behaves the same as other ERC-20 tokens, and can be interacted with in contracts the same as other tokens, so someone, probably the Ethereum foundation, set up a contract where you can send Ethereum and receive wrapped Ethereum, or send wrapped Ethereum and receive Ethereum.

Due to all the computation that happened as part of this transaction (which is effectively composed of many transactions between different smart contracts), the user paid ~$181 in Ethereum for 'gas'. If any step in the interaction had failed, the gas for the computation that already happen would still need to be paid

In practice, most humans using Uniswap are going to use their UI and wallet software (the most popular of which is metamask). When a user makes a trade, the site sends an unsigned transaction to the wallet software, and the software then asks the user to approve/sign it, or reject it. If the user agrees to sign it (usually after confirming that the details of the inputs and outputs are what they expect, and if they're extra-diligent, that the contract address is listed in Uniswap's official documentation), then the transaction is signed with their private keys and sent to the blockchain.

At some point a miner (and validators which are being phased in) will include the transaction in a block, and execute the code in the smart contracts being interacted with to compute various things (in this case, how much Ethereum the user receives, and how much MCGH/Ethereum goes into the pool for transaction fees). The computation is verifiable by all the other network participants since the contract bytecode is part of the distributed ledger.

And so it goes.

By the way, I don't use the Ethereum blockchain at all due to these incredibly high fees (most 'retail' traders don't). Instead I mainly interact with cheaper blockchains which are still EVM compatible, and have bridges to Ethereum. Ethereum still gets a lot of use from the crypto-rich, institutions, and bots though because it's seen as the settlement layer for all smart contract blockchains (and it literally is the settlement layer for many of the layer 2 blockchains)


the implication that open source/contract makes this inherently more fair than say the US SEC regulated markets due to complexity seems questionable to me.

As a platform trends towards complexity the expertise to audit and validate similarly rises.

Code being published does not necessarily equal code being audited.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: