Skip to content

Instantly share code, notes, and snippets.

View t4sk's full-sized avatar
🏠
Working from home

t4sk

🏠
Working from home
View GitHub Profile
@t4sk
t4sk / meaning-of-life.js
Created February 11, 2022 12:56
meaning of life
const Web3 = require("web3");
const assert = require("assert");
const web3 = new Web3();
const email = "email@email.com";
const COLORS = [
"red",
"blue",
"yellow",

Keybase proof

I hereby claim:

  • I am t4sk on github.
  • I am tsknk (https://keybase.io/tsknk) on keybase.
  • I have a public key ASDyZ1hblodO_TVvXYnHmPsWLpqRbYlgG6xzpy0Br_8m7Qo

To claim this, I am signing this object:

@t4sk
t4sk / Wei.sol
Created March 12, 2019 04:59
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.3+commit.10d17f24.js&optimize=false&gist=
pragma solidity ^0.5.3;
contract Wei {
uint public oneEther = 1 ether;
function test() public pure {
assert(1 ether == 1e18 wei);
assert(1 wei == 1);
}
}

Keybase proof

I hereby claim:

  • I am t4sk on github.
  • I am t4sk (https://keybase.io/t4sk) on keybase.
  • I have a public key ASBBLtnHpb6we3Je4w_ctTBa7p2XJXl0fDn2Yb9-fi04ggo

To claim this, I am signing this object:

@t4sk
t4sk / a-usage.md
Last active December 19, 2023 18:17
gen_tcp and GenServer example in Elixir (1.5.2)

gen_tcp and GenServer example in Elixir (1.5.2)

Usage

server.ex

Server.start
@t4sk
t4sk / import-priv-key.md
Last active January 19, 2017 13:49
How to import private key into bitcoin-qt

How to import private key into bitcoin-qt

1. Convert private key to WIF

Click here to covert private key to WIF

In this example

  • private key = 619c335025c7f4012e556c2a58b2506e30b8511b53ade95ea316fd8c3286feb9
  • WIF = 92KuV1Mtf9jTttTrw1yawobsa9uCZGbfpambH8H1Y7KfdDxxc4d
@t4sk
t4sk / wif.md
Last active July 7, 2024 00:23
How to convert private key to WIF

How to convert private key to WIF

0. Overview

WIF = base58check encode ([version byte][private key][checksum])

version byte = 80 for mainnet, ef for testnet and regtest

checksum = first 4 bytes of double SHA256 of private key
@t4sk
t4sk / address.md
Created January 13, 2017 23:50
How to create bitcoin address

How to create bitcoin address

0. Overview

Address = base58 encode ([version byte][public key hash][checksum])

version byte = 00 (for P2PKH on mainnet)

public key hash = RIPEMD160(SHA256(public key))
@t4sk
t4sk / script-p2pkh.md
Last active March 29, 2022 17:02
How to create scriptPubKey for P2PKH

How to create scriptPubKey for P2PKH

1. Get public key hash

Get the public key hash by computing OP_HASH160 of public key

In this example:

  • public key: 033e8c5dcb8e35670de496b57c1fa4366800ce3be5fded9b8800759881bc8da2e5
  • public key hash: 60d47ac02b129c08f94232ea506d1826424fe7be
@t4sk
t4sk / hash160.md
Last active July 1, 2024 00:35
How to compute OP_HASH160 of public key

How to compute OP_HASH160 of public key

OP_HASH160 of public key = RIPEMD160(SHA256(ECDSA_publicKey))

1. Generate address

> getnewaddress
mpLwhoaRWxfgdQAz8JnnH7NUuhS157DM61

2. Get public key