Posts

Showing posts from 2018

useful videos

Building And Deploying Ethereum Smart Contracts With Solidity and JavaScript https://www.youtube.com/watch?v=0phCtYMx2Ac Hyperledger Fabric Build Your First Network Walkthrough https://www.youtube.com/watch?v=rtuwuo1dcTY What is Corda blockchain? Simply explained https://www.youtube.com/watch?v=rFZhbvtT284 Build a Fully Decentralized Application with IPFS - Ethereum Dapp Programming Tutorial https://www.youtube.com/watch?v=ADoRVVOSpI8&list=PLS5SEs8ZftgWggD3tKfgwsIPXuIhorXZk

Useful links

Deploy your own smart contract with Truffle and Ganache CLI https://medium.com/haloblock/deploy-your-own-smart-contract-with-truffle-and-ganache-cli-beginner-tutorial-c46bce0bd01e Developing Ethereum Smart Contracts for Beginners https://coursetro.com/courses/20/Developing-Ethereum-Smart-Contracts-for-Beginners Demo of Multi-Channel Network in Hyperledger Fabric https://medium.com/@kctheservant/demo-of-multi-channel-network-in-hyperledger-fabric-640f7158e2d3 chmod 777 /var/run/docker.sock How Operating Systems Work: 10 Concepts you Should Know as a Developer https://medium.com/cracking-the-data-science-interview/how-operating-systems-work-10-concepts-you-should-know-as-a-developer-8d63bb38331f

Storage is Expensive

One of the more expensive operations in Solidity is using storage — particularly writes. This is because every time you write or change a piece of data, it’s written permanently to the blockchain. Forever! Thousands of nodes across the world need to store that data on their hard drives, and this amount of data keeps growing over time as the blockchain grows. So there's a cost to doing that. In order to keep costs down, you want to avoid writing data to storage except when absolutely necessary. Sometimes this involves seemingly inefficient programming logic — like rebuilding an array in memory every time a function is called instead of simply saving that array in a variable for quick lookups. In most programming languages, looping over large data sets is expensive. But in Solidity, this is way cheaper than using storage if it's in an external view function, since view functions don't cost your users any gas. (And gas costs your users real money!).

Struct packing to save gas

There are different types of uints: uint8, uint16, uint32, etc. Normally there's no benefit to using these sub-types because Solidity reserves 256 bits of storage regardless of the uint size. For example, using uint8 instead of uint (uint256) won't save you any gas. But there's an exception to this: inside structs. If you have multiple uints inside a struct, using a smaller-sized uint when possible will allow Solidity to pack these variables together to take up less storage. For example: struct NormalStruct {   uint a;   uint b;   uint c; } struct MiniMe {   uint32 a;   uint32 b;   uint c; } // `mini` will cost less gas than `normal` because of struct packing NormalStruct normal = NormalStruct(10, 20, 30); MiniMe mini = MiniMe(10, 20, 30); For this reason, inside a struct you'll want to use the smallest integer sub-types you can get away with. You'll also want to cluster identical data types together (i.e. put them next to each ot...

Pros and Cons of Hyperledger Fabric for Blockchain Networks

Enterprises are increasingly interested in blockchain due to its promise of improved efficiency and cost reduction. However, they can’t use the permissionless public blockchains because of lack of privacy, low scalability, and less transaction throughput. Businesses need enterprise blockchains, and Hyperledger Fabric is increasingly looking like a good option for them. In this article, I explain pros and cos of Hyperledger Fabric for blockchain networks. However, I will first briefly describe why businesses require enterprise blockchains over public blockchains. Why Hyperledger Fabric for blockchain Businesses can’t use public blockchains due to the following reasons: Privacy issues : Public blockchains like Bitcoin are permissionless. Anyone can join it, including anonymous and pseudonymous users. Many businesses such as financial services institutions and healthcare providers work under stringent privacy requirements. They can’t allow just anyone to see their sen...

How does Hyperledger Fabric works?

Image
Hyperledger Fabric is a permissioned blockchain network that gets set by the organizations that intends to setup a consortium. The organizations that take part in building the Hyperledger Fabric network are called the “ members ”. Each  member  organization in the blockchain network is responsible to setup their  peers  for participating in the network. All of these peers need are configured with appropriate cryptographic materials like Certificate Authority and other information. Peers in the member organization receives transaction invocation requests from the clients inside the organization. A  client  can be any specific application/portal serving specific organization/business activities. Client application uses Hyperledger Fabric SDK or REST web service to interact with the Hyperledger Fabric network. Chaincode (similar to Ethereum Smart Contract) installed in peers causes to initiate transaction invocation request. All the peers maintain thei...

What is a soft fork?

DEFINITION of ' Soft Fork ' In terms of blockchain technology, a  soft fork  (or sometimes  softfork ) is a change to the software protocol where only previously valid blocks/transactions are made invalid.

What happens in a hard fork?

A  hard fork  (or sometimes  hardfork ), as it relates to blockchain technology, is a radical change to the protocol that makes previously invalid blocks/transactions valid (or vice-versa). This requires all nodes or users to upgrade to the latest version of the protocol software. A blockchain split  occurs  during a  hard fork  which in turn branches the chain into two parts. ... When the blockchain branches into two there will be two digital assets immediately after the  hard fork . Bitcoin holders who possess their private keys will have access to assets on both chains after the split event  occurs .