<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Que on Medium]]></title>
        <description><![CDATA[Stories by Daniel Que on Medium]]></description>
        <link>https://medium.com/@danielque?source=rss-6e7a86765482------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*H7tDVZ2kvMsFVU-YeRxwfA.jpeg</url>
            <title>Stories by Daniel Que on Medium</title>
            <link>https://medium.com/@danielque?source=rss-6e7a86765482------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 13:41:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danielque/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DeFi: Dependency Hell Meets Finance]]></title>
            <link>https://medium.com/@danielque/defi-dependency-hell-meets-finance-b9c3acd44d68?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9c3acd44d68</guid>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[defi]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Tue, 03 Mar 2020 18:52:47 GMT</pubDate>
            <atom:updated>2020-03-07T04:31:50.408Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRa9jkNQxOBrHgOrOsxzsg.png" /></figure><p><strong>Imagine </strong><a href="https://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm"><strong>npm bugs</strong></a><strong> for your money. </strong>In a sense, that’s what we’re creating with DeFi.</p><p>Financial engineering relies heavily on composability, and so does DeFi. This results in an interconnected, intertwined web of primitives. Imagine a SetProtocol Set (a smart contract). It could contain Compound cDAI (another smart contract). cDAI is a claim on DAI (yet another smart contract). To top it off, multi-collateral DAI could be backed by USDC or WBTC, <em>even more smart contracts.</em></p><p>It’s smart contracts all the way down.</p><p>If cDAI is frozen, Sets can’t be unbundled. If DAI loses its peg, lenders of <em>other</em> assets in Compound could bear the loss. Everything is affected.</p><p>We hear a lot about the magic of composability in DeFi, or “Money Legos.” I want you to remember that it could become “Money House of Cards” in a flash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*esTtDeodK8pmBQOybU1_fQ.png" /><figcaption><em>DeFi depicted as a house of cards.</em></figcaption></figure><p>This nested risk is called <em>Dependency Risk</em>, which is one of the six risks I cover in this <a href="https://www.youtube.com/watch?v=HSLQlPE-f3w">talk</a> at ETHWaterloo2. Other risks include: <em>Smart Contract Risk</em>, Li<em>quidity Risk</em>, <em>Admin Risk</em>, <em>Oracle Risk</em><strong>, </strong>and <em>Centralization Risk</em>. I plan to cover these in an upcoming blog post, so now’s a good time for you to <a href="https://forms.gle/sRVaBHBNRRrJV3in6">subscribe</a>.</p><h3>Vulnerabilities are inevitable</h3><p>Exploits are a question of <em>when</em>, not <em>if</em>. This isn’t surprising for an ecosystem as innovative and fast-paced as DeFi, but it’s all the more reason to take risks seriously.</p><p><strong>Developers have a finite amount of time to write code, but hackers have an unlimited amount of time to exploit it. </strong>In fact, developers are also squeezed by tight deadlines and the fast pace of startups. In a nutshell, it takes developers 3–6 months to ship a protocol, and it takes auditors 3–6 weeks to audit it. Developers make mistakes, auditors miss vulnerabilities, and hackers discover novel exploits. It’s happened before, and it’ll happen again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iOd1nwL0aguzFg2U8NqS6w.png" /><figcaption><em>Some notable vulnerabilities and exploits: </em><a href="https://blog.0xproject.com/shut-down-of-0x-exchange-v2-0-contract-and-migration-to-patched-version-6185097a1f39"><em>bZx 2</em></a><em>, </em><a href="https://blog.0xproject.com/shut-down-of-0x-exchange-v2-0-contract-and-migration-to-patched-version-6185097a1f39"><em>bZx 1</em></a><em>, </em><a href="https://blog.0xproject.com/shut-down-of-0x-exchange-v2-0-contract-and-migration-to-patched-version-6185097a1f39"><em>Compound</em></a><em> V1, </em><a href="https://blog.0xproject.com/shut-down-of-0x-exchange-v2-0-contract-and-migration-to-patched-version-6185097a1f39"><em>0x v2.0</em></a><em>, </em><a href="https://twitter.com/Bancor/status/1016420621666963457"><em>Bancor</em></a><em>, </em><a href="https://www.parity.io/a-postmortem-on-the-parity-multi-sig-library-self-destruct/"><em>Parity Self-Destruct</em></a><em>, </em><a href="https://hackingdistributed.com/2017/07/22/deep-dive-parity-bug/"><em>Parity Multisig</em></a><em>, </em><a href="https://medium.com/@pullnews/understanding-the-dao-hack-for-journalists-2312dd43e993#.i6eydda9x"><em>The DAO</em></a><em>.</em></figcaption></figure><p><strong>Exploits will happen more and more as hackers realize how feasible, lucrative, and unpunished they are. </strong>The recent <a href="https://www.theblockcrypto.com/linked/56134/defi-lending-protocol-bzx-exploited-a-portion-of-eth-lost">back</a> to <a href="https://www.theblockcrypto.com/post/56207/bzx-attacked-again-645k-in-eth-estimated-to-be-lost">back</a> bZx exploits are great examples, given how simple they are at their core. They can be explained in less than 280 characters each:</p><h3>Daniel Que on Twitter</h3><p>The recent bZx attacks are fascinating. Here&#39;s my simplest explanation: Exploit 1: The attacker used bZx margin to pump the price of wBTC/ETH on Kyber. They then sold the overpriced wBTC. Since they used lenders&#39; funds to pump the price, lenders are left holding the bags.</p><h3>Daniel Que on Twitter</h3><p>Exploit 2: The attacker pumped the price of sUSD on Kyber to $2. They deposited sUSD into bZx as collateral and used it to borrow more ETH than they should&#39;ve been allowed. They then ran away with the borrowed funds with no intention to pay back their underwater loan.</p><p>Not bad for a day’s work.</p><p>The hacker(s) will be probably never be punished. They were clever to cover their tracks with anonymity tools like <a href="https://tornado.cash/">tornado.cash</a>, but it looks like that might’ve been unnecessary:</p><h3>Daniel Que on Twitter</h3><p>Should exploiting smart contracts be a crime:</p><p>Many think that exploiting smart contracts should be allowed. (Whether they’d really let a de-anonymized hacker walk is another question, but the point still stands.) You can’t rob a bank and get away scot-free, but you can rob a DeFi bank and get away scot-free. (Remember folks, the c̶u̶s̶t̶o̶m̶e̶r̶ code is always right.)</p><p>You (the bank robber) don’t even need to be ultra technical. You don’t need to be well-capitalized either, thanks to flash loans. The bZx oracle exploit could’ve been conceived and executed by any <em>striped-shirt-wearing-tiptoer</em>, without expert Solidity skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/0*BNYspm_hGl3GmMkL" /><figcaption><em>It might not look like it, but this bandit has millions in good money stashed in that little bag.</em></figcaption></figure><p>This reminds me of another vulnerability discovery in Augur, <a href="https://www.youtube.com/watch?v=8zJD1zsTfQs&amp;feature=youtu.be&amp;t=120">told by Scott Bigelow</a>:</p><blockquote>We ran a HackerOne bounty. […] What was interesting is that somebody read the high-level description of how Augur was supposed to work, didn’t even look at the code, and filed a bug bounty.</blockquote><p>Another nugget:</p><blockquote>This is very well tested code. But we’re testing the wrong thing.</blockquote><p>Smart contract bugs are one thing, economic bugs are entirely different.</p><h3>Mitigating Risk</h3><p>So, should you park your life savings in DeFi so you can earn 12%? Probably not, but don’t take my financial advice (which isn’t financial advice by the way). For those who are doing it anyway, you can mitigate risk a couple of ways:</p><ul><li><strong>Require contracts to be audited</strong>. To go a step further, verify that the audit was done by a reputable firm. To go a step further, read the audit report yourself. To go a step further, remember that dependency risk means you should also do this with every dependency. And every dependency’s dependencies. And every dependency’s dependencies’ dependency. You can see how hard it is to do this properly.</li><li><strong>Use the test of time.</strong> The longer a smart contract sits plump and exposed, available for the world to exploit it, the more likely it is that it won’t be exploited. (See the <a href="https://en.wikipedia.org/wiki/Lindy_effect">Lindy effect</a>.) Two caveats: first, some hackers might be like the Witch from Hansel and Gretel, waiting for the kids to fatten up before feasting. Second, the Ethereum VM itself may change with a future hard fork, introducing vulnerabilities that didn’t exist before. Just because code is secure today, doesn’t mean it will be tomorrow.</li><li><strong>DeFiScore: </strong>For those who don’t have the time to read audits on their own (basically everyone), you can look to those who do. <a href="https://defiscore.io/">DeFiScore</a> is a place to start. However, note that Fulcrum (bZx) scored as high as 7.1/10 yet was still exploited.</li><li><strong>DeFi insurance</strong>. (Or should I say <a href="https://devpost.com/software/defisurance"><em>DeFisurance</em></a>? 😉 @nemild may be accepting bids for defisurance.com 🙂) Talented teams are working on crypto-native approaches to insurance. One I’m excited about is <a href="https://opyn.co/">Opyn</a>, which uses put options for cTokens to insure Compound deposits. Of course, these smart contract systems have their own set of risks that need to be mitigated. That said, I’m looking forward to seeing how things play out.</li></ul><h3>Conclusion</h3><p>Dependency risk is often overlooked, so I hope you think back to this article the next time you come across a shiny new DeFi product. It’s inevitable that we’ll see more exploits in the future, and I want us to be more prepared for them. I look forward to seeing risk mitigation improve, and seeing DeFi taken to the masses.</p><p>But for now I’ll leave you with this: composability is a double-edged sword.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*UyGuOG0qco8UhZA1" /><figcaption>Dependency risk is the yin to composability.</figcaption></figure><p><em>Thank you for reading! I like Tweeting </em><a href="https://twitter.com/danielque"><em>@dmdque</em></a><em>. Sign up </em><a href="https://forms.gle/sRVaBHBNRRrJV3in6"><em>here</em></a><em> to be notified of future posts. Thanks to Nemil Dalal (@nemild), Regina Cai (@lildex), Jing Wang, Tyson Batistella, Stani Kulechov, and Hart Lambur for the feedback on this article!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9c3acd44d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving the Ethereum Developer Ecosystem with Libraries]]></title>
            <link>https://medium.com/cryptofin/improving-the-ethereum-developer-ecosystem-with-libraries-5a95ffaf632d?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a95ffaf632d</guid>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Mon, 13 Aug 2018 15:41:45 GMT</pubDate>
            <atom:updated>2018-08-13T15:41:45.568Z</atom:updated>
            <content:encoded><![CDATA[<p>The Ethereum development ecosystem is lacking many tools which we take for granted in other programming environments. That’s why we’ve been working on our <a href="https://github.com/cryptofinlabs/cryptofin-solidity">cryptofin-solidity</a> library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XI7OvbYbRHAhjzMii-FBjw.jpeg" /><figcaption>The Stadtbibliothek Stuttgart (library) in Germany.</figcaption></figure><p>A good library lets developers write less code which <strong>reduces bugs</strong> and <strong>saves development time</strong>. For blockchain development, libraries are even more impactful because they:</p><ul><li><strong>save gas</strong> for end users if they’re optimized</li><li>reduce the amount of code that needs to be audited</li></ul><p>We’ve collected various methods in our <a href="https://github.com/cryptofinlabs/cryptofin-solidity">cryptofin-solidity</a> repo, with an initial focus on array utilities.</p><p>We’ll show you how to set it up in less than 10 seconds, then dive into some interesting code that’ll make you feel like you’ve done something productive today!</p><h3>Quickstart</h3><pre>npm install --save cryptofin-solidity</pre><h4>Use it in a project</h4><p>Assuming you’re using Truffle or something similar:</p><pre>import &quot;cryptofin-solidity/contracts/array-utils/AddressArrayUtils.sol&quot;;</pre><pre>contract Contract {<br>  using AddressArrayUtils for address[];</pre><pre>  function containsDeadBeef(address[] memory addresses)<br>    returns (bool)<br>  {<br>    return addresses.contains(address(0xdeadbeef));<br>  }</pre><pre>}</pre><p>And that’s it!</p><p>For more examples and documentation, see the <a href="https://github.com/cryptofinlabs/cryptofin-solidity">GitHub</a>.</p><h3>Into the weeds</h3><p>Let’s look at some cool and useful functionality.</p><h4><a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/AddressArrayUtils.sol#L9">indexOf</a> and <a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/AddressArrayUtils.sol#L23">contains</a></h4><p>indexOf gives the first index of an element in an array. It returns (uint256, bool) which allows us to implement contains in just two lines using multiple assignment:</p><pre>(, bool isIn) = indexOf(A, a);  // Ignore uint256 index<br>return isIn;</pre><h4><a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/UIntArrayUtils.sol#L7">map</a>, <a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/UIntArrayUtils.sol#L19">reduce</a>, <a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/UIntArrayUtils.sol#L34">filter</a></h4><p>These are cool because they use a relatively unknown feature of Solidity: functional programming!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4SJxCFYPYXig65nbDR5tA.png" /></figure><p>reduce and filter follow similar patterns.</p><p>Example:</p><pre>uint256[] memory nonZeros = array.filter(isNonZero);</pre><h4><a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/AddressArrayUtils.sol#L85">union</a></h4><p>Using other library functions included in cryptofin-solidity (difference, intersect, and extend), we can very easily compute the union of two sets.</p><p>Recall that the union of two sets is:</p><p>{A - B} + {A ^ B} + {B - A}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ksRNQDmC0Ps2_Ae78MKXbg.png" /></figure><h4><a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/AddressArrayUtils.sol#L210">sPopCheap</a></h4><p>Let’s break it down:</p><ul><li>s: signifies that this operates on a storage array rather than a memory array (the default)</li><li>pop: removes the element at the given index and returns that element</li><li>cheap: The usual way to implement pop is to delete the element at index and shift all subsequent elements to the left. The gas costs scale <em>O(n)</em>, so an alternate algorithm is used to achieve <em>O(1)</em>: swap the element at index with the last element, then delete the last element.</li></ul><p>sPopCheap doesn’t preserve the array order, and is meant to be used with unordered lists. Another function, sPop preserves order but is more expensive.</p><p>We chose to keep the more expensive version as sPop because it behaves as expected for new developers.</p><h4><a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/UIntArrayUtils.sol#L58">argFilter</a> and <a href="https://github.com/cryptofinlabs/cryptofin-solidity/blob/bcb54149f530172c3c5bd70a9ed827ca00425d0a/contracts/array-utils/UIntArrayUtils.sol#L83">argGet</a></h4><p>argFilter returns the indices that would filter an array, and is inspired by numpy’s <a href="https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.argsort.html">argsort</a>. argGet is like numpy’s <a href="https://docs.scipy.org/doc/numpy-1.14.0/user/basics.indexing.html#index-arrays">indexing of arrays notation</a>.</p><p>It allows us to work with data with the following structure:</p><pre>uint256[] ids: [0, 1, 2, 3, 4]</pre><pre>uint256[] ages: [20, 35, 14, 24, 48]</pre><pre>address[] addresses: [<br>  0x403B5178d38Cf0520F29592c1536061Ef59ff0BD,<br>  0xF206af3D25f9Fa27b8E68bbA7E6Da953707663D2,<br>  0xa1949d9c2fd3B13A47B04Ae05353C0A3A7573Eb8,<br>  0xf163A8D25BF8c09a9Df4e376A50538FeD301e18c,<br>  0xB5172c7E6B545Fa9Bdd1adCA46fb4e03150C6b0e<br>]</pre><p>Let’s say we want to filter out anyone under the age of 21.</p><pre>function noYoungins(uint256 a) pure returns (bool) {<br>  return a &gt;= 21;<br>}</pre><p>Then,</p><pre>uint256[] memory indexArray = ages.argFilter(noYoungins);</pre><pre>filteredIDs = ids.argGet(indexArray);<br>filteredAges = ages.argGet(indexArray);<br>filteredAddresses = addresses.argGet(indexArray);</pre><h3>Next Steps</h3><p>We’d love it if you <a href="https://github.com/cryptofinlabs/cryptofin-solidity/pulls">contributed</a> any general code you’ve written that’s suitable for a library! We’ve met some great developers at events like ETHGlobal, so we know you’re out there reading this!</p><p>In the near future, we’ll be tackling the following (and would appreciate some help):</p><ul><li>More functionality</li><li>More tests</li><li>Documentation</li><li>Gas analysis</li><li>Gas optimization</li><li>Auto-generated libraries for different types (uint128, uint64, etc.)</li></ul><p>We hope this library is useful for your next Solidity project!</p><p><em>Thanks to </em><a href="https://twitter.com/nemild"><em>Nemil Dalal</em></a><em>, </em><a href="https://twitter.com/trembleice"><em>Mert Çelebi</em></a><em>, </em><a href="https://twitter.com/GrahamKaemmer"><em>Graham Kaemmer</em></a><em>, and </em><a href="https://twitter.com/liamihorne"><em>Liam Horne</em></a><em> for feedback on drafts!</em></p><p><em>CryptoFin designed Bskt, a way to create decentralized ERC20 token portfolios. Join our </em><a href="https://t.me/cryptofinlabs"><em>Telegram group</em></a><em> for updates.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a95ffaf632d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cryptofin/improving-the-ethereum-developer-ecosystem-with-libraries-5a95ffaf632d">Improving the Ethereum Developer Ecosystem with Libraries</a> was originally published in <a href="https://medium.com/cryptofin">CryptoFin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CryptoFin’s Solidity Auditing Checklist]]></title>
            <link>https://medium.com/@danielque/cryptofins-solidity-auditing-checklist-36833fc70e14?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/36833fc70e14</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[auditing]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Tue, 19 Jun 2018 20:53:56 GMT</pubDate>
            <atom:updated>2018-06-20T17:33:05.448Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last year, hundreds of millions of dollars worth of crypto have been lost by faulty smart contracts.</p><p>Beyond devastating those who lose funds, these blunders harm the ecosystem as a whole by signaling the immaturity of smart contracts and reinforcing people’s wariness. Better due diligence processes could’ve prevented many of the issues found, saving a ton of headaches, money, and stifled progress.</p><p>At CryptoFin, we’ve audited many production-ready Solidity contracts such as <a href="https://fanbits.com/">Fan Bits</a> (by <a href="https://rarebits.io/">Rare Bits</a>) and <a href="https://dydx.exchange/">dYdX</a>. We’ve compiled a list of common findings, and issues to watch out for when auditing a contract for a mainnet launch.</p><p>We hope this checklist is useful to the community and will raise the bar for contract quality!</p><p><a href="https://github.com/cryptofinlabs/audit-checklist"><em>View the checklist on GitHub</em></a><em>:</em></p><p><a href="https://github.com/cryptofinlabs/audit-checklist">cryptofinlabs/audit-checklist</a></p><p><a href="https://drive.google.com/file/d/1hTVEcPE9I-_w6dj3R6qIhWB_ig8AV5DN/view?usp=sharing"><em>View the PDF checklist here.</em></a></p><p><em>CryptoFin created offers smart contract auditing services. Follow us on </em><a href="https://twitter.com/cryptofinlabs"><em>Twitter</em></a><em>, </em><a href="https://t.me/cryptofinlabs"><em>Telegram</em></a><em>, or email us at </em><a href="/service/mailto:hi@cryptofin.io"><em>hi@cryptofin.io</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36833fc70e14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EIP-999 sensationalism and the law of triviality]]></title>
            <link>https://medium.com/@danielque/eip-999-sensationalism-and-the-law-of-triviality-5a55fd54dfc0?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a55fd54dfc0</guid>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[parity]]></category>
            <category><![CDATA[eip-999]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 07:45:38 GMT</pubDate>
            <atom:updated>2018-04-25T07:51:31.211Z</atom:updated>
            <content:encoded><![CDATA[<p>The contentious and sensational <a href="https://github.com/ethereum/EIPs/pull/999">EIP-999</a> has been getting a flurry of media attention.</p><p>EIP-999 outlines a proposal for a hard fork to recover the $330 million USD of Ether lost in the infamous Parity hack.</p><p>The likelihood of this proposal being approved by the Ethereum foundation and community appears very slim. Ethereum hard-forked once before to recover funds from the DAO hack, but this had a negative impact on the ecosystem which took a long time to recover. Many vowed it would be the first and <em>only</em> time.</p><p>Ethereum is no longer a nascent technology, and there’s a plethora of alternative blockchain platforms waiting to capitalize on a moment of weakness.</p><p>Despite this proposal being just that: a proposal (with weak prospects), everyone seems to be talking about it. I think this is a good time to recall the <a href="https://en.wikipedia.org/wiki/Law_of_triviality">Law of Triviality</a>:</p><blockquote>Everyone can visualize a cheap, simple bicycle shed, so planning one can result in endless discussions because everyone involved wants to add a touch and show personal contribution.</blockquote><p>In other words, be aware of how this issue’s coverage is being blown out of proportion. It’s a sensational topic that’s easy to cover and easy to have an opinion about, which is just what I did here!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a55fd54dfc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PSA: How to fix GitHub’s syntax highlighting for Solidity]]></title>
            <link>https://medium.com/@danielque/psa-how-to-fix-githubs-syntax-highlighting-for-solidity-4e9867c540b6?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e9867c540b6</guid>
            <category><![CDATA[syntax]]></category>
            <category><![CDATA[highlights]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Tue, 17 Apr 2018 18:46:50 GMT</pubDate>
            <atom:updated>2018-08-09T05:57:09.710Z</atom:updated>
            <content:encoded><![CDATA[<p>GitHub doesn’t support detecting .sol files as Solidity for syntax highlighting, and the current best solution is simple but not well known.</p><h3>Problem</h3><p>GitHub uses <a href="https://github.com/github/linguist">linguist</a> to enable language-related features. According to linguist’s maintainers, the .sol file extension is too generic to assign to Solidity.</p><h3>Solution</h3><p>Add a .gitattributes file to your repo’s root with the following contents:</p><pre>*.sol linguist-language=Solidity</pre><p>Examples:</p><ul><li><a href="https://github.com/cryptofinlabs/bskt/blob/master/.gitattributes">.gitattribute file</a></li><li><a href="https://github.com/cryptofinlabs/bskt/blob/master/contracts/BsktToken.sol">.sol file with syntax highlighting working</a></li></ul><p>You may have to wait a while, or push another commit to .sol files for it to take effect.</p><h3>Conclusion</h3><p>Since .sol can’t be assigned to Solidity, there’s some discussion around assigning .solidity to Solidity instead. This “consolation prize” is much less than ideal since the current convention has wide usage and deep roots. Changing the convention just to cater to a private git hosting company doesn’t make sense.</p><p>Perhaps when Solidity becomes popular enough, .sol will also be automatically classified by linguist.</p><p>More in-depth discussion can be found <a href="https://github.com/github/linguist/pull/3973">here</a>.</p><p><em>I’m working on </em><a href="https://twitter.com/cryptofinlabs"><em>CryptoFin</em></a><em>, the creators of </em><a href="https://www.getbskt.com/"><em>Bskt</em></a><em> and a smart contract auditing firm. You can follow our progress on </em><a href="/service/ttps://t.me/cryptofinlabs"><em>Telegram</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e9867c540b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What we learned from auditing the top 20 ERC20 token contracts]]></title>
            <link>https://medium.com/@danielque/what-we-learned-from-auditing-the-top-20-erc20-token-contracts-7526ef3b6fb1?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/7526ef3b6fb1</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[token]]></category>
            <category><![CDATA[erc20]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Wed, 28 Mar 2018 16:31:00 GMT</pubDate>
            <atom:updated>2018-08-12T03:43:56.996Z</atom:updated>
            <content:encoded><![CDATA[<p>We recently reviewed the top 20 ERC20 token contracts as part of our process for launching <a href="https://cryptofinlabs.github.io/">Bskt</a>.</p><p>Bskt is a way to create decentralized token portfolios. A holder can use a single token to hold a number of Ethereum tokens, much like an ETF. Unlike an ETF, you always retain custody of the underlying tokens.</p><p>Since Bskt depends directly on ERC20 tokens, we had to ensure they’d behave properly. In an Ethereum contract, <em>a single issue in a deeply nested dependency can break the functionality of the entire client contract</em>. As such, it’s critical to ensure that no ERC20 token functionality can break our Bskt contract.</p><p>We hope that our process and lessons will be valuable to other teams that use external contract dependencies in the Ethereum ecosystem.</p><p>Before we get started, the token contracts we looked at are: EOS, Tron, VeChain, Icon, Populous, OmiseGO, Binance Coin, DigixDAO, 0x, Augur, Waltonchain, Bytom, Status, IOStoken, Zilliqa, Kyber Network, Basic Attention Token, Aelf, Qash, AdEx, and Maker.</p><h4>What to look for</h4><p>Our primary focus was to ensure that ERC20 token contracts would work well with our <a href="https://github.com/cryptofinlabs/bskt/blob/master/contracts/BsktToken.sol">Bskt contract</a>. Bskt’s two primary functions are:</p><ul><li>create: Surrender one or many different underlying ERC20 tokens for a Bskt token (<a href="https://github.com/cryptofinlabs/bskt/blob/master/contracts/BsktToken.sol#L98">source code</a>)</li><li>redeem: Surrender Bskt tokens for the relevant ERC20 tokens (<a href="https://github.com/cryptofinlabs/bskt/blob/master/contracts/BsktToken.sol#L124">source code</a>)</li></ul><p>For our purposes, we focused on these key ERC20 methods that Bskt’s two methods interacts with:</p><ul><li>transfer</li><li>approve</li><li>transferFrom</li></ul><h4>Our approach</h4><p>Each contract was assessed by two separate teams of developers. We also incentivized our team based on issues found that the other team didn’t find.</p><p>Nearly a third of the time developing Bskt was spent auditing external dependencies. We highly encourage other Ethereum dev teams to be aware of the dangers in external dependencies. Unlike software development in most systems, it’s critical to read the implementation of deployed contracts you depend on — not just the interface.</p><h3>Key findings</h3><blockquote>Nearly half of the top 20 projects can have their token transfers completely frozen by an owner</blockquote><h4>Pausing</h4><p>Though many think of Ethereum contracts as fully decentralized, nearly half of the top 20 projects can have their token transfers completely frozen by an owner (a single key or a multisig contract). <em>Pausing</em> can be valuable for future upgrades, swaps, and disaster mitigation but also leads to new risks.</p><p>The pausable tokens we reviewed are: EOS, Tron, Icon, OmiseGo, Augur, Status, Aelf, Qash, and Maker. Some of the tokens implement pausing largely because they’re moving to their own blockchain, and want to freeze their ERC20 tokens.</p><p>The ability to pause can lead to two issues:</p><ul><li><strong>Trust</strong>: It requires all users to trust the party in charge of the key, reducing the degree of decentralization in the contract.</li><li><strong>Security risk</strong>: It requires the key holder(s) to secure the private key. An attacker (i.e., a disgruntled employee) could hold the network hostage and demand a ransom by freezing transfers, or short the token which is sure to drop in value.</li></ul><p>A naive implementation of our Bskt contract that doesn’t handle pausing would fail on the redemption of all tokens, if a single token was paused.</p><p>Instead, our contract lets you skip a paused token — removing the risk that a single ERC20 token pause could hold the other tokens hostage.</p><p>For new ERC20 token creators, our recommendation is to implement pausing conservatively, and to consider splitting privileges into separate owner addresses, similar to what Unix does with user groups.</p><h4>Unverified code</h4><p>Verifying source code on Etherscan is optional, but is something most popular token contract dev teams have done.</p><p>Only one team from our assessment, <a href="https://etherscan.io/address/0xb5a5f22694352c15b00323844ad545abb2b11028#code">Icon</a>, did not post their code. The contract hosted in their <a href="https://github.com/icon-foundation/ico">GitHub</a> was reviewed instead, but without verification there’s no way to guarantee it matches the code in the blockchain (and we tried a number of combinations).</p><p>We opened a <a href="https://github.com/icon-foundation/ico/issues/2">GitHub issue</a> (which you should upvote) requesting them to verify their contract with Etherscan. In general, we highly recommend posting your code on Etherscan (not just Github) as it:</p><ul><li>Makes it easy for other to build on top of your contract,</li><li>Ensures that many eyes can look at your contract (and not publishing — i.e., <a href="https://en.wikipedia.org/wiki/Security_through_obscurity">security by obscurity</a> — is a poor method to ensure security).</li></ul><h4>ERC20 “Standard”</h4><p>Some of the most popular Ethereum tokens were created early in Ethereum’s life before ERC20 was finalized, and so do not fully comply with ERC20 behavior:</p><ul><li>Golem’s GNT doesn’t implement approve, making it technically not an ERC20 token, and incompatible with Bskt.</li><li>Several contracts throw on transfers of 0 tokens rather than logging the amount.</li></ul><p>Additionally, the idea of an ERC20 “standard” is amorphous compared to other standards in technology (i.e., IETF standards). For example, the standard specifies “should” rather than “must” for some critical behaviors (discussion <a href="https://github.com/ethereum/EIPs/issues/721#issuecomment-333025719">here</a>).</p><h4>Usability vs. Security</h4><p>The <em>zero race condition approval attack</em> is can occur when you change your approve amount to a given contract. For example, you want to reduce the amount approved from 1 ETH to 0.5 ETH. The approved contract can race to transfer the money you initially approved (the 1 ETH) and then also spend the money you just approved (0.5 ETH), rather than being restricted to the updated value.</p><p>Some tokens’ approve methods enforce behavior to fix the <a href="https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729">zero race condition approval attack</a>.</p><p>While enforcing better security, it reduces usability since two transactions are required to change the approved amount. The first transaction requires zeroing the approve balance, and then setting the approve balance to the new value.</p><p>(While this doesn’t affect our contract, it does affect our soon-to-be-released dapp, which needs to handle both types of contracts.)</p><h4>Burning by Sending to 0x0</h4><p>Some tokens (like Tron) implement burning by sending tokens to address 0x0, rather than reducing the totalSupply state variable. While both approaches work, the lack of standardization makes it harder to determine the circulating supply.</p><h4>Miscellaneous</h4><p>There were a few final specific notes for certain contracts:</p><ul><li>Binance Coin allows users to freeze their own funds, which then requires them to unfreeze it before transferring. Note that this is different from pausing transfers as discussed, which BNB doesn’t do. This is covered in more depth <a href="https://medium.com/@danielque/bnb-token-freeze-functionality-ca37d5630bda">here</a>.</li><li>Contracts like AdEx’s handle the <a href="http://vessenes.com/the-erc20-short-address-attack-explained/">short address attack</a> vector with a modifier. The <a href="https://github.com/OpenZeppelin/zeppelin-solidity/issues/261">consensus</a> instead is that it should be handled by client libraries, such as web3.js.</li></ul><h3>Conclusion</h3><p>Auditing downstream contracts when developing protocols is easy to overlook for many software engineers, especially when they are used to more popular software ecosystems like npm.</p><p>For experienced software engineers new to Solidity, we encourage a different mindset more akin to a hardware engineer (where failure is costly and reprogramming is hard). This mindset requires you to understand all dependencies in depth, as well as their interaction effects.</p><p>Performing this audit was a critical milestone for us before releasing Bskt.</p><p><em>About CryptoFin</em></p><p><em>CryptoFin has designed Bskt, a way to create decentralized ERC20 token portfolios. If you ever have your own questions about code correctness in blockchain contracts, </em><a href="/service/mailto:hi@cryptofin.io"><em>drop us a note</em></a><em>. You can also </em><a href="https://t.me/cryptofinlabs"><em>join our Telegram group</em></a><em>.</em></p><p><em>Thanks to </em><a href="https://www.nemil.com/"><em>Nemil</em></a><em> for reviewing and editing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7526ef3b6fb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing Bskt, a smart contract for creating decentralized token portfolios]]></title>
            <link>https://medium.com/cryptofin/announcing-bskt-a-smart-contract-for-creating-decentralized-token-portfolios-6307c24dc0b9?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/6307c24dc0b9</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency-investment]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Mon, 26 Mar 2018 14:46:00 GMT</pubDate>
            <atom:updated>2018-03-26T14:46:00.807Z</atom:updated>
            <content:encoded><![CDATA[<p>CryptoFin is releasing <strong>Bskt</strong>,<strong> </strong>an Ethereum smart contract that lets you compose any number of different Ethereum (ERC20) tokens into a single Ethereum token.</p><p>Our <a href="https://github.com/cryptofinlabs/bskt-whitepaper">whitepaper</a> provides full details and you can create your own bskt using our <a href="https://github.com/cryptofinlabs/bskt">source code</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*wo6iQ3rOWu1NmaVTtnZmUQ.png" /></figure><p>As interest in cryptocurrencies has grown, thousand of tokens have been launched on the Ethereum blockchain. Our Ethereum contract allows anyone to compose any number of different ERC20 tokens into a single token. Gone are the days you have manage tens — or hundreds — of Ethereum tokens.</p><p>Much like an ETF, Bskt makes it convenient and cost-effective to hold a number of ERC20 tokens, while in actuality maintaining ownership of a single token.</p><p>Unlike traditional ETFs, users maintain custody of the underlying assets. Anyone can convert their Bskt tokens back into the underlying tokens <em>without any external approval</em>. Bskts also work with any Ethereum smart contract — and the holdings are fully transparent.</p><p>The ERC20-compliant Bskt contract we’re releasing allows one to:</p><ul><li><strong>instantiate</strong> a custom Bskt with both pre-specified underlying tokens and a selected proportion,</li><li><strong>create</strong> Bskt tokens in exchange for surrendering underlying tokens,</li><li><strong>redeem</strong> Bskt tokens for the underlying tokens, and</li><li><strong>transfer</strong> the ownership of Bskt tokens</li></ul><p>Visually, a Bskt can be created and redeemed in the following way:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*Ku22mrZ6UiXfhDDefZ7t7A.png" /><figcaption>This sample Bskt contract is composed of Token A, Token B, and Token C which can together be exchanged for bskt tokens.</figcaption></figure><p>While some exchanges are creating their own cryptocurrency indexes, they’re not tradeable. A Bskt token can be traded on exchanges across the world, providing large liquidity and an accepted standard token across exchanges. In the future, we’ll provide technical capabilities for rebalancing — and extracting tokens that are migrating off the Ethereum blockchain.</p><p>CryptoFin will be launching the first official Bskt instance soon. It will track some of the top ERC20 tokens, weighted by market cap. <a href="https://goo.gl/forms/oe41vl9nKSMrG23V2">Sign up to be notified when we launch</a>.</p><p><em>The CryptoFin team does not sell tokens, and to create your own token you must buy the underlying tokens — and make the relevant Ethereum call to bundle them. All code is provided AS IS — please use at your own discretion.</em></p><p>If you’re interested in using Bskt for your own purposes, please get in touch. Or <a href="https://t.me/cryptofinlabs">join our Telegram group</a>.</p><p><em>See the Bskt </em><a href="https://github.com/cryptofinlabs/bskt-whitepaper"><em>whitepaper</em></a><em> and the </em><a href="https://github.com/cryptofinlabs/bskt"><em>source code</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6307c24dc0b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cryptofin/announcing-bskt-a-smart-contract-for-creating-decentralized-token-portfolios-6307c24dc0b9">Announcing Bskt, a smart contract for creating decentralized token portfolios</a> was originally published in <a href="https://medium.com/cryptofin">CryptoFin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Putting your crypto to work: how to earn passive income]]></title>
            <link>https://medium.com/@danielque/putting-your-crypto-to-work-how-to-earn-passive-income-aa7b151d4e75?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa7b151d4e75</guid>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Wed, 14 Mar 2018 05:39:38 GMT</pubDate>
            <atom:updated>2018-06-04T21:11:19.654Z</atom:updated>
            <content:encoded><![CDATA[<p>When people think about crypto investments, most think to the stellar increase in value of crypto assets. Not everyone is aware that like most forms of wealth, it’s possible to earn compoundable passive income from crypto.</p><p>In the current bull market these dividends may appear negligible compared to value gained by simply holding a coin. However they add up to something substantial over time so like any form of investing: the earlier you start, the better.</p><h3>Lending</h3><p>Poloniex runs a peer-to-peer margin trading system in which users are able to trade with funds borrowed by other users. There’s no additional risk to the lender due to margin call mechanisms. This passes all of the risk onto the borrower by liquidating their funds before they’re unable to pay back their debt.</p><p>By lending you’ll collect an interest rate on a periodic basis. The rate and duration of a loan is determined by an order book, giving you some control over how much interest you’ll earn.</p><p>I find lending exciting since it allows you to generate passive income from coins that otherwise wouldn’t.</p><p>Notes:</p><ul><li>The market rate fluctuates with demand which tends to spike when volatility is high. Typical rates range from 0.0001% to 0.1% per 2 days. When prices are volatile, rates can go up a lot. Poloniex has more info <a href="https://poloniex.com/support/aboutMarginTrading/">here</a>, and I highly recommended this informative <a href="https://steemit.com/bitcoin/@cryptomancer/how-to-earn-passive-income-from-lending-your-bitcoin-on-poloniex">blog post</a>.</li><li>Poloniex takes a 15% cut of the fees, which is absolutely deserved given the work involved in implementing this feature.</li></ul><p><strong>Estimated annual return</strong>: 2%</p><h3>Proof of Stake mining</h3><p>Proof of Stake (PoS) secures the network similarly to how Proof of Work does. It’s essentially a virtual Proof of Work, with many benefits.</p><h4>Ethereum</h4><p>Ethereum will soon be moving to Proof of Stake mining with the Casper project.</p><p>Ethereum’s PoS will only be profitable if enough Ether is being staked due to gas costs. Parameters have not yet been finalized, but it’s been suggested by Vitalik that this figure could be 1000 to 4000 ETH. This is too much for most people, but staking pools like Rocketpool exist to overcome this.</p><p><strong>Estimated annual return</strong>: TBD</p><h4>Neo</h4><p>Holding Neo in the Neon wallet will automatically produce Gas. Note that the Gas reward will decrease over time, eventually converging to zero. Only some exchanges will credit Gas to your account, like Binance which does it on a monthly basis.</p><p>Use <a href="https://neotogas.com/">neotogas</a> to calculate how much Gas you’ll receive.</p><p><strong>Estimated annual return</strong>: 7%</p><h3>Masternodes</h3><p>Masternodes were pioneered by Dash and have since been copied by other projects. Masternodes are special nodes which provide additional services to the network.</p><p>In general Masternodes work by running the special node software, and require some number of coins to be eligible.</p><h4>Dash</h4><p>Dash Masternodes primarily InstantSend and PrivateSend as a service to the network. To run a Masternode, 1000 DASH is required. Though it was feasible to accumulate this amount a year ago, it’s now much too expensive for a typical investor.</p><p><a href="https://masternode.me/">Masternode.me</a> provides a masternode hosting service for those lucky enough to have 1000 Dash. They also provide a pooling service in which a Masternode is divided into 40 shares for 25 DASH each.</p><p>Check payout stats on <a href="https://dash-news.de/dashtv/#value=1000">dash-news</a>.</p><p><strong>Estimated annual return</strong>: 7%</p><h3>Miscellaneous</h3><h4>Stellar</h4><p>Stellar has an inflation mechanism that you can take advantage of to increase your holdings.</p><blockquote>The Stellar distributed network has a built-in, fixed, nominal <a href="https://www.stellar.org/developers/guides/concepts/inflation.html#inflation">inflation</a> mechanism. New lumens are added to the network at the rate of 1% each year. Each week, the protocol distributes these lumens to any account that gets over .05% of the “votes” from other accounts in the network.<br>(<a href="https://www.stellar.org/developers/guides/concepts/inflation.html">source</a>)</blockquote><p>The threshold for reaching that .05% of the votes is high considering the market cap of Stellar. This means you either have to be a whale, or join a pool. Here are some pools you can choose from:</p><ul><li><a href="https://pool.futuretense.io/">futuretense</a></li><li><a href="http://xlmpool.com/en.html">xlmpool</a></li></ul><p>These pools require you to provide your private key, so be weary. Decide whether or not to trust them with your funds by doing your own research.</p><p><strong>Estimated annual return</strong>: 1%</p><h4>Airdrops</h4><p>Airdrops are slightly different but worth mentioning. Some <a href="https://medium.com/@demluo/distributed-ledger-technology-6e7c20ace7bb">distributed ledger</a> projects distribute their tokens based on the current distribution of another Blockchain, usually Ethereum.</p><p>If you manage your private keys, you can claim free tokens (though sometimes there’s a bounty task involved.)</p><p>The most difficult part about this is staying up to date on which airdrops are happening.</p><p><strong>Estimated annual return</strong>: N/A</p><h4>Hard Forks</h4><p>Hardforks went from being a dreaded contentious event to an anticipated event once people realized they were getting free money. The first major hard fork was Ethereum Classic.</p><p>Ideally you control your private keys, since exchanges and wallets are slow to credit accounts with forked currencies, if ever.</p><p>Once again, it’s difficult keeping track of which projects have significant upcoming hard forks.</p><p><strong>Estimated annual return</strong>: N/A</p><h3>Conclusion</h3><p>The best cryptocurrencies to use for passive income today are Neo and Dash. Lending is notable since it allows you to earn from coins you were planning to hold anyway, and don’t natively provide passive income.</p><p>Be aware that some of these payouts are similar to dividends, and are subject to being regulated more strictly in the future. Earning rewards as a result of work such as running a masternode are more legally defensible.</p><p>With the plethora of coins, I’ve undoubtedly omitted some. While I actively avoided untrustworthy projects, there are certainly many I simply don’t know about. Leave a comment if you think I should include more.</p><p><em>I’m working on some awesome Blockchain stuff, launching soon. Follow me on </em><a href="https://medium.com/@danielque"><em>Medium</em></a><em> and </em><a href="https://twitter.com/danielque"><em>Twitter</em></a><em> to stay in the loop.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa7b151d4e75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Ethereum addresses have some capitalized letters]]></title>
            <link>https://medium.com/@danielque/why-ethereum-addresses-have-some-capitalized-letters-b8e55728ecaa?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8e55728ecaa</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Tue, 13 Mar 2018 18:37:55 GMT</pubDate>
            <atom:updated>2018-03-13T18:53:42.480Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered why Ethereum addresses have some capitalized letters?</p><p>It’s a checksum, meant to provide some validation that it’s a valid Ethereum address. Other crypto projects like Bitcoin employ a a checksum as additional bytes in the address, which has been vital for preventing funds from being accidentally locked forever. Ethereum has millions (USD) worth of Ether and tokens locked due to unintentional transactions.</p><p>The checksum helps prevent these mistakes since clients can (and should) validate that the checksum is correct.</p><p>The checksum algorithm works by capitalizing some alphabetical hex (abcdef) characters based on a heuristic. If the 4·ith bit of the hash of the lowercase hexadecimal address is 1.</p><p>For example, the address 0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed is a valid checksummed address.</p><p>The checksum algorithm is laid out in full detail <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md">here</a>.</p><p>Here’s another good explanation from a Reddit <a href="https://www.reddit.com/r/ethereum/comments/4wxbkf/why_do_eth_addresses_contain_both_capitalized/d6aol6f/">comment</a>.</p><p><em>I’m working on some awesome Blockchain stuff, launching soon. Follow me on </em><a href="https://medium.com/@danielque"><em>Medium</em></a><em> and </em><a href="https://twitter.com/danielque"><em>Twitter</em></a><em> to stay in the loop.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8e55728ecaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BNB token’s perplexing freeze functionality]]></title>
            <link>https://medium.com/@danielque/bnb-token-freeze-functionality-ca37d5630bda?source=rss-6e7a86765482------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca37d5630bda</guid>
            <category><![CDATA[binance]]></category>
            <category><![CDATA[ethereum]]></category>
            <dc:creator><![CDATA[Daniel Que]]></dc:creator>
            <pubDate>Thu, 08 Mar 2018 07:50:22 GMT</pubDate>
            <atom:updated>2018-03-09T03:55:28.135Z</atom:updated>
            <content:encoded><![CDATA[<p>When reading through <a href="https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#code">BNB’s source code</a>, I came across an interesting finding. I can only speculate about it, and am hoping the community can help figure it out.</p><p>Binance implements freeze and unfreeze methods on its BNB token contract. Now, it’s not what you may think it is — it doesn’t allow Binance to freeze users’ balances. Instead, it allows any user to freeze and unfreeze their <em>own</em> funds.</p><p>The freeze feature is implemented with the not-so-well-named freezeOf state variable. We can check frozen balances by querying it. The following screenshot shows the BNB token owner’s regular balance and frozen balance, denominated in BNB base units.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*D9CjnntKA6eOaslWr9cP9w.png" /><figcaption><a href="https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#readContract">https://etherscan.io/address/0xB8c77482e45F1F44dE1745F52C74426C631bDD52#readContract</a></figcaption></figure><p>It shows that the team is holding around 730 million USD worth of BNB in their regular balance, and around 580 million USD worth in their frozen balance.</p><p>The reason for this feature perplexes me. I couldn’t find any mention of it in their <a href="https://www.binance.com/resources/ico/Binance_WhitePaper_en.pdf">whitepaper</a> nor any answers from online searches. (Searches for “binance” and “freeze” variations bring up results about closed or frozen exchange accounts.)</p><p>Possible use cases I’ve considered are:</p><ul><li><strong>Security</strong>: It’s an extra step (though a minor one) for someone to withdraw the funds.</li><li><strong>Obfuscation</strong>: An account can “hide” their balance from those who don’t know about this feature. At the very least it makes it more work to query.</li></ul><p>Neither of these are convincing to me. If you have a better suggestion, what is it?</p><p>Reddit user <a href="https://www.reddit.com/user/Jane-Delavega">Jane-Delavega</a> has cleared this up in their <a href="https://www.reddit.com/r/ethtrader/comments/82zode/bnb_tokens_perplexing_freeze_functionality/dves24c/">comment</a>.</p><blockquote>From the whitepaper:</blockquote><blockquote><em>BNB Vesting Plan for the Team<br>Initial release: 20% (16MM)<br>After 1 year: 20% (16MM)<br>After 2 year: 20% (16MM)<br>After 3 year: 20% (16MM)<br>After 4 year: 20% (16MM)</em></blockquote><blockquote>The frozen 64m BNB is the team allocation that is still vesting.</blockquote><blockquote>In July another 16m BNB of the team allocation will be unfrozen. The trading fee with BNB discount will also increase from 0.050% to 0.075% in July. All else being equal, this will increase Binance’s profit from trading fees. They use 20% of their profit to buyback &amp; burn BNB until 100m BNB is removed from the circulating supply.</blockquote><p>Mystery solved!</p><p><em>I’m working on some awesome Blockchain stuff, launching soon. Follow me on </em><a href="https://medium.com/@danielque"><em>Medium</em></a><em> and </em><a href="https://twitter.com/danielque"><em>Twitter</em></a><em> to stay in the loop.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca37d5630bda" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>