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...