Sharing Top Content from the Angular-sphere.

Chiccocoin: Learn what is a Blockchain by creating one in NodeJS

  • Create the blockchainNow we’re going to create our blockchain.Rereading the definition of blockchain we can summarize that the absolutely necessary functions are:newBlock: Function that creates a new blocknewTransaction: Function that creates a transaction and queues it to be saved the next time a block is createdhash: Function that encrypts a…
  • The function also will add to the block all the transactions that have not yet been saved and clean up our variable current_transactions3.1.1 Hash functionThe hash function that uses for our Chiccocoin is a trivial SHA256 but you can use the hash function that you prefer.
  • The important thing is to do the hash of the previous block, to do this we will do the hash of the serialized object3.2 Create a transactionThe function to add a new transaction is very trivial.
  • The Proof of WorkIn general, the proof of work is a function or a protocol invented and used to deter denial of service attacks, but the blockchain used it to determinate how new Blocks are created or mined on themselves.
  • Serve over APIHaving started the project with expressjs serving our blockchain via API will be very simple.We’ll create three API:/transactions/new to create a new transaction to a block/mine to tell our server to mine a new block.

Every day on our feeds we find news about new cryptocurrency or someone who says that they are a big bubble that will soon explode and of which only the blockchain will remain. But, what is the…

Chiccocoin: Learn what is a Blockchain by creating one in NodeJSDisclaimer: chiccocoin is not a true cryptocurrency and we do not sell it , this article is for recreational / educational purposes onlyEvery day on our feeds we find news about new cryptocurrency or someone who says that they are a big bubble that will soon explode and of which only the blockchain will remain. But, what is the blockchain?By definition:Is a continuously growing list of records, called blocks, which are linked and secured using cryptography.So, the blockchain is an immutable, sequential chain of records called Blocks. Each block can contain transactions, files or any data you like. The important thing is that they’re chained together using hashes.Blockchains are secure by design and are an example of a distributed computing system with high Byzantine fault tolerance. This makes blockchains potentially suitable for the recording of events, medical records, and other records management activities, such as identity management, transaction processing or voting.How does a blockchain technically work?Understanding Blockchains reading article or tutorials isn’t easy. Wandering among the many online guides I found this article by Daniel van Flymen and my curiosity to understand how it really worked has grown so much to try to create a blockchain using NodeJS.1. Create a logoThe first step to creating a new project is to create the logo. It makes everything real. To do this I used Squarespace logo creator and this is the result:Now we can really start with our project.2. Start with ExpressTo facilitate the creation of…

Chiccocoin: Learn what is a Blockchain by creating one in NodeJS