{"componentChunkName":"component---src-templates-post-template-js","path":"/posts/crypto/cosmos","result":{"data":{"markdownRemark":{"id":"f81786ad-31d4-564f-9adc-f952626f2f7c","html":"<h2 id=\"cosmos\" style=\"position:relative;\"><a href=\"#cosmos\" aria-label=\"cosmos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Cosmos</h2>\n<p>Most blockchains have:</p>\n<ol>\n<li>Shared execution layer</li>\n<li>Smart contracts</li>\n</ol>\n<h2 id=\"what-do-i-mean-when-i-say-cosmos\" style=\"position:relative;\"><a href=\"#what-do-i-mean-when-i-say-cosmos\" aria-label=\"what do i mean when i say cosmos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>What do I mean when I say Cosmos?</h2>\n<ul>\n<li>Not Cosmos Hub</li>\n<li>Not $ATOM</li>\n<li>Cosmos SDK: Tendermint Consensus + IBC Modules + other stuff</li>\n</ul>\n<h3 id=\"philosophy\" style=\"position:relative;\"><a href=\"#philosophy\" aria-label=\"philosophy permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Philosophy</h3>\n<ul>\n<li>Instead of shared execution layer, you want application specific chains.</li>\n<li>\n<p>Benefit 1: You have control</p>\n<ul>\n<li>Precompiles - code that denotes complicated computations cheaper on chain. If you don’t have a precompile, you need to use the evm. E.g. cryptography. Defined in clients Cacn technically use .com domain as ENS, but this is extremely expensive to do DNSSEC onchain since cryptography isn’t on chain. Might cost $1000 some money to verify</li>\n<li>Novel consensus/Protocol Design. Osmosis wants to prevent MEV from happening; they want to use threshold encryption to do so. Thus, Osmosis can embed this in their chain</li>\n</ul>\n</li>\n<li>\n<p>Benefit 2: Blockspace Monopoly</p>\n<ul>\n<li>Vertical Scaling brings problems like state bloat, computation power. Solana drops Merkle trees from client design to improve L1 scaling.</li>\n<li>Cosmos Approach: Instead of scaling vertically, you can create your own blockchain and scale horizontally. If each application has their own separate throughput, Polygon doesn’t get rekt bc people are playing sunflower games.</li>\n</ul>\n</li>\n</ul>\n<h2 id=\"ibc\" style=\"position:relative;\"><a href=\"#ibc\" aria-label=\"ibc permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>IBC</h2>\n<ul>\n<li>relies on instant finality</li>\n<li>TCP/IP - not a bridge</li>\n<li>easy to add Cosmos based blockchains and other blockchains with {easy way to create light client proofs, Relayer}</li>\n<li>peg zone</li>\n<li><strong>Relayer</strong>: trustless way to send data from one blockchain to another. Think of it as a cable that can transmit data from one chain to another. Security comes from the light client proof, relayers have no verification.\nEnd Goal: Each wallet is its own relayer. Relayers also get transaction fees in the future. Currently, relayers are subsidized via the Interchain foundation(Ethereum foundation equivalent)</li>\n<li>No flash loans, flash mints, flash anything via IBC bc that requires atomicity.</li>\n<li>Can do token transfers, cross chain swaps</li>\n</ul>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 960px; \"\n    >\n      <a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/66d60f0716e433b21353b3ed744a166d/29114/IBCpic.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 29.583333333333332%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAIAAABM9SnKAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAlUlEQVQY03WPyRLDIAxD8/9fGsKSBspSCGnf4Jk2B6qD0RjLkpf3QO/9ui6IVCHnefaB1tq3f8ciT0ophPAcYLSUAokx5pyF1FrnYrbyJ8rjONjinEP2GmARq/86M7pt22MAsq6r915uEUyVP2ccEOBABKz2fafKzVT6JIdMxEyQVmstmY0xcKattRyChqZSilw07+IP4TFe5hIiFucAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <picture>\n          <source\n              srcset=\"/static/66d60f0716e433b21353b3ed744a166d/8ac56/IBCpic.webp 240w,\n/static/66d60f0716e433b21353b3ed744a166d/d3be9/IBCpic.webp 480w,\n/static/66d60f0716e433b21353b3ed744a166d/e46b2/IBCpic.webp 960w,\n/static/66d60f0716e433b21353b3ed744a166d/f992d/IBCpic.webp 1440w,\n/static/66d60f0716e433b21353b3ed744a166d/882b9/IBCpic.webp 1920w\"\n              sizes=\"(max-width: 960px) 100vw, 960px\"\n              type=\"image/webp\"\n            />\n          <source\n            srcset=\"/static/66d60f0716e433b21353b3ed744a166d/8ff5a/IBCpic.png 240w,\n/static/66d60f0716e433b21353b3ed744a166d/e85cb/IBCpic.png 480w,\n/static/66d60f0716e433b21353b3ed744a166d/d9199/IBCpic.png 960w,\n/static/66d60f0716e433b21353b3ed744a166d/07a9c/IBCpic.png 1440w,\n/static/66d60f0716e433b21353b3ed744a166d/29114/IBCpic.png 1920w\"\n            sizes=\"(max-width: 960px) 100vw, 960px\"\n            type=\"image/png\"\n          />\n          <img\n            class=\"gatsby-resp-image-image\"\n            src=\"/static/66d60f0716e433b21353b3ed744a166d/d9199/IBCpic.png\"\n            alt=\"IBCpic\"\n            title=\"IBCpic\"\n            loading=\"lazy\"\n            style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n          />\n        </picture>\n  </a>\n    </span></p>\n<h2 id=\"ibc-research\" style=\"position:relative;\"><a href=\"#ibc-research\" aria-label=\"ibc research permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>IBC Research</h2>\n<p>Quick notes</p>\n<ul>\n<li>Bc of the blockchain trilemma{decentralization, scalability, security}, applications will use multiple blockchains to achieve the trilemma</li>\n<li>To communicate between blockchains</li>\n<li>Deploy contract on Ethereum: meant to communicate with validators</li>\n<li>Send package to validators</li>\n<li>Validators communicate with solana blockchain\nEg If transferring USDT, you lock USDT on ethereum contract and mint synthetic USDT on solana blockchain\n<strong>Validator:</strong> Who runs the validators between chains?</li>\n</ul>\n<h2 id=\"ibc-1\" style=\"position:relative;\"><a href=\"#ibc-1\" aria-label=\"ibc 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>IBC</h2>\n<ul>\n<li>Handle Authentication, ordering data packets between blockchains, can use</li>\n<li>Recall above, the package needs to be validated</li>\n<li>Do you need to use IBC + a bridge?\nMental model: IBC is a validator. (Who runs the validator?)\nGoal: Manage communication between two modules. This involves sending/receiving packets with establish connection</li>\n</ul>\n<h2 id=\"how-ibc-works\" style=\"position:relative;\"><a href=\"#how-ibc-works\" aria-label=\"how ibc works permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How IBC works</h2>\n<ul>\n<li>Properties of IBC: Data confidentiality + Legibility: Send as little data to validator as possible + validator needs to understand the data</li>\n<li>Reliability: Relayer + blockchain works independently, there is a chance of dropping packets. This is managed by a sequence number per packet.</li>\n<li>Flow Control: Depends on ledger, IBC does not have overriding rule</li>\n<li>Authentication: Whenever IBC is to be used, data must be first on the originating blockchain. - IBC handler(validator?) verifies the data</li>\n<li>Statefulness: Three parts - clients, connection, channel</li>\n<li>Clients: info about state of both blockchains\nconnection: identifiers/data structures agreed by both blockchains</li>\n<li>Channel: info about encoding info, state, sequence numbers</li>\n<li>Multiplexing: smart contracts can use single IBC connection. Generally one to one but IBC supports one to many and many to one</li>\n<li>Relayer - keeps watch of state chain from origin chain(ie Ethereum in example above)</li>\n</ul>\n<h2 id=\"use-case\" style=\"position:relative;\"><a href=\"#use-case\" aria-label=\"use case permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Use Case</h2>\n<p>Why switch networks when purchasing insurance on other chain?</p>\n<ul>\n<li>If vault and pool are connected with IBC, user can buy insurance from any chain while spending from mainnet wallet.</li>\n</ul>\n<h2 id=\"questions\" style=\"position:relative;\"><a href=\"#questions\" aria-label=\"questions permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Questions?</h2>\n<p>Confirmation time is 15 seconds on ETH, Bitcoin is 10 minutes, can we still use IBC?\nNeed to wait 10 minutes?</p>\n<p>What about reorgs? There’s never true finality on proof of work chains right?\nSolved via validators?</p>\n<p>Learning - Learn more about cosmos\nDocument - Publish technical articles, explainer articles, based on learning\nBuidling - play with cosmos ibc, a bit tough scotty doesn’t believe in us :(, Spinning up dapp chain, running a relayer</p>\n<h1 id=\"questions-1\" style=\"position:relative;\"><a href=\"#questions-1\" aria-label=\"questions 1 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Questions</h1>\n<h2 id=\"subnets-vs-cosmos\" style=\"position:relative;\"><a href=\"#subnets-vs-cosmos\" aria-label=\"subnets vs cosmos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Subnets vs Cosmos</h2>\n<ul>\n<li>There is an expectation that you share security with Avalanche. Problem is that shared security isn’t free, you need to pay avalanche validators for this.</li>\n<li>\n<p>Tendermint is novel: instant finality + 2/3 network validators needs to be aligned. Instant finality is huge because it simplifies multichain consensus. In a proof of work blockchain, by the virtue of a 51% attack, blocks are not final since you can end up with uncle blocks<a href=\"https://medium.com/dragonfly-research/dr-reorg-or-how-i-learned-to-stop-worrying-and-love-mev-2ee72b428d1d\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">reorgs</a></p>\n<ul>\n<li>This is bad for bridges because a transaction where you burn a token to mint it via a bridge to a different chain can be reverted due to a reorg.</li>\n<li>bridge UX gets killed</li>\n<li>Multihop dexes can take a very long time because you need to wait for probabilistic finality.</li>\n</ul>\n</li>\n<li>\n<p>Are there Oracles natively in Cosmos?</p>\n<ul>\n<li>No current oracles, but can built oracle chain &#x3C;— big brain project right here</li>\n</ul>\n</li>\n</ul>","fields":{"slug":"/posts/crypto/cosmos","tagSlugs":["/tag/notes/","/tag/crypto/","/tag/cosmos/"]},"frontmatter":{"date":"2021-12-30T23:46:37.121Z","description":"A deep dive into cosmos","tags":["Notes","Crypto","cosmos"],"title":"Cosmos"}}},"pageContext":{"slug":"/posts/crypto/cosmos"}},"staticQueryHashes":["251939775","401334301","825871152"]}