SANS
GERARD
Spoken at 168Â events in 37 countries
Web3 is an internet
owned by users and builders
orchestrated with tokens.
– Chris Dixon
DAOs
NFTs
Decentralised Storage
Metaverse
Crypto
Blockchain
Smart Contracts
DeFi
Block N-1
Block N
Data
Hash
Block N-2
Coin
Consensus
PoW/PoS
Immutable Ledger
Wallet (Address)
P2P
Decentralised
Cryptography
SHA256
Hot Wallet
Cold Wallet
Social Recovery
Address
Private Key
Public Key
hash
hash
Sofia
0xA0
John Wick
0xF1
Mining
Transaction
Transaction
Verification
Signing
1 ETH
2 ETH
Sofia
0xA0
2 ETH
John Wick
0xF1
3 ETH
Sofia
0xA0
1 ETH
John Wick
0xF1
1 ETH
Pending
Confirmed
Miner
Miner
Miner
SPV
SPV
SPV
Full Node
Full Node
Full Node
Full Node
Full Node
Full Node
Block N-2
Block N-1
Block N
Block N-2
Block N-1
Block N
Block N-2
Block N-1
Block N
Block N-2
Block N-1
Block N
Block N-3
Block N-2
Block N-1
Block N
Year | 2009 | 2015 | 2017 | 2020 | 2020 |
---|---|---|---|---|---|
Consensus | PoW | PoW | PoS | PoS* | PoH |
Tps | 7 | 17 | 250 | 1K | 65K |
Tx finality | 30-60 min | 6min | 2 min | 30s | 1s |
Polkadot (DOT)
Solana (SOL)
Cardano (ADA)
Ethereum (ETH)
Bitcoin(BTC)
Externally Owned Account
Contract Account
ETH
Tokens
ERC-20
NFTs
ERC-721
Multi-token
ERC-1155
Client
HTML/CSS/JS/ether.js
MetaMask
Wallet Extension
Frontend
Ethereum
Mainnet
Ropsten
Kovan
localhost
Rinkeby
Deploy
Transactions
Contract
API calls
SOL
Smart Contracts
Deploy
Code
Compile
Test
pragma solidity >=0.4.16 <0.9.0;
contract HelloWorld {
string public message = "Hello World!";
}
pragma solidity ^0.8.10;
contract HelloWorld {
string message = "Hello world!";
function set(string memory _msg) public {
message = _msg;
}
function get() public view returns (string memory) {
return message;
}
}
pragma solidity ^0.8.10;
contract Example {
function globalVariables() {
address payable sender = msg.sender;
uint256 value = msg.value;
bytes data = msg.data;
}
}
uint256 mintReward = 1000;
uint mintReward = 1000;
address player = address(0);
string msg = unicode"🚀";
let mintReward = 1000;
let player = 0x0;
let msg = "🚀";
function mint(address to, uint256 amount) public {
_mint(to, amount);
}
function mint(to, amount) {
this._mint(to, amount);
}
uint256 x = 9999999999999999;
let fails = 9999999999999999; // 10,000,000,000,000,000
let works = 9999999999999999n; // 9,999,999,999,999,999
Gaming coins
Fixed Reserve Value
1x Helmet
5x GLD
Minumum cost
Minimum GLD cost per token (Logarithmic scale)
Max supply
GLD/Unit
Economy of scale
interface ERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address who) external view returns (uint);
function transfer(address to, uint value) external returns (bool);
function allowance(address owner, address spender) external view returns (uint);
function transferFrom(address from, address to, uint value) external returns (bool);
function approve(address spender, uint value) external returns (bool);
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract GLDToken is ERC20, Ownable {
constructor(uint256 initialSupply) ERC20("Gold", "GLD") {
_mint(msg.sender, initialSupply);
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
# Setup
> npm install @openzeppelin/contracts
> npx hardhat compile
> npx hardhat node
# Deploy
> npx hardhat run --network localhost deploy.js
# Stop
> npx hardhat clean
// scripts/deploy.js
const GLDToken = await ethers.getContractFactory("GLDToken");
// execute transaction
const token = await GLDToken.deploy('1000');
// wait for transaction to be part of the blockchain
await token.deployed();
// GLDToken.js
const token = await ethers.getContractAt("GLDToken", player);
await token.balanceOf(player);
// 10
await token.transfer(defenseOftheAncients2, 3);
await token.balanceOf(player);
// 7
Metamask
Wallet
Etherscan
Browser
OpenZeppelin
Smart Contracts
Remix
Smart Contracts
Decentralised Identity
Decentralised Apps
UX
Blockchain
Web3 Ecosystem
Decentralised Storage
Decentralised Computing