<?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 Timur Badretdinov on Medium]]></title>
        <description><![CDATA[Stories by Timur Badretdinov on Medium]]></description>
        <link>https://medium.com/@Destiner?source=rss-80df300f23ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*sEI3eM2nGiXFP99frNWlMg.jpeg</url>
            <title>Stories by Timur Badretdinov on Medium</title>
            <link>https://medium.com/@Destiner?source=rss-80df300f23ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 14:50:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Destiner/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[Clique: cross-client Proof-of-authority algorithm for Ethereum]]></title>
            <link>https://medium.com/@Destiner/clique-cross-client-proof-of-authority-algorithm-for-ethereum-8b2a135201d?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b2a135201d</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Fri, 14 Dec 2018 03:41:50 GMT</pubDate>
            <atom:updated>2018-12-17T12:05:16.836Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-GOhEPg3-sn4d6vSw7i7Ug.jpeg" /><figcaption>Rinkeby sealers agreed on the network state. Photo by <a href="https://unsplash.com/photos/BVaaNVErwpc?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">rawpixel</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Most popular cryptocurrencies use Proof-of-work algorithms to achieve consensus. While some of them might eventually switch to Proof-of-stake, PoW is a standard for now. But there are other options. One of them is Proof-of-authority. Here, we will have a look at the general idea of the protocol, as well as one of the implementation called Clique, with its properties and current applications. We will also cover two testnets that currently implement Clique: Rinkeby and Görli.</p><p>Proof-of-authority has one distinctive feature: only approved signers can seal the blocks. That’s it, a valid block doesn’t require hash mining, or staking coins; the only requirement is to be included in the list of approved signers. This list can be static or dynamic. In the first case, a list of sealers is defined in the genesis block and can’t be changed. In the second case, current signers have the ability to add new signers or remove existing ones in case they act maliciously.</p><p>Currently, PoA consensus actively used for the Ethereum testnets. The reason is that PoW testnets are usually insecure, as they lack hash power. Miners don’t receive anything for securing the test network, so adding hash power to the testnet is usually a volunteer activity. And though the attacker doesn’t earn money by 51%-ing the testnet, he can disrupt the network and damage user experience rather cheap. However, if the network uses Proof-of-authority, an attacker will have a hard time controlling the network.</p><p>Ropsten, the PoW testnet, went under several 51% attacks, which resulted in the network bloated with meaningless transactions. Eventually, the chain cleaned from the bloat <a href="https://github.com/ethereum/ropsten/blob/master/revival.md">forked away into Ropsten Revival</a>, but in the meantime, user experience was suffered. While Proof-of-work testnets are still necessary to test Ethash-related features and discover potential consensus issues, Proof-of-authority test networks serve as a reliable and convenient alternative for developers to test their dapps and don’t worry much about possible attacks and reorgs.</p><p>Clique is one such PoA algorithm. In Clique, all blocks are mined, or sealed, by approved signers. The process of sealing a block is pretty straightforward. Unlike in Ethash (Ethereum’s PoW algorithm), there is no mining, and sealers don’t spend time brute-forcing hashes, so the task is computationally light.</p><p>Besides the absence of mining, making a block in Clique is similar to the Ethash. Miner collects transactions, executes them, updates the network state, calculates a hash of the block, and signs the block using his private key. To limit the number of processed transactions, Clique allows creating one block per defined period of time. In Ethereum testnets, block time is set as 15 seconds to mimic the mainnet.</p><p>Generally speaking, miners can seal blocks in any order. However, Clique introduces a few rules that incentivize signing blocks in the right order. These rules also help to minimize the number of chain reorgs.</p><blockquote>It will help to define what exactly “signing blocks in order” means. In Clique, list of signers is lexicographically sorted. The current signer is selected as BLOCK_NUMBER % SIGNER_COUNT. An example of a signer list is [0xaaa...a, 0xbbb...b, 0xccc...c]. In the network with such list, signer with index 1 (<em>0xbbb...b</em>) should sign block 1, signer with index 2 (<em>0xccc...c</em>) should sign block 2, signer with index 0 (<em>0xaaa...a</em>) should sign block 3, and so on.</blockquote><p>First, the difficulty of a block depends on whether the block was signed in turn or out of turn. “In turn” blocks have difficulty 2, and “out of turn” blocks have difficulty 1. In the case of small forks, the chain with most of the signers sealing blocks “in turn” will accumulate the most difficulty and win.</p><p>Second, out of FLOOR(SIGNER_COUNT / 2) + 1 consecutive blocks each signer can sign only once. For example, if there are 5 signers, a signer can’t sign more than one block in a series of 3 blocks. This means that at least 51% of signers should participate in block sealing, otherwise the network will stall.</p><p>Now, as we learned before, the list of the sealers can be dynamic. For Clique, that’s the case. Current signers can vote in or vote out other signers by writing their wallet addresses to the block header during sealing. A proposal that receives a majority of votes comes into effect immediately.</p><p>Now, let’s talk about testnets. Where is Clique actually used? In short, there are currently 3 widely used testnets: Ropsten, Kovan, and Rinkeby. Ropsten uses the same consensus algorithm as the mainnet, Ethash. Kovan uses <a href="https://wiki.parity.io/Aura">Aura</a>, which is another Proof-of-authority algorithm. Finally, Rinkeby uses Clique.</p><p>There is also Görli, which is relatively new testnet but is rapidly growing in development activity and adoption. Görli uses Clique too. Actually, one of the reasons to make Görli was to make a fresh testnet where clients developers can easily test the implementation of Clique and therefore make the algorithm work across as many clients as possible.</p><p>This is just a short summary of what is PoA and how does Clique work. If you want more, you can check specs at the <a href="https://github.com/ethereum/EIPs/issues/225">corresponding EIP</a>, or go <a href="https://github.com/ethereum/go-ethereum/blob/master/consensus/clique/clique.go">straight to the sources</a> of Geth. There are also sources available for <a href="https://github.com/NethermindEth/nethermind/tree/master/src/Nethermind/Nethermind.Clique">Nethermind</a> and <a href="https://github.com/PegaSysEng/pantheon/tree/master/consensus/clique/src/main/java/tech/pegasys/pantheon/consensus/clique">Pantheon</a> clients. You can also learn more about <a href="https://github.com/goerli/testnet">Görli testnet</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2a135201d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create an Ethereum wallet address from a private key]]></title>
            <link>https://medium.com/free-code-camp/how-to-create-an-ethereum-wallet-address-from-a-private-key-ae72b0eee27b?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae72b0eee27b</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Tue, 31 Jul 2018 16:35:56 GMT</pubDate>
            <atom:updated>2018-07-31T16:35:56.079Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qWiAHdbuyJspr67HahgDYw.png" /></figure><p>In <a href="https://medium.freecodecamp.org/how-to-generate-your-very-own-bitcoin-private-key-7ad0f4936e6c">the first article</a> of this series, we generated a bitcoin private key: 60cf347dbc59d31c1358c8e5cf5e45b822ab85b79cb32a9f3d98184779a9efc2.</p><p>Here, we’ll use that key to get the public address and then the Ethereum wallet address of that private key.</p><p>Creating the Bitcoin wallet address from the private key is a bit complicated. Here, the process will be much simpler. We need to apply one hash function to get the public key and another one to get the address.</p><p>So let’s get started.</p><h3>Public key</h3><p>This part is almost identical to what we discussed in the <a href="https://medium.freecodecamp.org/how-to-create-a-bitcoin-wallet-address-from-a-private-key-eca3ddd9c05f">Bitcoin article</a>, so if you read that one, you can skip it (unless you need a refresher).</p><p>The first thing we need to go is to apply the ECDSA, or Elliptic Curve Digital Signature Algorithm, to our private key. An elliptic curve is a curve defined by the equation y² = x³ + ax + b with chosen a and b. There is a whole family of such curves that are widely known and used. Bitcoin uses the <strong>secp256k1</strong> curve. If you want to learn more about Elliptic Curve Cryptography, I’ll refer you to <a href="https://hackernoon.com/what-is-the-math-behind-elliptic-curve-cryptography-f61b25253da3">this article</a>.</p><p>Ethereum uses the same elliptic curve, <strong>secp256k1</strong>, so the process to get the public key is identical in both cryptocurrencies.</p><p>By applying the ECDSA to the private key, we get a 64-byte integer, which is two 32-byte integers that represent X and Y of the point on the elliptic curve, concatenated together.</p><p>For our example, we got 1e7bcc70c72770dbb72fea022e8a6d07f814d2ebe4de9ae3f7af75bf706902a7b73ff919898c836396a6b0c96812c3213b99372050853bd1678da0ead14487d7.</p><p>In Python, it would look like this:</p><pre>private_key_bytes = codecs.decode(private_key, ‘hex’)<br># Get ECDSA public key<br>key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1).verifying_key<br>key_bytes = key.to_string()<br>key_hex = codecs.encode(key_bytes, ‘hex’)</pre><p>Note: as you can see from the code above, I used a method from the ecdsa module and I decoded the private key using codecs. This is relevant more to the Python and less to the algorithm itself, but I will explain what are we doing here to remove possible confusion.</p><p>In Python, there are at least two classes that can keep the private and public keys: “str” and “bytes”. The first is a string and the second is a byte array. Cryptographic methods in Python work with a “bytes” class, taking it as input and returning it as the result.</p><p>Now, there’s a little catch: a string, say, 4f3c does not equal the byte array 4f3c. Rather, it equals the byte array with two elements, O&lt;. And that’s what the codecs.decode method does: it converts a string into a byte array. This will be the same for all cryptographic manipulations that we’ll do in this article.</p><h3>Wallet address</h3><p>Once we’ve gotten the public key, we can calculate the address. Now, unlike Bitcoin, Ethereum has the same addresses on both the main and all test networks. Users specify the network that they want to use later in the process when they make and sign a transaction.</p><p>To make an address from the public key, all we need to do is to apply Keccak-256 to the key and then take the last 20 bytes of the result. And that’s it. No other hash functions, no Base58 or any other conversion. The only thing you need is to add ‘0x’ at the start of the address.</p><p>Here’s the Python code:</p><pre>public_key_bytes = codecs.decode(public_key, ‘hex’)<br>keccak_hash = keccak.new(digest_bits=256)<br>keccak_hash.update(public_key_bytes)<br>keccak_digest = keccak_hash.hexdigest()<br># Take the last 20 bytes<br>wallet_len = 40<br>wallet = ‘0x’ + keccak_digest[-wallet_len:]</pre><h3>Checksum</h3><p>Now, as you may remember, Bitcoin creates the checksum by hashing the public key and taking the first 4 bytes of the result. This is true for all Bitcoin addresses, so you can’t get the valid address without adding the checksum bytes.</p><p>In Ethereum, that’s not how things work. Initially, there were no checksum mechanisms to validate the integrity of the key. However, in 2016, Vitalik Buterin <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md">introduced</a> a checksum mechanism, which has since been adopted by wallets and exchanges.</p><p>Adding a checksum to the Ethereum wallet address makes it case-sensitive.</p><p>First, you need to get the Keccak-256 hash of the address. Note that this address should be passed to the hash function without the 0x part.</p><p>Second, you iterate over the characters of the initial address. If the <em>i</em>th byte of the hash is greater than or equal to 8, you convert the <em>i</em>th address’s character to uppercase, otherwise you leave it lowercase.</p><p>Finally, you add 0x back at the start of the resulting string. The checksum address is the same as the initial one if you ignore the case. But the uppercase letters let anyone check that the address is indeed valid. You can find the algorithm of the checksum validation at the <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md">page linked here</a>.</p><p>As you’ll read in the proposal, for this checksum scheme,</p><blockquote>“on average there will be 15 check bits per address, and the net probability that a randomly generated address if mistyped will accidentally pass a check is 0.0247%.”</blockquote><p>And here’s the code to add checksum to the Ethereum address:</p><pre>checksum = ‘0x’<br># Remove ‘0x’ from the address<br>address = address[2:]<br>address_byte_array = address.encode(‘utf-8’)<br>keccak_hash = keccak.new(digest_bits=256)<br>keccak_hash.update(address_byte_array)<br>keccak_digest = keccak_hash.hexdigest()<br>for i in range(len(address)):<br>    address_char = address[i]<br>    keccak_char = keccak_digest[i]<br>    if int(keccak_char, 16) &gt;= 8:<br>        checksum += address_char.upper()<br>    else:<br>        checksum += str(address_char)</pre><h3>Conclusion</h3><p>As you can see, creating an address for Ethereum is much simpler than for Bitcoin. All we need to do is to apply the ECDSA to public key, then apply Keccak-256, and finally take the last 20 bytes of that hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Vhh9WVns4yFz4swpElcGg.png" /></figure><p>If you want to play with the code, I published it to the <a href="https://github.com/Destiner/blocksmith">GitHub repository</a>.</p><p>I am making a course on cryptocurrencies here on Medium. The <a href="https://medium.com/longcaller/blockchain-explained-2b26b28657ca">first part</a> is a detailed description of the blockchain.</p><p>I also post random thoughts about crypto on <a href="https://twitter.com/DestinerX">Twitter</a>, so you might want to check it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae72b0eee27b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-create-an-ethereum-wallet-address-from-a-private-key-ae72b0eee27b">How to create an Ethereum wallet address from a private key</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a Bitcoin wallet address from a private key]]></title>
            <link>https://medium.com/free-code-camp/how-to-create-a-bitcoin-wallet-address-from-a-private-key-eca3ddd9c05f?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/eca3ddd9c05f</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Mon, 16 Jul 2018 15:35:36 GMT</pubDate>
            <atom:updated>2018-07-16T15:35:36.863Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrGW1KubP_JKLR1CVg074g.png" /></figure><p>In <a href="https://medium.freecodecamp.org/how-to-generate-your-very-own-bitcoin-private-key-7ad0f4936e6c">the previous article</a>, we looked at different methods to generate a private key. Whatever method you choose, you’ll end up with 32 bytes of data. Here’s the one that we got at the end of that article:</p><p>60cf347dbc59d31c1358c8e5cf5e45b822ab85b79cb32a9f3d98184779a9efc2</p><p>We’ll use this private key throughout the article to derive both a public key and the address for the Bitcoin wallet.</p><p>What we want to do is to apply a series of conversions to the private key to get a public key and then a wallet address. Most of these conversions are called hash functions. These hash functions are one-way conversions that can’t be reversed. We won’t go to the mechanics of the functions themselves — there are plenty of great articles that cover that. Instead, we will look at how using these functions in the correct order can lead you to the Bitcoin wallet address that you can use.</p><h3>Elliptic Curve Cryptography</h3><p>The first thing we need to do is to apply the ECDSA or Elliptic Curve Digital Signature Algorithm to our private key. An elliptic curve is a curve defined by the equation y² = x³ + ax + b with a chosen a and b. There is a whole family of such curves that are widely known and used. Bitcoin uses the <strong>secp256k1</strong> curve. If you want to learn more about Elliptic Curve Cryptography, I’ll refer you to <a href="https://hackernoon.com/what-is-the-math-behind-elliptic-curve-cryptography-f61b25253da3">this article</a>.</p><p>By applying the ECDSA to the private key, we get a 64-byte integer. This consists of two 32-byte integers that represent the X and Y of the point on the elliptic curve, concatenated together.</p><p>For our example, we got: 1e7bcc70c72770dbb72fea022e8a6d07f814d2ebe4de9ae3f7af75bf706902a7b73ff919898c836396a6b0c96812c3213b99372050853bd1678da0ead14487d7.</p><p>In Python, it would look like this:</p><pre>private_key_bytes = codecs.decode(private_key, ‘hex’)<br># Get ECDSA public key<br>key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1).verifying_key<br>key_bytes = key.to_string()<br>key_hex = codecs.encode(key_bytes, ‘hex’)</pre><p>Note: as you can see from the code, before I used a method from the ecdsa module, I decoded the private key using codecs. This is relevant more to the Python and less to the algorithm itself, but I will explain what are we doing here to remove possible confusion.</p><p>In Python, there are at least two classes that can keep the private and public keys: “str” and “bytes”. The first is a string and the second is a byte array. Cryptographic methods in Python work with a “bytes” class, taking it as input and returning it as the result.</p><p>Now, there’s a little catch: a string, say, 4f3c does not equal the byte array 4f3c, it equals the byte array with two elements, O&lt;. And that’s what codecs.decode method does: it converts a string into a byte array. That will be the same for all cryptographic manipulations that we’ll do in this article.</p><h3>Public key</h3><p>Once we’re done with the ECDSA, all we need to do is to add the bytes 0x04 at the start of our public key. The result is a Bitcoin full public key, which is equal to: 041e7bcc70c72770dbb72fea022e8a6d07f814d2ebe4de9ae3f7af75bf706902a7b73ff919898c836396a6b0c96812c3213b99372050853bd1678da0ead14487d7 for us.</p><h3>Compressed public key</h3><p>But we can do better. As you might remember, the public key is some point (X, Y) on the curve. We know the curve, and for each X there are only two Ys that define the point which lies on that curve. So why keep Y? Instead, let’s keep X and the sign of Y. Later, we can derive Y from that if needed.</p><p>The specifics are as follows: we take X from the ECDSA public key. Now, we add the 0x02 if the last byte of Y is even, and the byte 0x03 if the last byte is odd.</p><p>In our case, the last byte is odd, so we add 0x03 to get the compressed public key: 031e7bcc70c72770dbb72fea022e8a6d07f814d2ebe4de9ae3f7af75bf706902a7. This key contains the same information, but it’s almost twice as short as the uncompressed key. Cool!</p><p>Previously, wallet software used long, full versions of public keys, but now most of it has switched to compressed keys.</p><h3>Encrypting the public key</h3><p>From now on, we need to make a wallet address. Whatever method of getting the public key you choose, it goes through the same procedure. Obviously, the addresses will differ. In this article, we will go with the compressed version.</p><p>What we need to do here is to apply SHA-256 to the public key, and then apply RIPEMD-160 to the result. The order is important.</p><p>SHA-256 and RIPEMD-160 are two hash functions, and again, we won’t go into the details of how they work. What matters is that now we have 160-bit integer, which will be used for further modifications. Let’s call that an encrypted public key. For our example, the encrypted public key is 453233600a96384bb8d73d400984117ac84d7e8b.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CN_L6JfMKTpvaSnHLjp5lQ.png" /></figure><p>Here’s how we encrypt the public key in Python:</p><pre>public_key_bytes = codecs.decode(public_key, ‘hex’)<br># Run SHA-256 for the public key<br>sha256_bpk = hashlib.sha256(public_key_bytes)<br>sha256_bpk_digest = sha256_bpk.digest()<br># Run RIPEMD-160 for the SHA-256<br>ripemd160_bpk = hashlib.new(‘ripemd160’)<br>ripemd160_bpk.update(sha256_bpk_digest)<br>ripemd160_bpk_digest = ripemd160_bpk.digest()<br>ripemd160_bpk_hex = codecs.encode(ripemd160_bpk_digest, ‘hex’)</pre><h3>Adding the network byte</h3><p>The Bitcoin has two networks, main and test. The main network is the network that all people use to transfer the coins. The test network was created — you guessed it — to test new features and software.</p><p>We want to generate an address to use it on the mainnet, so we need to add 0x00 bytes to the encrypted public key. The result is 00453233600a96384bb8d73d400984117ac84d7e8b. For the testnet, that would be 0x6f bytes.</p><h3>Checksum</h3><p>Now we need to calculate the checksum of our mainnet key. The idea of checksum is to make sure that the data (in our case, the key) wasn’t corrupted during transmission. The wallet software should look at the checksum and mark the address as invalid if the checksum mismatches.</p><p>To calculate the checksum of the key, we need to apply SHA-256 twice and then take first 4 bytes of the result. For our example, the double SHA-256 is 512f43c48517a75e58a7ec4c554ecd1a8f9603c891b46325006abf39c5c6b995 and therefore the checksum is 512f43c4 (note that 4 bytes is 8 hex digits).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0ArwEiHwayazRBpEbQQOA.png" /></figure><p>The code to calculate an address checksum is the following:</p><pre># Double SHA256 to get checksum<br>sha256_nbpk = hashlib.sha256(network_bitcoin_public_key_bytes)<br>sha256_nbpk_digest = sha256_nbpk.digest()<br>sha256_2_nbpk = hashlib.sha256(sha256_nbpk_digest)<br>sha256_2_nbpk_digest = sha256_2_nbpk.digest()<br>sha256_2_hex = codecs.encode(sha256_2_nbpk_digest, ‘hex’)<br>checksum = sha256_2_hex[:8]</pre><h3>Getting the address</h3><p>Finally, to make an address, we just concatenate the mainnet key and the checksum. That makes it 00453233600a96384bb8d73d400984117ac84d7e8b512f43c4 for our example.</p><p>That’s it! That’s the wallet address for the private key at the start of the article.</p><p>But you may notice that something is off. You’ve probably seen a handful of Bitcoin addresses and they didn’t look like that. Well, the reason is that they are encoded with <a href="https://en.wikipedia.org/wiki/Base58">Base58</a>. It’s a little bit odd.</p><p>Here’s the algorithm to convert a hex address to the Base58 address:</p><pre>def base58(address_hex):<br>    alphabet = ‘123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz’<br>    b58_string = ‘’<br>    # Get the number of leading zeros<br>    leading_zeros = len(address_hex) — len(address_hex.lstrip(‘0’))<br>    # Convert hex to decimal<br>    address_int = int(address_hex, 16)<br>    # Append digits to the start of string<br>    while address_int &gt; 0:<br>        digit = address_int % 58<br>        digit_char = alphabet[digit]<br>        b58_string = digit_char + b58_string<br>        address_int //= 58<br>    # Add ‘1’ for each 2 leading zeros<br>    ones = leading_zeros // 2<br>    for one in range(ones):<br>        b58_string = ‘1’ + b58_string<br>    return b58_string</pre><p>What we get is 17JsmEygbbEUEpvt4PFtYaTeSqfb9ki1F1, a compressed Bitcoin wallet address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiE2EOmOY2Xz-z7dYDm_aA.png" /></figure><h3>Conclusion</h3><p>The wallet key generation process can be split into four steps:</p><ul><li>creating a public key with ECDSA</li><li>encrypting the key with SHA-256 and RIPEMD-160</li><li>calculating the checksum with double SHA-256</li><li>encoding the key with Base58.</li></ul><p>Depending on the form of public key (full or compressed), we get different addresses, but both are perfectly valid.</p><p>Here’s the full algorithm for the uncompressed public key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PobN1NUZaWXJKdbNSKq60g.png" /></figure><p>If you want to play with the code, I published it to the <a href="https://github.com/Destiner/blocksmith">Github repository</a>.</p><p>I am making a course on cryptocurrencies here on Medium. The <a href="https://medium.com/longcaller/blockchain-explained-2b26b28657ca">first part</a> is a detailed description of the blockchain.</p><p>I also post random thoughts about crypto on <a href="https://twitter.com/DestinerX">Twitter</a>, so you might want to check it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eca3ddd9c05f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-create-a-bitcoin-wallet-address-from-a-private-key-eca3ddd9c05f">How to create a Bitcoin wallet address from a private key</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate your very own Bitcoin private key]]></title>
            <link>https://medium.com/free-code-camp/how-to-generate-your-very-own-bitcoin-private-key-7ad0f4936e6c?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad0f4936e6c</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 00:40:27 GMT</pubDate>
            <atom:updated>2018-06-29T00:40:27.290Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pWGbFF9kCmlGSra6Kmh-w.png" /></figure><p>In cryptocurrencies, a private key allows a user to gain access to their wallet. The person who holds the private key fully controls the coins in that wallet. For this reason, you should keep it secret. And if you really want to generate the key yourself, it makes sense to generate it in a secure way.</p><p>Here, I will provide an introduction to private keys and show you how you can generate your own key using various cryptographic functions. I will provide a description of the algorithm and the code in Python.</p><h3>Do I need to generate a private key?</h3><p>Most of the time you don’t. For example, if you use a web wallet like Coinbase or Blockchain.info, they create and manage the private key for you. It’s the same for exchanges.</p><p>Mobile and desktop wallets usually also generate a private key for you, although they might have the option to create a wallet from your own private key.</p><p>So why generate it anyway? Here are the reasons that I have:</p><ul><li>You want to make sure that no one knows the key</li><li>You just want to learn more about cryptography and random number generation (RNG)</li></ul><h3>What exactly is a private key?</h3><p>Formally, a private key for Bitcoin (and many other cryptocurrencies) is a series of 32 bytes. Now, there are many ways to record these bytes. It can be a string of 256 ones and zeros (32 * 8 = 256) or 100 dice rolls. It can be a binary string, Base64 string, a <a href="https://en.bitcoin.it/wiki/Wallet_import_format">WIF key</a>, <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">mnemonic phrase</a>, or finally, a hex string. For our purposes, we will use a 64 character long hex string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WnKDAo0wZzIxSiZK56eOYA.png" /><figcaption>The same private key, written in different formats.</figcaption></figure><p>Why exactly 32 bytes? Great question! You see, to create a public key from a private one, Bitcoin uses the <strong>ECDSA</strong>, or Elliptic Curve Digital Signature Algorithm. More specifically, it uses one particular curve called <strong>secp256k1</strong>.</p><p>Now, this curve has an order of 256 bits, takes 256 bits as input, and outputs 256-bit integers. And 256 bits is exactly 32 bytes. So, to put it another way, we need 32 bytes of data to feed to this curve algorithm.</p><p>There is an additional requirement for the private key. Because we use ECDSA, the key should be positive and should be less than the order of the curve. The order of secp256k1 is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141, which is pretty big: almost any 32-byte number will be smaller than it.</p><h3>Naive method</h3><p>So, how do we generate a 32-byte integer? The first thing that comes to mind is to just use an RNG library in your language of choice. Python even provides a cute way of generating just enough bits:</p><pre>import random<br>bits = random.getrandbits(256)<br># 30848827712021293731208415302456569301499384654877289245795786476741155372082<br>bits_hex = hex(bits)<br># 0x4433d156e8c53bf5b50af07aa95a29436f29a94e0ccc5d58df8e57bdc8583c32<br>private_key = bits_hex[2:]<br># 4433d156e8c53bf5b50af07aa95a29436f29a94e0ccc5d58df8e57bdc8583c32</pre><p>Looks good, but actually, it’s not. You see, normal RNG libraries are not intended for cryptography, as they are not very secure. They generate numbers based on a seed, and by default, the seed is the current time. That way, if you know approximately when I generated the bits above, all you need to do is brute-force a few variants.</p><p>When you generate a private key, you want to be extremely secure. Remember, if anyone learns the private key, they can easily steal all the coins from the corresponding wallet, and you have no chance of ever getting them back.</p><p>So let’s try to do it more securely.</p><h3>Cryptographically strong RNG</h3><p>Along with a standard RNG method, programming languages usually provide a RNG specifically designed for cryptographic operations. This method is usually much more secure, because it draws entropy straight from the operating system. The result of such RNG is much harder to reproduce. You can’t do it by knowing the time of generation or having the seed, because there is no seed. Well, at least the user doesn’t enter a seed — rather, it’s created by the program.</p><p>In Python, cryptographically strong RNG is implemented in the secrets module. Let’s modify the code above to make the private key generation secure!</p><pre>import secrets<br>bits = secrets.randbits(256)<br># 46518555179467323509970270980993648640987722172281263586388328188640792550961<br>bits_hex = hex(bits)<br># 0x66d891b5ed7f51e5044be6a7ebe4e2eae32b960f5aa0883f7cc0ce4fd6921e31<br>private_key = bits_hex[2:]<br># 66d891b5ed7f51e5044be6a7ebe4e2eae32b960f5aa0883f7cc0ce4fd6921e31</pre><p>That is amazing. I bet you wouldn’t be able to reproduce this, even with access to my PC. But can we go deeper?</p><h3>Specialized sites</h3><p>There are sites that generate random numbers for you. We will consider just two here. One is <a href="https://random.org/">random.org</a>, a well-known general purpose random number generator. Another one is <a href="https://bitaddress.org/">bitaddress.org</a>, which is designed specifically for Bitcoin private key generation.</p><p>Can <a href="https://random.org/">random.org</a> help us generate a key? Definitely, as they have <a href="https://www.random.org/bytes">service</a> for generating random bytes. But two problems arise here. <a href="https://random.org/">Random.org</a> claims to be a truly random generator, but can you trust it? Can you be sure that it is indeed random? Can you be sure that the owner doesn’t record all generation results, especially ones that look like private keys? The answer is up to you. Oh, and you can’t run it locally, which is an additional problem. This method is not 100% secure.</p><p>Now, <a href="https://bitaddress.org/">bitaddress.org</a> is a whole different story. It’s open source, so you can see what’s under its hood. It’s client-side, so you can download it and run it locally, even without an Internet connection.</p><p>So how does it work? It uses you — yes, you — as a source of entropy. It asks you to move your mouse or press random keys. You do it long enough to make it infeasible to reproduce the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*P6rA2JWIah8D0Tj5UzOpXw.gif" /><figcaption>The process of generation an entropy by randomly moving the mouse. The large chunk of symbols shows the pool.</figcaption></figure><p>Are you interested to see how <a href="https://bitaddress.org/">bitaddress.org</a> works? For educational purposes, we will look at its code and try to reproduce it in Python.</p><blockquote><em>Quick note: bitaddress.org gives you the private key in a compressed WIF format, which is close to the </em><a href="https://en.bitcoin.it/wiki/Wallet_import_format"><em>WIF format</em></a><em> that we discussed before. For our purposes, we will make the algorithm return a hex string so that we can use it later for a public key generation.</em></blockquote><h3>Bitaddress: the specifics</h3><p>Bitaddress creates the entropy in two forms: by mouse movement and by key pressure. We’ll talk about both, but we’ll focus on the key presses, as it’s hard to implement mouse tracking in the Python lib. We’ll expect the end user to type buttons until we have enough entropy, and then we’ll generate a key.</p><p>Bitaddress does three things. It initializes byte array, trying to get as much entropy as possible from your computer, it fills the array with the user input, and then it generates a private key.</p><p>Bitaddress uses the 256-byte array to store entropy. This array is rewritten in cycles, so when the array is filled for the first time, the pointer goes to zero, and the process of filling starts again.</p><p>The program initiates an array with 256 bytes from <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto">window.crypto</a>. Then, it writes a timestamp to get an additional 4 bytes of entropy. Finally, it gets such data as the size of the screen, your time zone, information about browser plugins, your locale, and more. That gives it another 6 bytes.</p><p>After the initialization, the program continually waits for user input to rewrite initial bytes. When the user moves the cursor, the program writes the position of the cursor. When the user presses buttons, the program writes the char code of the button pressed.</p><p>Finally, bitaddress uses accumulated entropy to generate a private key. It needs to generate 32 bytes. For this task, bitaddress uses an RNG algorithm called ARC4. The program initializes ARC4 with the current time and collected entropy, then gets bytes one by one 32 times.</p><p>This is all an oversimplification of how the program works, but I hope that you get the idea. You can check out the algorithm in full detail on <a href="https://github.com/pointbiz/bitaddress.org">Github</a>.</p><h3>Doing it yourself</h3><p>For our purposes, we’ll build a simpler version of bitaddress. First, we won’t collect data about the user’s machine and location. Second, we will input entropy only via text, as it’s quite challenging to continually receive mouse position with a Python script (check <a href="https://github.com/asweigart/pyautogui">PyAutoGUI</a> if you want to do that).</p><p>That brings us to the formal specification of our generator library. First, it will initialize a byte array with cryptographic RNG, then it will fill the timestamp, and finally it will fill the user-created string. After the seed pool is filled, the library will let the developer create a key. Actually, they will be able to create as many private keys as they want, all secured by the collected entropy.</p><h4>Initializing the pool</h4><p>Here we put some bytes from cryptographic RNG and a timestamp. __seed_int and __seed_byte are two helper methods that insert the entropy into our pool array. Notice that we use secrets.</p><pre>def __init_pool(self):<br>    for i in range(self.POOL_SIZE):<br>        random_byte = secrets.randbits(8)<br>        self.__seed_byte(random_byte)<br>    time_int = int(time.time())<br>    self.__seed_int(time_int)</pre><pre>def __seed_int(self, n):<br>    self.__seed_byte(n)<br>    self.__seed_byte(n &gt;&gt; 8)<br>    self.__seed_byte(n &gt;&gt; 16)<br>    self.__seed_byte(n &gt;&gt; 24)</pre><pre>def __seed_byte(self, n):<br>    self.pool[self.pool_pointer] ^= n &amp; 255<br>    self.pool_pointer += 1<br>    if self.pool_pointer &gt;= self.POOL_SIZE:<br>        self.pool_pointer = 0</pre><h4>Seeding with input</h4><p>Here we first put a timestamp and then the input string, character by character.</p><pre>def seed_input(self, str_input):<br>    time_int = int(time.time())<br>    self.__seed_int(time_int)<br>    for char in str_input:<br>        char_code = ord(char)<br>        self.__seed_byte(char_code)</pre><h4>Generating the private key</h4><p>This part might look hard, but it’s actually very simple.</p><p>First, we need to generate 32-byte number using our pool. Unfortunately, we can’t just create our own random object and use it only for the key generation. Instead, there is a shared object that is used by any code that is running in one script.</p><p>What does that mean for us? It means that at each moment, anywhere in the code, one simple random.seed(0) can destroy all our collected entropy. We don’t want that. Thankfully, Python provides getstate and setstate methods. So, to save our entropy each time we generate a key, we remember the state we stopped at and set it next time we want to make a key.</p><p>Second, we just make sure that our key is in range (1, CURVE_ORDER). This is a requirement for all ECDSA private keys. The CURVE_ORDER is the order of the secp256k1 curve, which is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141.</p><p>Finally, for convenience, we convert to hex, and strip the ‘0x’ part.</p><pre>def generate_key(self):<br>    big_int = self.__generate_big_int()<br>    big_int = big_int % (self.CURVE_ORDER — 1) # key &lt; curve order<br>    big_int = big_int + 1 # key &gt; 0<br>    key = hex(big_int)[2:]<br>    return key</pre><pre>def __generate_big_int(self):<br>    if self.prng_state is None:<br>    seed = int.from_bytes(self.pool, byteorder=’big’, signed=False)<br>    random.seed(seed)<br>    self.prng_state = random.getstate()<br>    random.setstate(self.prng_state)<br>    big_int = random.getrandbits(self.KEY_BYTES * 8)<br>    self.prng_state = random.getstate()<br>    return big_int</pre><h4>In action</h4><p>Let’s try to use the library. Actually, it’s really simple: you can generate a private key in three lines of code!</p><pre>kg = KeyGenerator()<br>kg.seed_input(‘Truly random string. I rolled a dice and got 4.’)<br>kg.generate_key()<br># 60cf347dbc59d31c1358c8e5cf5e45b822ab85b79cb32a9f3d98184779a9efc2</pre><p>You can see it yourself. The key is random and totally valid. Moreover, each time you run this code, you get different results.</p><h3>Conclusion</h3><p>As you can see, there are a lot of ways to generate private keys. They differ in simplicity and security.</p><p>Generating a private key is only a first step. The next step is extracting a public key and a wallet address that you can use to receive payments. The process of generating a wallet differs for Bitcoin and Ethereum, and I plan to write two more articles on that topic.</p><p>If you want to play with the code, I published it to this <a href="https://github.com/Destiner/blocksmith">Github repository</a>.</p><p><em>I am making a course on cryptocurrencies here on Medium. The </em><a href="https://medium.com/longcaller/blockchain-explained-2b26b28657ca"><em>first part</em></a><em> is a detailed description of the blockchain.</em></p><p><em>I also post random thoughts about crypto on </em><a href="https://twitter.com/DestinerX"><em>Twitter</em></a><em>, so you might want to check it out.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad0f4936e6c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-generate-your-very-own-bitcoin-private-key-7ad0f4936e6c">How to generate your very own Bitcoin private key</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Explained]]></title>
            <link>https://medium.com/longcaller/blockchain-explained-2b26b28657ca?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b26b28657ca</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Sat, 02 Jun 2018 14:54:36 GMT</pubDate>
            <atom:updated>2018-06-02T14:54:36.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCy4YOZIfQcC52HnQb2IrA.png" /></figure><p>What is blockchain anyway? In this article, I will try to provide an in-depth yet simple to understand explanation. I will tell you about what is a blockchain, what features it has, which groups of users exist in blockchain network, and how they interact with each other.</p><p><em>Note: this article mostly covers public blockchains, and of that public blockchains, it’s mostly about their use for cryptocurrencies. There are other uses of public blockchains, and there are also private blockchains. Private (or permissioned) blockchains have a similar structure, but different functions and mechanics.</em></p><h3>Overview</h3><p>The blockchain is just a bunch of blocks. Each block contains pieces of information. In cryptocurrencies, the information is usually a set of transactions. Each block is connected to the previous one.</p><p>To date, the main usage of blockchain is cryptocurrencies. Cryptocurrency is an electronic cash system that runs without a central authority. Cryptocurrencies got adoption because they solved a problem of double-spending — a situation when a dishonest user of a decentralized cash system spends same coins twice. In Bitcoin, Ethereum, and other cryptocurrencies spending the same coins twice is almost impossible.</p><p>The blockchain is a method of organizing and storing data. There are other methods, of course, though blockchain has several unique features.</p><h3>Features</h3><p>Why use blockchain? Why not use traditional storage methods, like SQL database or key-value storage? Blockchain provides 2 features that make it a great use for cryptocurrencies: it’s distributed and trustless.</p><p>Even if a company uses data replication, it is usually 2–5 copies. In blockchain, the number of copies can be hundreds or thousands. In that way, the blockchain is <strong>distributed</strong>. The number of copies of Bitcoin ledger is equal to the number of full nodes. To wipe the information about transactions from existence, you need to delete it from each full node around the globe. To stop the blockchain, you can’t just hack the single computer or even a whole country. You need to break computers from different locations, running different operating systems and taking different security measures. Stopping the blockchain by hacking each full node is practically impossible.</p><p>In PayPal, you believe that all transactions will complete and you’ll able to withdraw the money from your balance at any moment. In blockchain, you don’t need to trust any corporation. You don’t need to trust any particular user either. Instead, you believe that most of the users will behave honestly. In that sense, the blockchain is a <strong>trustless</strong> system. One of the features of trustless systems is fair rules for everyone. For example, PayPal is a monopoly in digital money, so it can increase the commission, lock your funds, and delay withdrawals. Basically, it can do everything with your money. In blockchain, no one has the power to make their own rules. Instead, it is driven by the majority and the free market.</p><h3>Drawbacks</h3><p>The blockchain is not a silver bullet, and it has its own drawbacks. Most of them are partially fixable and negligible, though some of them might become a problem.</p><p>Note that this is just an overview of possible problems; the list is not exhaustive.</p><h3>Sybil Attack</h3><p>The first problem is a possibility of Sybil Attack. It is a situation where a single person controls few nodes and persuades another user that all these nodes belong to different users. Basically, when succeeded, this attack allows a user to block another user from the network completely. This can result in transaction censoring when the attacker can decide which transactions to show you and which not. An attacker can also block your transactions from the network by not broadcasting them to other users. It can lead to double-spending and can block you from the rest of the network. To protect from Sybil Attack, nodes can limit the outbound connections to one per subnet. Another way to mitigate attack is to look for nodes with suspiciously-low hashrate.</p><h3>Denial-of-Service Attack</h3><p>Another possible problem is a Denial-of-Service (DoS) attack. An attacker can overload a node by sending a lot of data to it. For example, it can send a really big block or transactions with scripts that take too long to execute. Bitcoin and other cryptocurrencies have some protection from DoS attacks. For example, many cryptocurrencies have a maximum possible block size.</p><h3>Scalability</h3><p>Public blockchain systems are hard to scale. Hard means neither easy nor impossible. It is not impossible, because there aren’t any technological barriers to increase the throughput of the network. It is not easy, because just increasing it would make the system more centralized. Increasing the capacity of the blockchain means increasing hardware requirements of running a full node, and that means fewer people want and be able to maintain nodes.</p><p>It is a question of whether a blockchain should be hugely scalable in the first place. First, blockchain is not a silver bullet — no need to use it for everything, even if it’s related to money and finance. Second, blockchain can be scaled by off-chain solutions. For example, Bitcoin throughput can be increased via Lightning Network.</p><h3>Block content</h3><p>Each block is made of two parts: header and data.</p><p>Block header is a metadata. Usually, it contains such information as block number, timestamp (the record of when the block was created), block hash, and nonce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VaCYpDur52jWAx0k.png" /></figure><p>Block data is a payload. It is the useful information that we need to store. The data usually contains multiple pieces of information that share the same structure. In Bitcoin, each block contains about a hundred of such pieces. Each piece is a transaction. To simplify, each transaction is sender address, recipient address, amount of transaction, and fee. In Ethereum, each transaction also contains “input data” field, which is used to pass data to smart contracts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Anriz6WeGchql_P.png" /></figure><h3>Genesis block</h3><p>Genesis block is the block number zero, the first block that is ever created in the blockchain. Genesis block is the same block as others, except it doesn’t have a link to the previous block.</p><p>Genesis block in Bitcoin: <a href="https://blockchain.info/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f">Bitcoin Block #0</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sywV9_ZbPahoPOMj.png" /></figure><h3>Block generation</h3><p>The only way to add new information to the blockchain is to add a block to the end of it.</p><p>The amount of added information is usually limited by software, otherwise, it may become bloated, and impossible for most of the users to keep the whole history of the blockchain. The general idea is to add new blocks in equal periods of time. Qualified users create blocks and send them to other network participants. If the block is valid, other users accept it. If it’s invalid, they ignore it and may punish block creator. The valid block propagates through the network in a few seconds.</p><h3>Proof-of-Work</h3><p>In proof-of-work (PoW) systems, adding new block is usually called “<strong>mining</strong>”. Each miner independently tries to find a valid hash with the desired difficulty. This difficulty is automatically defined by software to control the number of new blocks. The first miner who finds the correct hash becomes the creator of a new block.</p><p>As more and more miners join the network, the total hash rate — the combined computing power of all miners — increases. If there would be no constraints, miners would find hashes, and therefore blocks, more and more often. But most of the coins seek constant rate of finding new blocks, so they change a difficulty of mining based on the hash rate.</p><p>The difficulty tells users how many hashes miners should find to get a correct one. The higher the difficulty, the more hashes is required. The difficulty increases when the hash rate increases. In that way, mining difficulty counterbalances ever-increasing computing power of miners. The difficulty of the network is rebalanced based on how often new blocks are mined in past. In can readjust after each block or after several blocks. In Bitcoin, for example, the difficulty readjusts every 2016 blocks, which takes about 2 weeks.</p><h3>Proof-of-Stake</h3><p>In proof-of-stake (PoS), block producers are selected based on how many coins they have. This selection can be made randomly or by choosing those who get the most votes. The more coins you have, the higher the probability that you’ll be selected as the next producer or the bigger voting power you have. Selected producers then make blocks in specified time.</p><p>To stop nodes from voting on wrong blocks, a punishment can be introduced. One way is to punish those nodes who vote on multiple blocks in the same round. Another way is to punish those nodes who voted for the unpopular choice, assuming that block that got few votes is incorrect.</p><p>The process of staking can be delegated to other nodes. For example, if a user has a large number of coins, but he doesn’t want to or can’t vote regularly, he can delegate staking to another user. That user will have the voting power combined with the coins of the other user. After earning a profit, the delegate can then share part of his earnings. The whole process of delegation and sharing profits can be done automatically.</p><h3>Hashing</h3><p>The hash is like a footprint of a digital file. Different files produce different hashes, and equal files produce equal hashes. You can easily find a hash of each file, but it’s very hard to find the original file by its hash. Moreover, slightly different files produce very different hashes, so you can’t tell how different are two files based on their hashes.</p><p>In blockchain, each block contains the hash of the previous block. That way, if some block will be changed even slightly, its hash will also change, and the hash of all subsequent blocks will change too.</p><p>The hash of each transaction is based on the previous hash and the block data. It can also contain a timestamp. If blocks are created by mining, network difficulty and nonce are also included in the hash.</p><h3>Immutability</h3><p>Immutability means that something can’t be changed. When people say that blockchain is immutable, they mean that changing old blocks is impractical. If you change a transaction, the hash of this transaction will also change, which in turn will change the hash of the Merkle root, and that will change block’s hash. As each block keeps the hash of the previous block, all blocks that come after changed block will also become invalid.</p><p>Imagine an attacker wants to change a transaction that was made 1 hour ago. The attacker will need to mine all blocks from the one that was changed to the latest one. Moreover, he will also need to mine all future blocks that will be created while he mines previous blocks.</p><p>It is indeed possible to change even the earliest blocks, but it would require controlling more than a half of total mining power, hence the meaning of 51% attack. In general, the older the block, the less probable that an attacker will successfully change it. Merchants often wait for 6 blocks to ensure that they will get the money, hence the 6 confirmations rule.</p><h3>Nodes</h3><p>Nodes are computers that read and write to the blockchain. Different types of nodes have different roles and abilities.</p><h3>Mining node</h3><p>Mining nodes are nodes that produce blocks. They usually have huge computing resources. Miners usually don’t validate the blocks, as they don’t store the blockchain. To make new blocks, all they need is a set of recent transactions and a hash of the last block.</p><h3>Full node</h3><p>Full nodes are the nodes that store the entire copy of the blockchain. They validate the blocks that they receive, and propagate validated blocks to the network. They can also send their own transactions to the pool.</p><h3>Light node</h3><p>Light nodes don’t store the whole blockchain. They usually store block headers and a very small set of transactions. Light nodes can’t validate blocks and need to trust full nodes. Light nodes, however, can connect to other nodes, receive new blocks, and send the transactions.</p><h3>Web “node”</h3><p>Web nodes are not nodes at all. They are wallets that connect to the centralized servers. They don’t store any parts of the blockchain. Web wallets can’t connect to other nodes, receive blocks, or send the transactions. They can only ask a server to do that and expect that the server will provide correct information. They trust entirely to the server that they are connected to. Mobile wallets that don’t store blockchain data also belong there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zMI3jv9UgXcf_xlg.png" /></figure><h3>Network</h3><p>In decentralized systems, nodes come and go. There isn’t any guarantee that some particular node will be online today or tomorrow. That fact heavily affects the methods of connecting to and interacting with nodes.</p><h3>Peer discovery</h3><p>Peer discovery is a process of getting to know other network participants. When a user launches a node for the first time, it doesn’t have a track of peers to connect. To interact with the network, it should find peers and keep them in memory.</p><p>There are several methods of discovering other peers, including hardcoded addresses, user input, DNS lookup, and others.</p><p>The most primitive way is to connect to the addresses that are hardcoded in the wallet program. These addresses represent nodes that were initially set up by developers to grow the network in the first few days or weeks. While this is a simple method, it is usually not very spread in mature networks. For example, <strong>hardcoded addresses</strong> in Bitcoin is used only as a last resort, when other methods don’t work.</p><p>Users can also <strong>manually</strong> provide the list of nodes they got elsewhere. A user can either write them into a text file, provide as command-line arguments, or enter them via the graphic user interface.</p><p>Another method to discover peers is a <strong>DNS lookup</strong>. There are DNS servers that keep lists of nodes. These lists are updated by maintainers of these servers. Usually, there are several DNS servers so if one of the servers go down others will still be serving.</p><p>Once a node found at least one peer, he can connect it. If the connection is successful, they can <strong>exchange</strong> information about peers that they collected.</p><p>When discovered, node addresses are stored in a database to get them on the next computer launch. Nodes with newer client software version are preferred. Addresses of old, inactive nodes are removed.</p><h3>Blockchain download</h3><p>Once a node is connected to other peers, it can start to download a blockchain block by block.</p><p>The first way to do that is to simply let the node to download the blocks from other peers. It can be slow because it depends not only on your Internet connection speed but also on how broad the bandwidth of the peers is. But it is a decentralized method, meaning that it doesn’t depend on a single site or server.</p><p>Another way to download blockchain data is to download it from some external source on the Internet. It can be some random website, torrent file, or an archive sent to you by your friend. That might be faster than downloading it via p2p-connection, but it is also centralized and requires to trust the source that you download it from. Not only that, many links that once led to the blockchain archive might be dead by now.</p><p>Whatever method the blockchain is downloaded, it should be validated, and that might take even longer time. The computer should validate each block from the genesis one. The validation process includes checking proof-of-work, ensuring that all transactions in a block are correct, checking that Merkle Tree root calculated correctly, etc. While the speed of downloading depends on bandwidth, the validation relies on the CPU power.</p><p>Sometimes, it is possible to skip the process of the validation of the whole blockchain and just check those blocks that contain wallet transaction, i. e. transactions sent to or from the selected wallet. The availability of such light validation depends on the wallet software that you use.</p><h3>Sending a transaction</h3><p>When it comes to spreading new transactions and blocks, cryptocurrencies usually use something called <strong>Gossip protocol</strong>. It’s like many people spreading the gossip until everyone knows it.</p><p>It starts with a node making a transaction to send money. After the transaction is signed, the node sends it to the neighbor nodes.</p><p>When these nodes receive the transaction, they will check it. If the transaction is properly structured (has the correct format, has a signature, etc) and is not a double spend, they will, in turn, send it to their peers.</p><p>Of course, a node might already have the transaction when its peer is trying to send it. Because of that, the nodes first send the hash of the transaction. If the receiving node has the transaction with that hash, it will not download it again. If the receiving node doesn’t have the transaction, it will download it and send it further.</p><p>Eventually, all connected nodes, including miners, will receive the transaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/0*H-60JVngD4_7wnvJ.gif" /></figure><h3>Block propagation</h3><p>Miners and mining pools that actively make blocks collect all incoming transactions. It is economically viable for them to include as many transactions as possible in the next block because they will receive all transaction fees.</p><p>After a miner or a mining pool found correct hash, he will send the block to his peers. After that, the process is the same as sending a transaction. Nodes that received the new block send it to their peers, and after some time, everyone has the block.</p><p>In case of PoS systems, the process is almost the same. When it is time for a block producer to make a block, he collects all transactions, puts them into his block, and sends the block to the peers.</p><h3>Achieving consensus</h3><p>To work properly, a decentralized system like a cryptocurrency should constantly try to achieve a consensus. This basically means that each node should have the same set of blocks and transactions, which are stored in the same order.</p><p>Most of the time, the consensus will be achieved without any problems. The correct transactions and blocks will spread, and incorrect ones will die off.</p><p>However, it is possible that at some stage, two blocks will point to the same parent block. In other words, the chain will be forked in two chains. <strong>Forks</strong> can happen both in PoW and PoS systems. In proof-of-work chains, two miners can find a hash at the same time, and both will refer to the same block, the one that was mined before. In proof-of-stake, a block producer can pick an older, not the last block as its parent.</p><p>To resolve a fork, the whole network should agree on which fork will become the main one and which will die. The rule of thumb is “the longest chain wins”. In PoS chain, that simply means that eventually, one fork will be longer than other, by at least one block, and all honest nodes and block producers will work on that fork, and drop the other one. In PoW chain, the “longest” usually means “more proof-of-work done”, so the fork that wins is not the one that has the biggest block number, but the one that more miners work on.</p><h3>Dealing with attacks</h3><p>But how to achieve consensus when there are fraudulent nodes try to overwrite the history or censor the network? There are three possible scenarios.</p><p>First, an attacker doesn’t have a majority. The majority is either in mining rig (PoW) or coins (PoS). In that case, his possibilities are quite limited. He can try to conduct a 51% attack but has a high chance of failure. He is also risking wasting money on electricity, mining computers, or getting a stake by buying coins.</p><p>Second, an attacker controls a majority. In that situation, he can pretty much control the network. However, even if some authority will control the network, it will likely to lose money. The beauty of cryptocurrencies is that they were built with game theory principles in mind. In cryptocurrencies, having power always means having something at stake. It can be GPUs, ASICs, staked coins, or something else. The attack will likely harm many network participants, and it will affect the price. Mining rigs and staked coins owned by the attacker will lose in value if will be valuable at all.</p><p>It may be dangerous for someone to control the majority of power without even trying to make an attack. If the fact will become known, it will spread quickly and likely affect the price.</p><p>Third, a majority of nodes behaves badly. In fact, the majority doesn’t even need to be coordinated by some person. Simply by behaving wrong, they would be unlikely to make a double spend, but they can stop the network. This is the very unlikely event, as the majority usually obey laws, though it is possible in theory. As in the second scenario, the misbehaving majority will likely be punished by market forces.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b26b28657ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/longcaller/blockchain-explained-2b26b28657ca">Blockchain Explained</a> was originally published in <a href="https://medium.com/longcaller">Longcaller</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome to Longcaller]]></title>
            <link>https://medium.com/longcaller/welcome-to-longcaller-a6760c71dbd6?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6760c71dbd6</guid>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 15:25:17 GMT</pubDate>
            <atom:updated>2018-06-02T14:55:15.247Z</atom:updated>
            <content:encoded><![CDATA[<p>If you got here, I suppose that you’re interested in cryptocurrencies. I also hope that you value in-depth research, and dislike news and price discussions. Because that’s the people that would like Longcaller.</p><p>The idea behind Longcaller is to provide educational and insightful pieces on cryptocurrencies and blockchain. It’s started as a <a href="https://longcaller.com/">standalone website</a> and now it’s expanding to Medium.</p><p>For almost half of the year, I am actively researching different cryptocurrencies and the tech behind it. In 5 months, I’ve managed to write 24 reviews. Each review is a summary of all the technical information about one cryptocurrency. I drop all the boring stuff from the white papers and try to depict what’s interesting about the particular coin.</p><p>These coins that I write about are not some random projects that started ICO 2 months ago. I pick fully working coins with an established history. Some of the examples are Bitcoin, Ethereum, Monero, Sia, and IOTA.</p><p>Besides that, I am working on producing a text course on cryptocurrencies. That course will be helpful for those who want to quickly grasp the main concepts without spending weeks or months gathering bits of information. The <a href="https://medium.com/longcaller/blockchain-explained-2b26b28657ca">first article</a> is about blockchain. I plan to make about 10 articles, releasing one per month. The topics will include smart contracts, encryption, mining, privacy, and others. The text course will be both available on the <a href="https://longcaller.com/">website</a> and here.</p><p>Moreover, I plan to make some exclusive content for Medium. I plan to make research posts, covering one narrow topic per post. These posts will be loaded with data, graphs, and probably a bit math.</p><h4>Q&amp;A</h4><p><strong>Why not publish everything on Medium?</strong></p><p>Medium can’t provide everything I need. The Medium is best for posts that are independent of each other. It doesn’t provide rich navigational tools and interactivity. For example, it’s very hard here to make the sortable list of cryptocurrencies and that’s what I want to do in near future.</p><p><strong>Why not publish everything on the website?</strong></p><p>Because of people. There’re many smart people on Medium. During last few months, I met so many great minds here (and by met I mean reading and stalking them), and I would love to meet many more. Medium is the unique place, at least in crypto space. There’s no other online crypto community where people actually deeply care about the technology and future. Twitter may also fit there, but it’s too short.</p><p><strong>What’s your long-term vision for Longcaller?</strong></p><p>Make a place for people to learn about cryptocurrencies. It might be a collection of articles, a list of interviews, a podcast, a forum, anything. The only thing that matters to me is that it needs to be useful and enjoyable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6760c71dbd6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/longcaller/welcome-to-longcaller-a6760c71dbd6">Welcome to Longcaller</a> was originally published in <a href="https://medium.com/longcaller">Longcaller</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to launch on Product Hunt and drown in the sea of products]]></title>
            <link>https://medium.com/hackernoon/how-to-launch-on-product-hunt-and-drown-in-the-sea-of-products-61fbabb8398?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/61fbabb8398</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[product-hunt]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Sun, 08 Apr 2018 16:06:00 GMT</pubDate>
            <atom:updated>2019-05-25T09:33:21.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uqmhofxqf1K5PYk7OyP9Ow.png" /></figure><p>On March 6th, Tuesday I <a href="https://www.producthunt.com/posts/longcaller">launched</a> Longcaller on <a href="https://hackernoon.com/tagged/product-hunt">Product Hunt</a> and got 3 upvotes, one of them is mine. Oh, well.</p><p>There are not so many stories about failed PH launches. After having a failed launch, I think I know why.</p><p>The first reason is obvious. There <strong>are</strong> stories of fails, but no one reads them. Because people don’t like to read about losers. Because fails are not motivating. And while this is partially true, I think that tells only part of the story. I myself prefer to read fail stories, because they feel more realistic and because they help to deal with survivorship bias better.</p><p>The second reason is that after a failed launch you feel miserable. You hate everything. You want to die. “Why did I started it anyway?” In this mood, the last thing you want to do is to write about it. Even after some time is passed, you don’t want to mentally return to that day. The brain prefers to forget that lose as soon as possible (actually, a smart move, Mr. Brain).</p><p>The third and final reason is questioning. Questioning of whether you did a good job in the first place. Did you really make an effort by writing witty copy and shooting UI screens? Did you really try to be friendly and interested, or you just put funny emoji and called it a day?</p><p>So, yeah. I did feel miserable. I did question my efforts. I almost felt physical pain. But let’s not overdramatize. Nobody died. I feel much better now. So let’s try to find out what’s happened there and what to do next.</p><h3>Preparation</h3><p>I don’t want to get into much details of how I was preparing for the launch, simply because it’s boring. I did what everyone else did. I hang out on PH for long now, thinking about what succeeds and what’s not. I read all the guides on how to launch and the success stories. I prepared the copy and images, made a gif and a logo. I published my product. I shared the link on Twitter and a couple of other sites that should be interested.</p><p>In fact, I think I did a good job. It wasn’t a perfect preparation, but it still complies with all recommendations I’ve read.</p><p>I could make two things better though. I don’t have a big following yet. A lot of email subscribers could easily help, but unfortunately, I started to collect emails only recently, so I couldn’t leverage that. Another thing I could do better is launching time. That one is not so obvious though, and I still don’t what’s the best time. I launched around midnight anyway.</p><h3>Fear of launching</h3><p>I planned to launch two weeks earlier. I didn’t prepare the logo, so I decided to wait for the next day, Wednesday. That day I wasn’t fully prepared either, and I didn’t want to launch at the end of a week, so I postponed the launch to the next week.</p><p>Then I started to worry about the best launch time. Is it midnight? Or should wait for a little? That week I tried to find the correlation between launch time, featuring, and upvotes and didn’t launch either.</p><p>In fact, I was just scared of launch and made excuses. But what’s interesting, at the day when I finally actually launched, I wasn’t scared. I was calm as fuck.</p><h3>Results</h3><p>Ok, I got 3 upvotes. What’s next?</p><p>Actually, I got 48 visits from Product Hunt. Not so bad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MnJV-aFgV61K7sWW.png" /></figure><p>I also launched on Reddit and got about 30 visits from there. It’s hard to give an accurate number as I also published one of the articles on the day before, so the traffic from Reddit is mixed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qki3dUGmZT3fDkCd.png" /></figure><p>I get a handful of feedback from IndieHackers and Reddit. Surprisingly, no one bashed UI or usability.</p><p>And I got something else. I’ll write more about it if it’ll work out.</p><h3>Conclusion</h3><p>When you fail, you feel bad. But you also learn some things.</p><p>First, you realize that a lot of other products don’t make it too. Shoot, just look at how many products are launching each day:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Yi945vucUAcV4EX.png" /><figcaption>Casual Tuesday on Product Hunt</figcaption></figure><p>How many of them will be featured? How many of them will be noticed? How many of them will go to the PH newsletter or twitter? Probably not much.</p><p>We go to the second point. Can you rely on PH launch, or even on launch in general as your main customer channel? There are a lot of examples of peoples and products who build an impressive user base solely out of successful launch, but not everybody is that lucky. For most of the people, <a href="https://hackernoon.com/tagged/marketing">marketing</a> is a slow, continual process of nagging the channels and conversion rates.</p><p>I guess for some products bad launch may be hurtful or even deadly. Things like SaaS are hard to grow from the ground up, so lack of initial boost might be depressing.</p><p>For me, launching on PH was more like a formal milestone than a growth tactic. I get a handful of working channels and plan to try even more.</p><p>Was the launch a failure? Definitely. Did that kill Longcaller? Not even close.</p><p><em>Thanks for reading. I occasionally </em><a href="https://destiner.io/blog/"><em>write</em></a><em> about startups and entrepreneurship.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61fbabb8398" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/how-to-launch-on-product-hunt-and-drown-in-the-sea-of-products-61fbabb8398">How to launch on Product Hunt and drown in the sea of products</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I became better at design by using my own startup]]></title>
            <link>https://medium.com/@Destiner/how-i-became-better-at-design-by-using-my-own-startup-a7b33b9286a4?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7b33b9286a4</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Wed, 06 Dec 2017 18:34:11 GMT</pubDate>
            <atom:updated>2018-03-03T20:04:05.388Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEaRlcGx0k4q8CJ7_jZ-nw.jpeg" /></figure><p>I am a man of code. I build things and they work. But they look like shit because I suck at design. I always did.</p><p>But you’re not born a designer, right? You become one. That means I can become a designer too!</p><p>But how? I am not ready to spend 4 years studying at design school. Nor I want to read books or enroll in the online course. Can I become not terrible at design in a short time?</p><p>Last month I built <a href="https://startmap.io/">StartMap</a>. It has tips for those who want to build a startup. It has the best practices on development, marketing, monetization. And, well, design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nd2iS78lvS04OnXkbveZYg.png" /><figcaption>StartMap homepage</figcaption></figure><p>I got a list of maybe 10–15 items to learn. There are actually more on the site, but I selected the best ones based on the rating. The rating is calculated based on the engagement. Thus, the most upvoted products on ProductHunt, the most liked videos on Youtube, the most clapped articles on Medium go first.</p><p>StartMap has videos, online courses, and products, but I mostly focused on Medium articles. I believe that guides published here are a great way to learn, which I will demonstrate below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BPUWsdLy_ZO254NMAYk4Gw.png" /></figure><p>Here’s what I learned.</p><p><a href="https://medium.com/startup-grind/how-to-not-suck-at-design-a-5-minute-guide-for-the-non-designer-291efac43037">How to Not Suck at Design, a 5 Minute Guide for the Non-Designer.</a></p><p>Here are the tips I learned from this article:</p><ul><li>Contrast and alignment matters.</li><li>Use #333333 for black.</li><li>Put important content first.</li><li>Design black and white first.</li><li>Use existing color palettes.</li><li>Use Apple and Google guidelines.</li></ul><p><a href="https://blog.producthunt.com/0-design-tools-for-your-startup-d4240fbb726f">$0 Design Tools to Help You Create Your Next Project</a></p><p>This article is an overview of products made to help entrepreneurs to design. It’s has a lot of tools, so I picked only those which looked helpful for me.</p><p>The first one is <a href="http://www.coverr.co/">Coverr</a>. Coverr is a site that provides you with short stock videos to put in the background of your landing page. And it’s free! I also tried a couple of typography apps but didn’t find the one suitable for me. They all fail in one thing: there are hundreds of fonts and I don’t know which one to use. I don’t want to try them all to find the one I need. Just give me 2 or 3 good looking web-ready fonts that are not Roboto or Open Sans.</p><p>I also loved <a href="https://illustrio.com/">Illustrio</a>, which is basically a set of icons suited for an app icon. I don’t like icons made with generic glyphs, but they introduced styles to customize the icon. I myself wanted to play with this idea (set of standard assets and ability to easily customize them) for a long time. Definitely going to create an icon for my next project with this tool.</p><p><a href="https://medium.com/@cwodtke/how-i-stopped-worrying-and-learned-to-love-design-thinking-f1142bab60e8">How I Stopped Worrying and Learned to Love Design Thinking</a></p><p>I couldn’t get any value from this piece. This is due to the article is describing the workflow, not the tips &amp; tricks. It’s not like I think my designing workflow is perfect, but I like a natural way to do things. Implementing existing framework made by someone is not what I like.</p><p><a href="https://medium.com/uber-design/designing-the-new-uber-app-16afcc1d3c2e">Designing the new Uber App</a></p><p>It is a story about Uber app redesign. It is well written and has a couple of useful tips. First is, if you stuck, try “start at the end”: Uber app is designed to let you set the trip destination before everything else. Second is, think about how can your app help user besides its main function: Uber allows you to order the food or play music while you ride.</p><p><a href="https://uxplanet.org/ux-writing-how-to-do-it-like-google-with-this-powerful-checklist-e263cc37f5f1">UX Writing: How to do it like Google with this powerful checklist</a></p><p>This article is all about UX writing: how to write text for users. It boils down to 3 principles: text should be clear, concise and useful. But that’s only the basics. To get the best out of UX writing, you also need to develop a brand voice. It is simply an informal guideline based on your principles. The article has a great example of Google’ voice. At the expense of being verbose, they make the message sound more friendly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-GEjfnrnBX-GRe1rUaszg.png" /><figcaption>Google adds more words to use their voice</figcaption></figure><p><a href="http://facebook.design/">Facebook Design - What&#39;s on our mind?</a></p><p>This is a collection of tips collected by Facebook team. There are tools, articles, and videos. From what I read, it’s less like guidelines and tutorials, and more like stories and cases. Definitely a great read, but not much to learn.</p><p><a href="https://medium.com/ux-power-tools/a-step-by-step-guide-for-starting-a-new-app-design-project-in-sketch-469df0f24af8">A Step-by-Step Guide for Starting a New App Design Project in Sketch</a></p><p>This is a great guide for beginner designers that use Sketch. I don’t use Sketch but still got some few tips: define colors for “info”, “warning”, and “error” states and test typeface with inverted colors.</p><p><a href="https://uxplanet.org/dos-and-don-ts-of-web-design-8c9d6a5de7c6">Do’s and Don’ts of Web Design</a></p><p>This is a great collection of patterns of web design. Although I knew some of the items, here’s what I learned:</p><ul><li>Make it easy to scan your page.</li><li>Open internal links in a new tab.</li><li>Don’t use blinking text and images.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rts2GU2cBBG7mxXqB23RGA.png" /><figcaption>Basecamp is a great example scanable landing page</figcaption></figure><p><a href="https://medium.muz.li/3-trends-in-landing-page-design-5cf900f2c90f">3 trends in landing page design</a></p><p>This article is heavily loaded with images of modern design solutions, which is great for inspiration.</p><p><a href="https://medium.com/@erikdkennedy/color-in-ui-design-a-practical-framework-e18cacd97f9e">Color in UI Design: A (Practical) Framework</a></p><p>I really liked this article. It uses an empirical approach to set a simple rule to get color variations for the palette.</p><blockquote>Darker color variations are made by lowering brightness and increasing saturation. Brighter color variations are made by increasing brightness and lowering saturation.</blockquote><p>Yeah, that simple. But here is more.</p><blockquote>Shifting hue towards red, green, or blue will decrease perceived lightness of the color. And shifting the hue towards yellow, cyan, or magenta will increase the perceived lightness of the color.</blockquote><p>This is not so intuitive, and the article explains it in detail, so you may want to read it.</p><p><a href="https://uxplanet.org/how-color-can-effect-emotion-ccab0431b1d">Color, psychology and design</a></p><p>It is an interesting overview of color preferences. It also describes how each color perceived and what emotions it can arise. However, there is not much practical advice to learn.</p><p><a href="https://blog.prototypr.io/how-to-use-colors-in-ui-design-16406ec06753">How to use colors in UI Design</a></p><p>This article gives more insights on how to use colors in a digital design. It is a great reminder of 60–30–10 rule: 60% is your dominant hue, 30% is secondary color and 10% is for accent color. It also covers topics like going grayscale-first, not using pure black color, and getting inspiration from nature.</p><p><a href="https://medium.springboard.com/the-guide-to-getting-typography-right-in-digital-design-bb61214ff3ad">Getting Typography Right in Digital Design</a></p><p>The article is filled with useful tips on typography. Here’s what I learned:</p><ul><li>Use no more than two fonts</li><li>Start by selecting font for the body text</li><li>Use font with distinguishable letters</li><li>Avoid all caps</li></ul><p>Another helpful tip I got is to use <a href="https://www.gridlover.net/try">Gridlover</a>. Gridlover is a web app that helps you choose the font size for your text.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m_yyOSZpNbenNqd3RAIAiQ.png" /></figure><p>Of course, you can’t learn design by spending 2 hours reading Medium posts. But you can learn the foundations, and that will be enough most of the time.</p><p>Building your first startup? Check out <a href="https://startmap.io/">StartMap</a>. It has great tips on design, development, and marketing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7b33b9286a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The book I recommend to any entrepreneur]]></title>
            <link>https://medium.com/@Destiner/the-book-i-recommend-to-any-entrepreneur-127514550c9f?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/127514550c9f</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[books]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Mon, 04 Dec 2017 14:12:58 GMT</pubDate>
            <atom:updated>2017-12-04T14:12:58.001Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pfu2MFB07rHgtfR4TkOwEA.jpeg" /></figure><p>I like reading books. Good books always deliver insights and ingenious stories.</p><p>I read many books about startups. Almost all these books are the same. Iterate quickly, know where to find your customer, deliver best customer service. Yeah, we know that.</p><p>But one of them is different. It does not try to teach the reader, though the author would be a great teacher. It feels fresh, however, the book has been written almost a century ago.</p><p>It is “My Life and Work” by Henry Ford. In his book, Henry Ford talks about how and why he started his company.</p><p>For me, it is a compilation of great ideas and insights, tied together by Ford’s narrative. It is full of genuine entrepreneurial spirit. Henry’s motivation to start a business was to make the world more effective.</p><p>This, “organic” way of starting a company is rare now. Today people start startups mostly because of money, fame, and power. Interestingly, they have the least chances to succeed.</p><p>Why Ford’s book feels so different from what we have now? Probably, because back then there were no such terms as MVP, pivot, A/B tests. People just did their job to run a business using common sense and whatever resources they had.</p><p>As Henry Ford states, “people are not equal” Back then, I was shocked: can we even think that people are not equal?! Now it seems natural to me, but I am surprised that nobody talks about it anymore.</p><blockquote>Men are not equal in mentality or in physique. Any plan which starts with the assumption that men are or ought to be equal is unnatural and therefore unworkable.</blockquote><p>The book is full of insights and fresh ideas. Here are only some of them:</p><blockquote>I have no quarrel with the general attitude of scoffing at new ideas. It is better to be skeptical of all new ideas and to insist upon being shown rather than to rush around in a continuous brainstorm after every new idea.</blockquote><p>And more:</p><blockquote>The natural thing to do is to work — to recognize that prosperity and happiness can be obtained only through honest effort.</blockquote><p>And many others.</p><p>As with all great books, “My Life and Work” goes a little beyond its scope. Ford writes about education, healthcare, poverty and saving money. And he definitely has something to say.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=127514550c9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2 free alternatives to Gmail for Business]]></title>
            <link>https://medium.com/@Destiner/2-free-alternatives-to-gmail-for-business-7ac8212abd13?source=rss-80df300f23ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ac8212abd13</guid>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[guide]]></category>
            <dc:creator><![CDATA[Timur Badretdinov]]></dc:creator>
            <pubDate>Sun, 26 Nov 2017 10:32:37 GMT</pubDate>
            <atom:updated>2017-11-26T10:32:37.052Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Eq6GI4WMJLVR5w1braGag.png" /></figure><h4>How to make &lt;mail&gt;@&lt;your-domain&gt; for $0</h4><p>I don’t usually use email address for my domains. I don’t send emails to press and I can receive customer feedback to my personal mailbox. But for one project of mine I needed a mail address with my domain simply to prove that it’s me, the creator of this project, who mails.</p><p>And it’s not like I am a cheapskate, but having to pay $5/month just to send a couple of emails in a week does not resonate with me. If my business will thrive and grow, I am okay to pay money. But for now I am just starting and don’t have money to use paid services.</p><p>I researched and found 2 great options to send and receive mail with my domain for free.</p><h4>Yandex.Mail</h4><p>This is what I use. The user experience is well done, and the design is slick. They provide complete instructions on domain verification and adding MX records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmUNZhQ_4mJ9xr2seZlP4Q.png" /><figcaption>Quick guide to add your domain</figcaption></figure><p>Another thing I like is that you don’t need to setup mail client. You can access your mailbox from a web client. I don’t know about you, but I use all my emails only from web. Every time I try to setup desktop or mobile client, something breaks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkKrxVsDUrz78JtdeujvuA.png" /><figcaption>Web interface is familiar and intuitive</figcaption></figure><p>Sending and receiving mails works as expected. I am sure in the service: Yandex is a huge player in Russia. They provide customer mailboxes (like Gmail) for years.</p><p>Yandex.Mail is free no matter how much domains and mailboxes you use.</p><blockquote>Disclaimer: As Yandex does not charge you for using mail, they make money mostly by showing ads (just like Google). I couldn’t find any ads on the mail page, but it may appear at some time. Also, read their Privacy Policy and User Agreement before using it.</blockquote><h4>Zoho Mail</h4><p>Zoho Mail serves as mail provider as a part of Zoho Workplace. It is free until you have more than 25 employees and one domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0wj8667X8uQB_JxfTn-XFQ.png" /><figcaption>The interface is a bit confusing.</figcaption></figure><p>The verification process is super fast. Once your domain is verified, you can create a mailbox.</p><p>Unfortunately, I didn’t found way to read and send emails from the web. The only way I found is to export your emails and then read them with a Desktop software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQjRTAtFcEWfeMqURvwyZg.png" /><figcaption>Zoho Mail dashboard</figcaption></figure><p>I successfully received the email I send to myself from my personal email address. I couldn’t test sending, because as I mentioned above, I didn’t find the web interface.</p><p>Overall, Zoho Mail works okay, but I don’t know any reasons to use it instead of Yandex.Mail unless you want to use other Zoho products.</p><p><em>If you want to learn coding to make your project, but need help, check out my </em><a href="https://medium.com/@Destiner/coding-mentorship-program-fb5acd7476e4"><em>Mentorship Coding Program</em></a><em>.</em></p><p><em>And if you want to discover the best guides and products to make your project, I made </em><a href="https://startmap.io/"><em>StartMap</em></a><em>, which is a list of tips from startup online communities.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ac8212abd13" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>