Posts

Non-Fungible Tokens (NFTs) 101

Image
Non-Fungible Tokens (NFTs) have captured the imaginations of collectors, investors, and tech enthusiasts alike, and if your interest in NFTs and blockchain technology is growing, you will want to learn more about NFT standards. However, before you read more, if you aren’t familiar with NFTs and want to learn more about them, we suggest starting with our NFT development article. This piece will give you the background information to understand some of the technicalities we cover in this post. While investors and collectors are excited about the early popularity of digital collectibles, NFTs represent the future of blockchain technology. They will likely completely change the way digital content is created, distributed, and consumed. In addition, businesses will be able to use NFTs in several ways regarding Digital Rights Management (DRM). Businesses must take the time to understand NFTs and their underlying standards to position themselves and make competitive business decisions...

OpenSea $1,700,000 Phishing Hack Analysis

Image
OpenSea , the world's largest and most used NFT exchange, suffered a major attack on 2/19/2022, which cost users over 640 ETH worth of NFTs. Additionally, Etherscan may have suffered a coordinated DDoS attack in wake of this exploit in an attempt to block users from revoking access to their NFTs. In this write-up, I'll take a look at the smart contract ( Decompiled ) used in this attack, and break down the inner workings of what it's doing at each step. I aim to figure out how this attack happened, as well as how it can be prevented in the future. Technical Breakdown The transaction I am going to break down can be found on Etherscan . In order to get a better look at what's happening behind the scenes, I'll also use ethtx.info . The transaction begins with the attacker interacting with his contract with some calldata, which appears to be a signature for a token sale. At this time, I believe that this signature was somehow phished and stored from the vic...

Solana for Ethereum Devs: A Different World of Blockchains

Image
If you're an experienced Ethereum developer looking to explore other ecosystems, Solana is definitely worth checking out. While there are some high-level similarities - they're both Layer 1 smart contract platforms after all - when you peek under the hood, the differences become quite stark. Let's dive in and see how Solana compares to Ethereum in terms of architecture, execution, accounts, and more. A Radically Different Architecture First, a quick primer on how Ethereum works to set the stage. Ethereum relies on the tried-and-true proof-of-work (PoW) consensus mechanism, where miners compete to add blocks to the chain. Smart contracts are executed by the Ethereum Virtual Machine (EVM) in a sequential manner. Scaling is achieved through sharding and rollups. Solana takes a very different approach with its proof-of-history (PoH) consensus model combined with proof-of-stake (PoS). Miners are replaced by "validators" who stake their SOL tokens as collateral. Rath...

Solidity Gas Optimisation

Image
If you are familiar with a language like JavaScript, you tend to never think about how your variable is stored, except to deal with the scope of the variable. When you are making programs to run on a distributed system like a blockchain, you have to think about things a bit differently. Solidity works as a compiled language where each operation gets converted to a lower level opco which the EVM can understand an interpret. Every operation that you write on your program gets executed on every computer in the network, which is why every operation costs 'gas' to prevent spamming and infinite loops. In solidity, getting to know the machine readable operations and their associated cost literally saves you money. Gas optimization is a challenge that is unique to developing Ethereum smart contracts. To be successful, we need to learn how Solidity handles our variables and functions under the hood. Some of the techniques we cover will violate well known code patterns. Before opt...

Solidity Static Analysis

Image
A growing number of industries are using blockchain platforms to perform trustless computation using smart contracts. Applications ranging from financial services to supply chains, and from logistics to healthcare are being developed to rely on blockchain technologies. One of the most popular underlying technologies is the Ethereum smart contact, whitten in Solidity, which are then compiled to Ethereum Virtual Machine (EVM) assembly instructions for blockchain deployment. Often, or more likely usually, the deployed smart contract’s code is insecure: software vulnerabilities are regularly identified, and have been exploited by malicious actors, resulting in millions of dollars in damages and harm to the reputation of blockchain systems. While modern compilers, offer various APIs on top of which third-party analyzers can be built, the Solidity compiler fails to offer the same features. However, there are several tools that you can use, of which the today's article will tal...

Multi-sig Deployment

Image
What is multisig Multi-signature is a digital signature scheme, that allows a group of users to sign a single transaction. The transaction could be a governance proposal, a snapshot vote, or even a simple fund transfer instruction. A common terminology to describe a multisig setup is m-of-n multisig. Given n parties with their own private keys, at least m of the private keys must sign a transaction to perform a transaction. For example, a multisig that has 7 members in the group and requires 4 signatures for a transaction to be fully signed — will be termed 4-of-7 multisig. The need for a multisig administration Before we answer the question — why do we need multisig administration? — let us first understand how it supplements the deployment management. The smart contract that is being deployed onto the chain, holds logic - sometimes worth millions of dollars. Think about swapping contracts in the decentralized exchange managing all the business logic. And in order to deplo...

Kullback–Leibler divergence (KLD) and NFT Economics

Image
Ok, so you've launched your cool NFT game, that you'd been working on it for years. The platform is ready, the tokens are minted, the users are hyped and coming in droves. Sustainable scaling the product is not easy - I mean just listen to Tony Robbins . And while the token economics have be drafted in the whitepaper, the users would have to actually behave the similarly to what you'd invisioned. For instance, suppose you have an RPG , where user acquire experience and level up. In order to level up, they need to earn in-game artifacts, which can also be bought in the marketplace (where you charge transaction fees - here comes your business model). After having some thought you have drafted the approximate path of users' level progress and even ran Monte Carlo simulation to get some sence of possible distribution. Having finalised all the statistical models and simulations, you've come to the following conclusion - an average user will upgrade the free ban...