The blockchain explained to web developers part 1

By | Monday, April 19, 2021

Navigation

  • Why You Should Become a Blockchain Dev
  • Blockchain explained in plain English
  • Developer resume generator
  • Navigation menu
  • Why You Should Become a Blockchain Dev

    Start on. Show related SlideShares at end. WordPress Shortcode. Full Name Comment goes here. Are you sure you want to Yes No. No Downloads. Views Total views. Actions Shares.

    No notes for slide. Barney Frank discusses why we need regulations for future financial technologies 3. What is blockchain? A blockchain, distributed across a network, is a technology that effectively replaces and decentralizes traditional ledger systems. How this changes the system of ledgers: Central authority is holder of main ledger and is ultimate authority.

    Ledger is shared by several authorities who must confirm with each other. No central authority. Ledger shared by all. Differently permissioned distributed ledgers: Because the system is made of code, permissions can be built directly into the code governing the chain Permissions determine: 1. Who can read the data in the chain 2. Current activities surrounding distributed ledger systems: The future of financial infrastructure -The World Economic Forum, Aug Despite being the most well-known application of blockchain tech… Examples of cryptocurrencies Bitcoin was the first, most traded and the most valuable cryptocurrency.

    Bitcoin brought the blockchain into the mainstream. Bitcoin represented a direct response to these questions following the world financial crisis. The broad concept Cryptocurrencies are just digital cash The future of financial infrastructure -The World Economic Forum, Aug Comparison of funds transfer: How does funds transfer actually happen?

    Ways to get Bitcoin Have your friend send them directly to your digital wallet! Ways to get Bitcoin Exchange your fiat currency for bitcoin on an exchange! Ways to get Bitcoin Mine them Mining is basically the process of applying computing power to solve the complicated computational problems needed to verify each new block in the chain is correct. Mining was once easy with a regular computer, but has now become the domain of specialized, highly- powered and resource intensive mining industry.

    Miners are incentivized to do so because the code provides them with a reward of currency each time a block is solved. Key considerations for understanding further applications of blockchain technologies: Digital identity does not need to be tied to a wallet in a phone or computer. What does this imply? A contract might be in fact composed of many private functions, variables, etc.

    Smart contracts are hosted in the blockchain in an Ethereum-specific binary format, executable by the Ethereum Virtual Machine. Several languages and compilers are available to write contracts:. At marmelab, we code a lot in Javascript, so we chose to use Solidity. Solidity contracts are stored in. The Zero Dollar Homepage contract stores the claimed pull-requests, and a queue of requests to display. The first version of the Solidity contract looked like this:.

    For this first attempt, we used the Eris JS libraries to communicate with our blockchain. Instanciating a contract from a Node. For more information about the Eris JS binding libraries, please refer to Eris documentation.

    We love Test Driven Development, and one of the first question we had was: how can we test a Solidity smart contract? The Eris guys made a tool for that, too: sol-unit. It runs a new local blockchain network for each test, in a docker container which ensures each test run in a clean environment , and executes the test. Tests are written as a contract, too. Well, not so fast.

    For that, there is a simple Solidity syntax:. So far so good We hit a strange case when compiling our contracts. Apparently, you can't import contracts with such a path. We ended up adding a command in our test makefile target to copy those sol-unit contracts in the same folder as ours. After that, running sol-unit was simple and we started coding. Running a blockchain and deploying our contract to it was as simple as following the Eris documentation. We managed to resolve the few troubles we met using a bunch of commands that we integrated in our makefile.

    The whole process of running a new blockchain with our contract looks like this:. To communicate with contracts inside the Ethereum blockchain, we had to use the Web3 libraries.

    We learned a lot while trying to use them. We realized that eris was hiding a lot of the underlying complexity. First, our initial assumption that a contract is similar to an API was not correct.

    We had to distinguish functions that were only reading data from the blockchain, and functions that were writing data to it. The first kind read-only functions would return the resulting data asynchronously, just like an API would do. The second kind write functions would only return a transaction hash. The expected side effects of a write function changes inside the blockchain wouldn't be effective until the corresponding blocks would be mined, which could take some time from ten seconds to one minute in the worst case.

    Moreover, we haven't been able to make those writing functions return values, so we had to change our solidity code to call a write function first, then call a read function to get the results. We also discovered events , which can be used to be notified when something happens in a smart contract.

    The smart contract is responsible for triggering the events. They look like this with solidity:. Those events are stored permanently in the blockchain.

    That means we could use the blockchain as an event store. It might be the easiest way to determine if a call to a function has been successfully executed: the smart contract may trigger an event at the end of its process with failure reasons, results of computation, etc It's worth noting that some integration packages for Meteor are already available. Eventually, we refactored our smart contracts to be a lot simpler in order to get almost the same features.

    We had to get rid of the mappings which we haven't been able to use - our transactions weren't mined by the Ethereum network for some reason. The solidity language may be close to JavaScript, it is still very young and incomplete. Arrays don't have the functions we're used to work with in JavaScript not even indexOf , and strings don't have any functions. This might be addressed by some community efforts in the near future.

    The process for claiming a pull request and returning the estimated display date evolved to become:. Running our application in a local environment was a challenge, but deploying it to production, in the real Ethereum network, was a battle. There are a few gotchas to be aware of.

    The most important one is that contracts are immutable in code. This means that:. Another gotcha is that every contract deployment and write operation in the blockchain costs a variable amount of ether. We managed to get 5 ETH more about getting ether below , but we had no idea how much we would need to deploy our contract, or calling a transaction. It's harder to test when each failed test costs money.

    For the Node. To do so, we had to:. Make sure your blockchain node server has plenty of storage. The current size of the blockchain is about 15GB. The default volume size on an EC2 instance is 8GB sigh. We had many troubles because we hadn't downloaded the entire chain but we didn't realize it immediately.

    For instance, we had an account with 5 ETH, but for a long time the system responded as if we hadn't unlocked our account, or as if we had no ether. Downloading the rest of the chain fixed this issue. Likewise, unlocking our precious account containing 5 ETH was not an easy task. We did not want to hardcode our passphrase in the application, and we wanted to run the node with supervisord to ease the deployment.

    We finally found a way that allowed us to change the configuration without exposing our passphrase with the following supervisord configuration:. Do not open this port on your EC2 instance! Anyone knowing the instance IP could control your Ethereum node, and steal your ether. As explained in our first post on the blockchain , deploying and calling a contract in the Ethereum blockchain isn't free.

    Since a blockchain is expensive to run, any write operation must be paid for. In Ethereum, the price of calling a write contract method depends on the complexity of the method. Ethereum comes with a list of Gas Fees , which tells you how much Ether you should add to a contract call to have it executed.

    In practice, that's a very low amount of Ether, a fraction of a single Ether. The Ethereum blockchain introduced another currency for running contracts: Gas. The Gas to Ether conversion rate will vary in the future according to the supply of computing power, and the computation demand.

    Charging a fee to process a transaction isn't compulsory, but recommended. The Ethereum documentation says: "Miners are free to ignore transactions whose gas price is too low". However, a mined block always give 5 ETH to the successful miner. To call our own contracts, the Ethereum blockchain requires between 0. How do you get Ether and Gas? You can buy Ether mostly by exchanging Bitcoins , or you can mine it.

    In France, where we live, buying Bitcoins or Ether requires almost the same procedure as opening a bank account. It's slow a few days , painful, and depends on exchange rates fixed by offer and demand. So we decided to mine our Ether. That's a good way to see if mining is profitable on Ethereum or not. We installed Ethminer , and started our node. We quickly had to beef up the instance even more, because of high memory and storage requirements.

    The first thing a node does when it joins a blockchain is to download the entire history of past transactions. As a reminder, the Ethereum blockchain mines one block every 10 seconds.

    Mining a block brings up 5 Ether, which sell for roughly The running cost for our beefy EC2 instance for these 3 days was about 5 5. All in all, it was cheaper to mine Ether on AWS than to buy it. But we were very lucky: since we mined our block, the network's difficulty was multiplied by three. The Zero Dollar Homepage workflow implies one transaction per day, plus one transaction per claimed PR. With 5 ETH, we should normally be able to run the platform for almost seven years. As you see, running a contract in Ethereum isn't free, but at the current price of Ether, it's still cheap.

    However, the Ether value varies a great deal. Since mining Bitcoin is becoming less and less profitable, some large Bitcoin mining farms switch to Ethereum. This makes mining harder, and makes Ether more expensive every day. But by the time we got there, Ethereum released their Homestead version, which brought a lot of new things and broke our code entirely. It took us about a week to understand why, through trial and error, and fix the code that wasn't compatible anymore for obscure reasons.

    The Homestead release documents a hidden Ethereum feature, private networks , to ease development. The lack of private networks was one of our reasons to use Eris in the first place. The ZeroDollarHomePage platform is now up and running again. Yes, we're open-sourcing the entire ad platform , so you can see in detail how it works, and reproduce it locally.

    The Ethereum developer experience is very bad. Imagine that you have no logs and no debug tools. Imagine that the only way to discover why a program fails is to echo "I'm here" strings every line to locate the problem.

    Imagine that sometimes e. Imagine that a program that works perfectly in the development environment where you can add debug statements fails silently in the production environment where you can't. That's the developer experience in Ethereum.

    The blockchain explained to web developers part 1

    Its decentralized nature makes it attractive for individuals and companies of all sizes to tap into. There are no control or ownership rights and this gives great flexibility to its robust and cryptic nature of record keeping.

    Because there is no single entity controlling it nor anyone in charge of the ledger, there is no middleman to take a cut out of transactions that take place. This makes it a great alternative for traditional financial transactions done for decades using agreements and middlemen taking a cut, such as it happens in the real estate or banking industries. The Blockchain started out as a ledger for Bitcoins and cryptocurrencies.

    However, today it is often used in various Ethereum projects including the creation of smart contracts that offer businesses the ability to make deals using secure digital agreements. Let us take a look at two cryptocurrencies to see how they rely on the Blockchain for various purposes and show what the ledger is capable of:. The Blockchain was created with Bitcoin in mind. Bitcoins are p2p digital currency that uses the Blockchain to track the ownership of digital currency and record ownership when that ownership changes hands.

    Ethereum is another cryptocurrency that relies on the Blockchain but has a different nature from Bitcoin. Ethereum is actually an open software platform enabling software developers to deploy decentralized apps. It uses the Blockchain extensively for this.

    Both of these technologies are immersive and show how powerful the Blockchain is. Their nature shows how even software development as a whole can change when using the ledger. However, because Blockchain records transactions in secure blocks on a ledger, there are many innovative examples of startups coming out with product ideas not related to crypto assets.

    An example of a non-crypto Blockchain project includes a work-in-progress signalling system that detects and prevents DDoS attacks using a coordinated and distributed defense. It is unique because the project aims to use hardware and software combined to create a system for this purpose. It uses specific hardware tailor-built for this purpose, including a tinker board Ethernet card alongside various circuitry.

    Multiple laptops are used to mine Ethereum and serve as the node. This hardware is used alongside software-defined networking and the Blockchain to achieve its results. The overall system aims to reduce the complexity of existing distributed protocols and architectures to intercept DDoS attacks information.

    Another example of what the Blockchain is capable of includes a smart contract project for the Internet of Things IoT.

    Traditional financial industries like insurance, real estate, and banking can also benefit from Blockchain ideas. This includes electronic digitally-recorded property assets , regulatory compliance contracts and much more. The Blockchain is a really disruptive technology.

    According to a SAP poll of business leaders , here are four industries that the Blockchain is disrupting or influencing the most:. If you are a developer interested in cryptography and distributed systems with a decentralized nature, Blockchain is a great fit for you. You will be taking part of a new ecosystem forming and influencing many industries from car sales to banking systems. The Blockchain is also a safe bet if you want to become familiar with a technology that will not disappear or be replaced tomorrow by something similar.

    It has already proven itself across multiple projects and will continue to thrive in the years ahead. You can change your ad preferences anytime. Upcoming SlideShare. Like this presentation? Why not share! Embed Size px. Start on. Show related SlideShares at end.

    WordPress Shortcode. Full Name Comment goes here. Are you sure you want to Yes No. No Downloads. Views Total views. Actions Shares. No notes for slide. Barney Frank discusses why we need regulations for future financial technologies 3.

    What is blockchain? A blockchain, distributed across a network, is a technology that effectively replaces and decentralizes traditional ledger systems.

    How this changes the system of ledgers: Central authority is holder of main ledger and is ultimate authority. Ledger is shared by several authorities who must confirm with each other.

    No central authority. Ledger shared by all. Differently permissioned distributed ledgers: Because the system is made of code, permissions can be built directly into the code governing the chain Permissions determine: 1. Who can read the data in the chain 2. Current activities surrounding distributed ledger systems: The future of financial infrastructure -The World Economic Forum, Aug Despite being the most well-known application of blockchain tech… Examples of cryptocurrencies Bitcoin was the first, most traded and the most valuable cryptocurrency.

    Bitcoin brought the blockchain into the mainstream. Bitcoin represented a direct response to these questions following the world financial crisis. The broad concept Cryptocurrencies are just digital cash The future of financial infrastructure -The World Economic Forum, Aug Comparison of funds transfer: How does funds transfer actually happen? Ways to get Bitcoin Have your friend send them directly to your digital wallet! Ways to get Bitcoin Exchange your fiat currency for bitcoin on an exchange!

    Blockchain explained in plain English

    Distributed ledger technology enable the coding of simple contracts that will execute when specified conditions are met. The IETF has a recent Blockchain-interop working group that already produced the draft of a blockchain interoperability architecture. There are part few gotchas blockchain be aware developers. Thus, it can validate the transactions at a time in parallel. Another cool element of this web is the decentralized storage of the network. Archived PDF from the original on explained April

    Developer resume generator

    The blockchain explained to web developers part 1

    The crowdsourcing of developers on event probability is proven to have a high degree of accuracy. Furthermore, part promotes additional privacy and takes the burned off the core network system. Imagine that a program that works perfectly in the development environment where you can add explained statements fails web in the production environment where you can't. We also discovered eventswhich can be used to be notified when blockchain happens in a smart contract. As you create an extensive portfolio, you must learn how to utilize cold wallets to the your money.

    Navigation menu

    For more information, see our Web Policy. If you developers understand the all, don't part very few people know enough to be able to develop blockchain blockchain on their own which is a problem. But here the taking participation would depend mostly on the possession of coins. Ensuring Authenticity 1. Explaining the Tech Behind Cryptocurrencies Published ". Archived from the original on 13 July explained

    The inaugural issue was published in December The journal encourages authors to digitally sign a file hash of submitted papers, which are then timestamped into the bitcoin blockchain. Authors are also asked to include a personal bitcoin address in the first page of their papers for non-repudiation purposes. From Wikipedia, the free encyclopedia. For other uses, see Block chain disambiguation. If one group of nodes continues to use the old software while the other nodes use the new software, a permanent split can occur.

    For example, Ethereum has hard-forked to "make whole" the investors in The DAO , which had been hacked by exploiting a vulnerability in its code. In this case, the fork resulted in a split creating Ethereum and Ethereum Classic chains. In the Nxt community was asked to consider a hard fork that would have led to a rollback of the blockchain records to mitigate the effects of a theft of 50 million NXT from a major cryptocurrency exchange.

    The hard fork proposal was rejected, and some of the funds were recovered after negotiations and ransom payment. Alternatively, to prevent a permanent split, a majority of nodes using the new software may return to the old rules, as was the case of bitcoin split on 12 March See also: Distributed ledger. Main article: Cryptocurrency. Main article: Smart contract. Main article: Ledger journal. Economics portal.

    The Economist. Archived from the original on 3 July Retrieved 18 June The technology behind bitcoin lets people who do not know or trust each other build a dependable ledger.

    This has implications far beyond the crypto currency. Archived from the original on 21 May Retrieved 23 May The New York Times. Archived from the original on 22 May Archived PDF from the original on 21 September Retrieved 22 October Archived from the original on 17 April Bitcoin and cryptocurrency technologies: a comprehensive introduction.

    Princeton: Princeton University Press. January Harvard Business Review. Harvard University. Archived from the original on 18 January Retrieved 17 January The technology at the heart of bitcoin and other virtual currencies, blockchain is an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way. Archived from the original on 27 September Retrieved 18 November Archived from the original on 6 September Retrieved 5 September Scott January Journal of Cryptology.

    Scott March Academic Press. Archived from the original on 19 May Retrieved 25 February Archived from the original on 2 December Retrieved 3 December Artificial Lawyer. Retrieved 22 May Archived from the original on 8 November Retrieved 9 November Archived PDF from the original on 6 March Retrieved 16 September Archived from the original on 13 November Retrieved 16 November Archived from the original on 14 November Retrieved 13 November Handbook of Digital Currency.

    Archived from the original on 31 October Retrieved 19 November Mastering Bitcoin. Unlocking Digital Cryptocurrencies. Archived from the original on 1 December Retrieved 3 November Archived PDF from the original on 20 March Retrieved 28 April Archived from the original on 20 November Retrieved 20 November IGI Global. IEEE: — Archived from the original on 22 April O'Reilly Media, Inc.

    The New Yorker. Archived from the original on 31 December Retrieved 30 December The network's 'nodes' — users running the bitcoin software on their computers — collectively check the integrity of other nodes to ensure that no one spends the same coins twice.

    All transactions are published on a shared public ledger, called the 'block chain. Archived from the original on 10 October Retrieved 11 October Money and State. Archived from the original on 1 November Retrieved 2 November Archived from the original on 21 April The Wall Street Journal.

    Archived from the original on 10 June Archived from the original on 29 June American Banker. Archived from the original on 30 March Archived from the original on 8 June Archived from the original on 13 July Retrieved 13 July The Innovation Enterprise. Archived from the original on 30 November Retrieved 4 December ZiffDavis, LLC. Archived from the original on 25 September Retrieved 25 September Archived from the original on 9 May Retrieved 8 May Cambridge Centre for Alternative Finance.

    University of Cambridge Judge Business School. Archived PDF from the original on 15 May Retrieved 15 May — via crowdfundinsider.

    Archived from the original on 15 May Retrieved 15 May Archived from the original on 4 June Retrieved 4 June Archived from the original on 28 August Archived from the original on 10 December MIT Technology Review. FinTech Magazine Article. Financial Times. Archived from the original on 9 November Retrieved 7 November Archived from the original on 22 July Archived from the original on 19 June Retrieved 19 June Understanding Bitcoin: Cryptography, Engineering and Economics.

    Archived from the original on 14 February Retrieved 4 January — via Google Books. London, UK. Artificial Intelligence and Law. IMF Discussion Note. International Monetary Fund. Archived PDF from the original on 14 April Retrieved 19 April Archived from the original on 8 July Retrieved 29 June Many banks are partnering with companies building so-called private blockchains that mimic some aspects of Bitcoin's architecture except they're designed to be closed off and accessible only to chosen parties.

    Australia Financial Review. Retrieved 7 July Blockchain networks can be either public or private. Public blockchains have many users and there are no controls over who can read, upload or delete the data and there are an unknown number of pseudonymous participants.

    In comparison, private blockchains also have multiple data sets, but there are controls in place over who can edit data and there are a known number of participants.

    PostBox Communications. PostBox Communications Blog. Archived from the original on 17 March Banks preferably have a notable interest in utilizing Blockchain Technology because it is a great source to avoid fraudulent transactions. Blockchain is considered hassle free, because of the extra level of security it offers. Archived from the original on 28 September Retrieved 28 September Retrieved 13 May Archived from the original on 5 December Archived from the original on 10 July Retrieved 9 July Sueddeutsche Zeitung in German.

    Archived from the original on 24 March Retrieved 29 April Archived PDF from the original on 23 June Retrieved 26 September Asia Times.

    Archived from the original on 9 July Retrieved 28 February Can Ethereum Handle the Traffic? Archived from the original on 28 October Retrieved 30 September Archived from the original on 12 January Archived from the original on 22 June Retrieved 7 June Archived from the original on 7 June Archived from the original on 22 March Archived from the original on 18 July Retrieved 24 July Knowledge Wharton. The Wharton School of the University of Pennsylvania. Retrieved 28 August Retrieved 18 August Retrieved 5 December Retrieved 19 August Archived from the original on 3 February Retrieved 8 March Archived from the original on 4 February IEEE Access.

    Munich, Germany: Association for Computing Machinery: 30— Enterprise Times. Retrieved 1 September PT Industrieel Management.

    Retrieved 21 October Hacker Noon". Retrieved 16 April HedgeTrade Blog. Archived from the original on 6 November Archived from the original on 27 December Archived from the original on 8 March Archived from the original on 19 November Kotobi, and S. Archived from the original on 23 September Music Business Worldwide.

    Archived from the original on 10 April Wired UK. Archived from the original on 8 May The Guardian. Tech Crunch. AOL Inc. Archived from the original on 7 November Future Internet. Archived PDF from the original on 14 November Follow My Vote. Archived from the original on 27 October Home Explore. Successfully reported this slideshow. We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads.

    You can change your ad preferences anytime. Upcoming SlideShare. Like this presentation? Why not share! Embed Size px. Start on. Show related SlideShares at end. WordPress Shortcode.

    Full Name Comment goes here. Are you sure you want to Yes No. No Downloads. Views Total views. Actions Shares. No notes for slide. Barney Frank discusses why we need regulations for future financial technologies 3.

    What is blockchain? A blockchain, distributed across a network, is a technology that effectively replaces and decentralizes traditional ledger systems. How this changes the system of ledgers: Central authority is holder of main ledger and is ultimate authority.

    Ledger is shared by several authorities who must confirm with each other. No central authority. Ledger shared by all. Differently permissioned distributed ledgers: Because the system is made of code, permissions can be built directly into the code governing the chain Permissions determine: 1. Who can read the data in the chain 2. Current activities surrounding distributed ledger systems: The future of financial infrastructure -The World Economic Forum, Aug Despite being the most well-known application of blockchain tech… Examples of cryptocurrencies Bitcoin was the first, most traded and the most valuable cryptocurrency.

    Bitcoin brought the blockchain into the mainstream. Bitcoin represented a direct response to these questions following the world financial crisis. The broad concept Cryptocurrencies are just digital cash The future of financial infrastructure -The World Economic Forum, Aug Comparison of funds transfer:

    Leave a Reply

    Your email address will not be published. Required fields are marked *