Implementing Rock Paper Scissors in Solidity
Have you ever thought about playing rock paper scissors on the blockchain? In this tutorial, we will build a privacy focussed rock paper scissors application on Ethereum using Solidity.
The aim is to understand the differences between a web2 application and web3 application also known as DApp (Decentralised Application). In a web2 application, the database is private and the server is trusted whereas in a web3 application, there is no server, there is no one database, there is only a blockchain which has state and trust isnt really present, asking a blockchain node about the state can only be trusted if other nodes agree on that as well, these are all sort of topics I have discussed in my privacy course which you can watch here: Introduction to privacy on Ethereum. …
TLDR; If you want to learn about privacy and how you can design your blockchain applications with privacy, I am working on a course which will go through the most widely used privacy techniques and add them to your applications in a very hands on fashion.
Privacy is very fundamental concept to developing blockchain applications, yet there are very little resources out there to learn from, especially knowing all the different techniques used for privacy and there pros and cons, also there is bias within different communities for privacy techniques if they have developed them or have any affiliation with them. …
At the time of writing, there is no secure way of knowing if a contract was called by Another Contract or an Externally Owned Account, there has been 2 ways but both both of them are easily hackable and I will discuss each of them below.
EXTCODESIZE:
function isContract(address _addr) private returns (bool isContract){
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}Taken from: https://ethereum.stackexchange.com/questions/15641/how-does-a-contract-find-out-if-another-address-is-a-contract
As the stackExchange answer already mentions, this way is not secure because doing construction time, the code at the address of contract is still 0 and there are many articles describing the exploit in detail. …
Going to Mainnet is the dream of every Crypto startup, being able to say that its all public and real and we are out of the safe environment to face the transaction fees, network congestion and high-security risks. But with all that comes trust, motivation to contribute to the ecosystem and to solve all these problems. Not just for ourselves, but for everyone ~ it’s open source after all.
While it may seem that moving to mainnet is as simple as changing the Web3 provider to a Mainnet node and using the right chain ID within transactions. it’s actually much more than that. Mainnet involves dealing with real ETH, which means with every move, you’ve got one eye on transaction fees. If its too low then it will never be executed, but if its too high then business won't be able to survive. One of the decisions we made at Zinc is to pay for users transaction fees and open the ecosystem to the mass instead of just the crypto enthusiasts and take away all of the complications through design abstractions. …
IPFS — Interplanetary File System is awesome for storing data in a decentralised fashion and it’s one of the most commonly used tools for storing data within the blockchain space. Storing data within a Blockchain is expensive and slow, storing in IPFS is free and fast. IPFS does not allow duplication of data by hashing it and hashing the same data twice will give back the same hash.
IPFS seems to work really well. You can add data and it stays in this global network of nodes. Anyone with a hash can access the data (note that all data on IPFS is public unless you use a private IPFS node) and the same data is not duplicated. …
Over the past month, we have been busy designing and implementing trustless smart contracts written in Solidity. This post will walk through the architectural decisions made and lessons learnt along the way.
Smart contracts play an important role in applications by giving the guarantee that everyone executes the same code all over the world, However; they must be designed with the right set of goals in mind. The goal for us was to have trustless smart contracts where there is no Owner in the contract and Zinc only ever has the rights explicitly granted by the user. In general, most dApp’s smart contracts are Pausable in order to avoid situations like the DAO hack. …
About