Skip to content

magnetto90/rareskills-blog-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Rareskills Blog Posts Index

When does learning become mastery? ๐Ÿ”—

When does learning become mastery? One cannot master all of blockchain in four months. Still, one can significantly master one blockchain.

Three reasons learning web3 programming will make you a better web2 developer ๐Ÿ”—

Three reasons learning web3 programming will make you a better web2 developer. Programming smart contracts forces us to think.

Is web3 a fad? 5 reasons blockchain is a real innovation. ๐Ÿ”—

Is web3 a fad? 5 reasons blockchain is a real innovation. Try setting up a new business bank account and sending an overseas wire transfer.

11 Reasons you should sign up for RareSkills bootcamp (as a developer) ๐Ÿ”—

11 Reasons you should sign up for RareSkills bootcamp (as a developer). Don't let the name "Bootcamp" fool you. We are not for beginners.

Learn Solidity: Easy to Learn, Hard to Master? ๐Ÿ”—

Is solidity hard to learn? Learning solidity as a language is arguably one of the easier languages to learn. However, learning the...

The blockchain shortage of developers is not real. ๐Ÿ”—

Itโ€™s hard to read news about developers and not get the impression there is a shortage of talent. Makes sense right? Companies wouldnโ€™t...

The fastest and most efficient way to learn Solana (for Solidity developers) ๐Ÿ”—

The fastest and most efficient way to learn Solana (for Solidity developers) First, Solana uses Rust, which is an unfamiliar language.

Blockchain - Top Web3 Job List ๐Ÿ”—

Blockchain - Top Web3 Job List. All industries have a tier list or implied ranking. Itโ€™s usually unspoken, but itโ€™s a real thing for job

Solidity vs Rust ๐Ÿ”—

A common misconception is that learning blockchain is about learning a new programming language. It isn't. Learning blockchain is far...

9 Biggest Gas Guzzlers in Solidity on Ethereum ๐Ÿ”—

9 Biggest Gas Guzzlers in Solidity on Ethereum. This article lists 9 of the most expensive Ethereum operations.

The Solidity Engineer Salary is a Myth ๐Ÿ”—

Don't study blockchain if you want a high salary. This might sound funny coming from a blockchain bootcamp, but itโ€™s true.

Solana Smart Contract Programming Language ๐Ÿ”—

Solana Smart Contract Language. Rust is a vast language. Our Rust Bootcamp and Solana Bootcamp is designed to focus on Rust first

Generate a random number with Solidity on the blockchain ๐Ÿ”—

Generate a random number with Solidity on the blockchain. Randomness is tricky on the blockchain because the blockchain is deterministic.

You donโ€™t need Solidity to work in web3 ๐Ÿ”—

You donโ€™t need Solidity to work in web3. Here is how you can work in Web3 with no solidity knowledge.

Solidity RSA signatures for aidrops and presales: Beating ECDSA and Merkle Trees in Gas Efficiency ๐Ÿ”—

Solidity RSA signatures for aidrops and presales: Beating ECDSA and Merkle Trees in Gas Efficiency. Airdrops, presale, whitelist, allowlist.

Leetcode problems and questions - the best 50 ๐Ÿ”—

Best 50 Leetcode problems and questions to start. Getting over the psychological barrier of starting. What problems should you begin with

Where to find solidity reentrancy attacks ๐Ÿ”—

Where to find solidity reentrancy attacks. Reentrancy only happens when your smart contract calls another smart contract via a function call

Zero knowledge programming languages ๐Ÿ”—

Zero knowledge programming language proofs demonstrate you executed a computation correctly without revealing the inputs to the computation

Web3 Careers Websites ๐Ÿ”—

Web3 Careers Websites . Trying to find a web3 career in an industry that has hundreds, if not thousands of web3 companies

Smart contract creation cost ๐Ÿ”—

Smart contract creation cost. The cost to deploy a smart contract has six components. It will always cost at least 53,000 gas.

Generate Ethereum Address from Private Key Python ๐Ÿ”—

Generate Ethereum Address from Private Key Python . Ethereum private key from python,the public key algorithm is secp256k1, same as bitcoin

Solidity Gasleft ๐Ÿ”—

Solidity Gasleft. The purpose of this article is to describe the behavior of the solidity gasleft() function and its uses.

Ethereum smart contract creation code ๐Ÿ”—

Ethereum smart contract creation code. This explains what happens at the bytecode level when an Ethereum smart contract is constructed

Foundry forge coverage ๐Ÿ”—

Foundry forge coverage. Visual line coverage report with LCOV. If you run "forge coverage" in a foundry project, you'll get a table as below

Mastering Solidity: Master the Computer Science Fundamentals First ๐Ÿ”—

I hate computer science! Mastering Solidity: Master the Computer Science Fundamentals First.why you should study and practice.

What makes blockchain immutable? ๐Ÿ”—

What makes blockchain immutable? This article is intended to be understandable by non-technical readers, to gain a technical understanding.

ERC4626 Interface Explained ๐Ÿ”—

ERC4626. How it works is you deposit one ERC20 token into the ERC4626 contract, letโ€™s call it token A, and get another ERC20 token back.

Why RareSkills does not have a job guarantee ๐Ÿ”—

Why RareSkills does not have a job guarantee. Because the word โ€œbootcampโ€ we ocassionally get asked if we have a job guarantee.

EIP-1167: Minimal Proxy Standard with Initialization (Clone pattern) ๐Ÿ”—

EIP-1167: Minimal Proxy Standard with Initialization (Clone pattern). clones delegate all calls to the implementation contract.

ERC20 Snapshot ๐Ÿ”—

ERC20 Snapshot. This provides a mechanism to defend against users transfering tokens and re-using token utility in the same transaction.

ERC20 Votes: ERC5805 and ERC6372 ๐Ÿ”—

ERC20 Votes: ERC5805 and ERC6372. Knowledge of ERC20 Snapshot is assumed, please refer to our article on ERC20 Snapshot for an introduction.

Governance Contract in Solidity ๐Ÿ”—

Governance Contract in Solidity.Before we start explaining the contracts, itโ€™s helpful to know technical terms of the governance contract.

EIP-3448 MetaProxy Standard: Minimal Proxy with support for immutable metadata ๐Ÿ”—

The minimal proxy standard allows us to parameterize the creation of the clone, but this requires an extra initialization transaction. It...

Convert gas to USD (Ethereum) ๐Ÿ”—

Convert gas to USD (Ethereum). Understanding gas cost can be tricky because there are three components at play: ether, and the units of gas

Verify Signature Solidity in Foundry ๐Ÿ”—

Verify Signature Solidity in Foundry. Here is a minimal (copy and paste) example of how to safely create and verify ECDSA signatures

EIP-150 and the 63/64 Rule for Gas ๐Ÿ”—

EIP-150 and the 63/64 Rule for Gas. EIP-150, or Ethereum Improvement Proposal 150, is a protocol upgrade for the Ethereum blockchain

EIP-2930 - Ethereum access list ๐Ÿ”—

EIP-2930 - Ethereum access list. An Ethereum access list transaction enables saving gas on cross-contract calls by declaring in advance.

Solidity Events ๐Ÿ”—

Solidity events. Solidity events are the closest thing to a โ€œprintโ€ or โ€œconsole.logโ€ statement in Ethereum. We will explain how they work

Uint256 max value ๐Ÿ”—

The uint256 max value can be obtained with the solidity code type(uint256).max; which is cleaner than writing the literal for 2^256 - 1.

Solidity test internal function ๐Ÿ”—

Solidity test internal function. To test an internal solidity function, create a child contract that inherits from the contract being tested

Openzeppelin Ownable: Use Ownable2Step Instead ๐Ÿ”—

Openzeppelin Ownable: Use Ownable2Step Instead. safer than Ownable for smart contracts because the owner cannot accidentally transfer.

Solidity Staticcall EIP 214 ๐Ÿ”—

Solidity Staticcall EIP 214. Staticcall is like a regular Ethereum call except that it reverts if a state change happens.

Foundry Unit Tests ๐Ÿ”—

Foundry Unit Tests. This article will describe how to create unit tests in Solidity using Foundry. We cover how to test all the transitions

Solidity Signed Integer ๐Ÿ”—

Solidity signed integers enable using negative numbers in a smart contract. This article documents how they are used at the EVM level

Solidity Mutation Testing ๐Ÿ”—

Solidity Mutation Testing. Testing is a method to check the quality of the test suite by intentionally introducing bugs into the code

Ethereum precompiled contracts ๐Ÿ”—

Ethereum precompiles behave like smart contracts built into the Ethereum protocol. The nine precompiles live in addresses 0x01 to 0x09.

A free solidity tutorial for experienced programmers ๐Ÿ”—

A free solidity tutorial for experienced programmers. RareSkills has released a free and comprehensive introduction to Solidity

Wagmi + ReactJS Example: Transfer Crypto and Mint an NFT ๐Ÿ”—

Wagmi + ReactJS Example: Transfer Crypto & Mint an NFT. This tutorial, we'll be learn how to build a Web 3 Dapp (Decentralized Application)

Invariant testing in foundry ๐Ÿ”—

Invariant testing in foundry. In this article, we will discuss invariants and how to perform an invariant test on solidity smart contracts

Smart Contract Security ๐Ÿ”—

Smart Contract Security. A mini course on smart contract security, providing a list of issues that recur in Solidity smart contracts.

Solidity Interview Questions ๐Ÿ”—

Over 140 interview questions for Ethereum Developers All of these questions can be answered in three sentences or less. Easy What is the...

Understanding smart contract metadata ๐Ÿ”—

When solidity generates the bytecode for the smart contract to be deployed, it appends metadata about the compilation at the end of the...

Web3.js Example. Latest version 4.x. Transfer, Mint and Query the Blockchain ๐Ÿ”—

The newest version of web3.js, 4.x, has just been unveiled. In this guide, weโ€™ll delve into integrating web3.js into HTML to Transfer,...

ZK-addition-dapp with Noir and Nextjs ๐Ÿ”—

We will demonstrate a step-by-step exploration of a basic zk-dapp designed for verifying additions. This application enables users to...

Getting a smart contract audit: what you need to know ๐Ÿ”—

A smart contract audit is a review by blockchain security experts to ensure that users will not lose funds due to a malfunction or...

How Tornado Cash Works (Line by Line for Devs) ๐Ÿ”—

Introduction to Tornado Cash Tornado cash is a cryptocurrency smart contract mixer that enables users to deposit crypto with one address...

An comprehensive overview of smart contract audit tools ๐Ÿ”—

Smart contract audit tools Smart contract audit tools are used to identify security vulnerabilities in smart contracts. These tools can...

Converting Algebraic Circuits to R1CS (Rank One Constraint System) ๐Ÿ”—

The goal of this article is to explain how to turn a set of polynomial constraints into rank one constraint system (r1cs). The focus of...

Bilinear Pairings in Python, Solidity, and the EVM ๐Ÿ”—

Sometimes also called bilinear mappings, bilinear parings allow us to take three numbers, a, b, and c, where ab = c, encrypt them to...

Why elliptic curve point addition in prime finite fields always lands on integers ๐Ÿ”—

One thing that seems incredibly remarkable about elliptic curve addition (in the context of cryptography), is that when a line is drawn...

Elementary Set Theory and Abstract Algebra for Programmers ๐Ÿ”—

Why another set theory tutorial? The target audience for this piece are the sort of folks who donโ€™t care about abstract math unless they...

Encrypted Polynomial Evaluation ๐Ÿ”—

Encrypted Exponentiation In our article about bilinear pairings, we explained how to do (partially) homomorphic encryption for...

Elementary Group Theory for Programmers ๐Ÿ”—

In our previous tutorial, we introduced set theory and made the journey from sets to defining a group in set-theoretic terms. Now itโ€™s...

Viem React Js Example: Transfer, Mint, and View Blockchain State ๐Ÿ”—

In this tutorial, weโ€™ll build a fully functional Dapp with the Viem typescript library + React (Next.js). Weโ€™ll cover the necessary steps...

Solidity Coding Standards ๐Ÿ”—

The purpose of this article is not to rehash the official Solidity Style Guide, which you should read. Rather, it is to document the...

Rings and Fields: A programmer's perspective ๐Ÿ”—

This article explains what a ring and a field are in abstract algebra. This builds off of our group theory article, so make sure youโ€™ve...

Connect Wagmi to localhost: testing dapps with Hardhat and Anvil ๐Ÿ”—

This brief tutorial demonstrates how you can use Wagmi + React to interact with your local Ethereum node, either through Anvil (Foundry)...

Quadratic Arithmetic Programs ๐Ÿ”—

A Quadratic Arithmetic Program (QAP) is a system of equations where the coefficients are monovariate polynomials and a valid solution...

Building a Zero Knowledge Proof from an R1CS ๐Ÿ”—

Given a circuit encoded as a rank 1 constraint system, it is possible to create a zk-proof of having a witness, albeit not a succinct...

Encrypted Evaluation of a Quadratic Arithmetic Program ๐Ÿ”—

We start with a quadratic arithmetic program which was derived from an Rank 1 Constraint System (R1CS) of the form Ls โŠ™ Rs = Os where...

Groth16 Explained ๐Ÿ”—

The groth16 algorithm enables a quadratic arithmetic program to be computed by a prover over elliptic curve points derived in a trusted...

Elliptic Curve Point Addition ๐Ÿ”—

This article describes how elliptic curve addition works over real numbers. Cryptography uses elliptic curves over finite fields, but...

The RareSkills Book of Solidity Gas Optimization: 80+ Tips ๐Ÿ”—

Gas optimization in Ethereum is re-writing Solidity code to accomplish the same business logic while consuming fewer gas units in the Ether

Ten beginner project ideas after you learn Solidity ๐Ÿ”—

Now that youโ€™ve completed our solidity tutorial, whatโ€™s next? You now have enough knowledge to build any of the following projects....

R1CS to Quadratic Arithmetic Program over a Finite Field in Python ๐Ÿ”—

To make the transformation from R1CS to QAP less abstract, letโ€™s use a real example. Letโ€™s say we are encoding out = xโด - 5yยฒxยฒ This will...

Elliptic Curves over Finite Field ๐Ÿ”—

What do elliptic curves in finite fields look like? Itโ€™s easy to visualize smooth elliptic curves, but what do elliptic curves over a...

Circom language tutorial with circomlib walkthrough ๐Ÿ”—

This tutorial introduces the Circom language and how to use it, along with common pitfalls. We will also explain a significant portion of...

What are Pedersen Commitments and How They Work ๐Ÿ”—

Pedersen commitments allow us to represent arbitrarily large vectors with a single elliptic curve point, while optionally hiding any...

How arithmetic circuits are used to verify zero knowledge proofs ๐Ÿ”—

Zk circuits form a set of constraints that if satisfied, prove a computation was carried out correctly. Zk circuits are sometimes called...

Breaking Down the Uniswap V2 Swap Function ๐Ÿ”—

Uniswap V2โ€™s swap function is cleverly designed, but many devs find its logic counterintuitive the first time they encounter it. This...

Uniswap V2 Mint and Burn Functions Explained ๐Ÿ”—

The lifecycle of Uniswap V2 is someone mints LP tokens (supplies liquidity, i.e. tokens to the pool) for the first time, then a second...

Checklist for building a Uniswap V2 clone ๐Ÿ”—

Itโ€™s very educational to rebuild Uniswap v2 from scratch using modern Solidity (or Huff if you really want to do it in hard mode). Here...

How the TWAP Oracle in Uniswap v2 Works ๐Ÿ”—

What exactly is โ€œpriceโ€ in Uniswap? Suppose we have 1 Ether and 2,000 USDC in a pool. This implies that the price of Ether is 2,000 USDC....

UniswapV2Library Code Walkthrough ๐Ÿ”—

UniswapV2Library The Uniswap V2 Library simplifies some interactions with pair contracts and is used heavily by the Router contracts. It...

Flash Loans and how to hack them: a walk through of ERC 3156 ๐Ÿ”—

Flash loans are loans between smart contracts that must be repaid in the same transaction. This article describes the ERC 3156 flash loan...

A comprehensive guide to the ERC721 standard and related security issues ๐Ÿ”—

ERC721 is the most widely used Ethereum standard for nonfungible tokens. It associates a unique number with an Ethereum address, thereby...

Top Smart Contract Audit Firms with Interesting Value Propositions ๐Ÿ”—

This list is not to say โ€œwhich auditing firm is better than othersโ€ but rather a compilation of firms with unusual and clever value...

Uniswap v2 router code walkthrough ๐Ÿ”—

The Router contracts provide a user-facing smart contract for safely minting and burning LP tokens (adding and removing liquidity) safely...

How Uniswap V2 computes the mintFee ๐Ÿ”—

Uniswap V2 was designed to collect 1/6th of the swap fees to the protocol. Since a swap fee is 0.3%, 1/6th of that is 0.05%, so 0.05% of...

Uniswap V2 Architecture: An Introduction to Automated Market Makers ๐Ÿ”—

Uniswap is a DeFi app that enables traders to swap one token for another in a trustless manner. It was one of the early automated market...

The staking algorithm of Sushiswap MasterChef and Synthetix ๐Ÿ”—

The MasterChef and Synthetix staking algorithms distribute a fixed reward pool among stakers according to their time-weighted...

The second preimage attack for Merkle Trees in Solidity ๐Ÿ”—

The second preimage attack in Merkle trees can happen when an intermediate node in a merkle tree is presented as a leaf. The name of this...

The interest rate model of AAVE V3 and Compound V2 ๐Ÿ”—

Interest rates in TradFi (traditional finance) are largely determined by central banks and influenced by market factors. In contrast,...

EIP 1967 Storage Slots for Proxies ๐Ÿ”—

EIP 1967 is a standard for where to store information that proxy contracts need to execute. Both the UUPS (Universal Upgradeable Proxy...

The Fallback Extension Pattern ๐Ÿ”—

The fallback-extension pattern is a simple way to circumvent the 24kb smart contract size limit. Suppose we have functions foo() and...

DeFi Lending: Liquidations and Collateral ๐Ÿ”—

In TradFi, when someone defaults on a loan, the creditor has the right to seize assets or garnish wages. In DeFi, when someone defaults...

The Architecture of the Compound V3 Smart Contract ๐Ÿ”—

Introduction and prerequisites Compound is one of the most significant lending protocols in DeFi, having inspired the design of nearly...

Compound V3 Interest Per Second ๐Ÿ”—

The Compoundย V3 protocol measures interest on the scale of seconds. The Compound V3 frontendย scales the number up to years for human...

DeFi Interest Rate Indexes: Principal value and Present Value in Compound V3 ๐Ÿ”—

The intuitive way to track lender deposits is to record the amount of USDC they deposited and the time they deposited. Compound V3 does...

cUSDC V3 (Compound V3) as a non-standard Rebasing Token, CometExt.sol ๐Ÿ”—

The Compound V3 contract behaves like a rebasing ERC 20 token. A rebasing token is a token which has an algorithmically adjusted supply...

Understanding Collateral, Liquidations, and Reserves in Compound V3 ๐Ÿ”—

In this chapter we will examine the following topics about Compound V3: collateral valuation absorbing insufficiently collateralized...

Bulkers in Compound V3 ๐Ÿ”—

The bulker contracts in Compound V3 are multicall-like contracts for batching several transactions. For example, if we wanted to supply...

How Compound V3 Allocates COMP Rewards ๐Ÿ”—

Compound issues rewards in COMP tokens to lenders and borrowers in proportion to their share of the a marketโ€™s lending and borrowing. The...

How Chainlink Price Feeds Work ๐Ÿ”—

Chainlink price oracles are smart contracts with public view functions that return the price of a particular asset denominated in USD....

Layer 2 Calldata Gas Optimization ๐Ÿ”—

When developing applications on an L2, the majority of gas costs come from calldata. Therefore, gas optimization for L2 emphasizes...

Solana Hello World (Installation and Troubleshooting) ๐Ÿ”—

This is a Solana hello world tutorial. We will walk you through the steps to install Solana and troubleshoot issues that may arise. If...

Arithmetic and Basic Types in Solana and Rust ๐Ÿ”—

Today we will learn how to create a Solana program that accomplishes the same things as the Solidity contract below. We will also learn...

Solana Anchor Program IDL ๐Ÿ”—

The IDL (Interface Definition Language) is a JSON file that describes how to interact with a Solana program. It is automatically...

Require, Revert, and Custom Errors in Solana ๐Ÿ”—

In Ethereum, we often see a require statement restricting the values a function argument can have. Consider the following example:...

Solana programs are upgradeable and do not have constructors ๐Ÿ”—

In this tutorial we will peek behind the scenes of anchor to see how a Solana program gets deployed. Letโ€™s look at the test file anchor...

Basic Rust for Solidity Developers ๐Ÿ”—

This tutorial goes over the most commonly used syntax in Solidity and demonstrates the equivalent in Rust. If you want a high level...

The unusual syntax of Rust ๐Ÿ”—

Readers coming from a Solidity or Javascript background may find Rustโ€™s usage and syntax of &, mut, <_>, unwrap(), and ? to be weird (or...

Rust function-like procedural Macros ๐Ÿ”—

This tutorial explains the distinction between functions and function like macros. For example, why does msg! have an exclamation point...

Rust Structs and Attribute-like and Custom Derive Macros ๐Ÿ”—

Attribute-like and custom derive macros in Rust are used to take a block of Rust code and modify it in some way at compile time, often to...

Visibility and "inheritance" in Rust and Solana ๐Ÿ”—

Today we will be learning how Solidityโ€™s function visibility and contract inheritance can be conceptualized in Solana. There are four...

The Solana clock and other "block" variables ๐Ÿ”—

Today we will cover the analogs of all the block variables from Solidity. Not all of them have 1-1 analogs. In Solidity, we have the...

Solana Sysvars Explained ๐Ÿ”—

In Solana, sysvars are read-only system accounts that give Solana programs access to the blockchain state as well as network information....

Solana logs, โ€œevents,โ€ and transaction history ๐Ÿ”—

Solana programs can emit events similar to how Ethereum emits events, though there are some differences we will discuss. Specifically,...

Tx.origin, msg.sender, and onlyOwner in Solana: identifying the caller ๐Ÿ”—

In Solidity, the msg.senderย is a global variable that represents the address that called or initiated a function call on a smart...

Introduction to Solana Compute Units and Transaction Fees ๐Ÿ”—

In Ethereum, the price of a transaction is computed as gasUsed ร— gasPrice. This tells us how much Ether will be spent to include the...

Initializing Accounts in Solana and Anchor ๐Ÿ”—

Up until this point, none of our tutorials have used โ€œstorage variablesโ€ or stored anything permanent. In Solidity and Ethereum, a more...

Zero Knowledge Addition ๐Ÿ”—

These code snippets are used for a talk at ETH Denver Zero knowledge addition example (not secure): fromย py_ecc.bn128 importย G1,...

Solana counter tutorial: reading and writing data to accounts ๐Ÿ”—

In our previous tutorial, we discussed how to initialize an account so that we could persist data in storage. This tutorial shows how to...

Read account data with Solana web3 js and Anchor ๐Ÿ”—

This tutorial shows how to read account data directly from the Solana web3 Javascript client so that a web app could read it on the...

Creating โ€œmappingsโ€ and โ€œnested mappingโ€ in Solana ๐Ÿ”—

In the previous tutorials, the seeds=[]ย parameter was always empty. If we put data into it, it behaves like a key or keys in a Solidity...

Cost of storage, maximum storage size, and account resizing in Solana ๐Ÿ”—

When allocating storage space, the payer must pay a certain number of SOL per byte allocated. Solana calls this the โ€œrentโ€. This name is...

Reading an account balance in Anchor: address(account).balance in Solana ๐Ÿ”—

Reading an account balance in Anchor Rust To read the Solana balance of an address inside a Solana program, use the following code:...

Function modifiers (view, pure, payable) and fallback functions in Solana: why they don't exist ๐Ÿ”—

Solana does not have fallback or receive functions A Solana transactionย must specify in advance the accounts it will modify or read as...