Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import bitarray
from hashlib import blake2b
# POW Constants
BASE_EDGE_BITS = 24
PROOFSIZE = 42;
# https://github.com/mimblewimble/grin/blob/cccaf984936d4792f8b6c39e6b500ad2e3f08817/core/src/pow/types.rs#L314
--------------------------------------------
- Format 2 NVMe SSD Drives
--------------------------------------------
NOTE: NVMe SSD Drives are Ephemeral! Data will
survive hard and soft reboots, but not stop/start
cycles via the AWS Console.
sudo fdisk -l|more
sudo fdisk /dev/nvme0n1
n
p
@xiaojay
xiaojay / notes-medalla.md
Created August 6, 2020 04:29
Notes on setting up Eth2 clients for Medalla testnet (Prysm / Lighthouse / Teku / Nimbus / Lodestar)

Notes on setting up Eth2 clients for Medalla testnet (Prysm / Lighthouse / Teku / Nimbus / Lodestar)

PLEASE NOTE:

  • Prysm, Lighthouse, and Teku are attesting and proposing correctly following this guide
  • Nimbus currently has a glitch that it syncs the beacon chain well but can't post any attestations. An issue has been created: #1443
  • Lodestar also has a glitch that the beacon client hangs up and won't sync the beacon chain
  • This guide will be updated once these issues have been resolved

Using the launchpad

@xiaojay
xiaojay / BLS_Signature.md
Created May 6, 2020 02:24
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

@xiaojay
xiaojay / BLS_Signature.md
Created May 6, 2020 02:24
BLS Signature for Busy People

BLS Signature for Busy People

Summary

  • BLS stands for

    • Barreto-Lynn-Scott: BLS12, a Pairing Friendly Elliptic Curve.
    • Boneh-Lynn-Shacham: A Signature Scheme.
  • Signature Aggregation

  • It is possible to verify n aggregate signatures on the same message with just 2 pairings instead of n+1.

@xiaojay
xiaojay / namebase.py
Created February 20, 2020 12:04 — forked from jat001/namebase.py
Sell HNS automatically
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from decimal import Decimal
from datetime import datetime
try:
import requests
import simplejson as json
@xiaojay
xiaojay / how-to-use-web3-with-react-native.md
Created April 23, 2018 14:53
This file describes how to set up the Ethereum JS API web3.js with the boilerplate Create React Native App

How to set up web3.js with CRNA

This is a simple guide to get you started with using the Ethereum Javascript API (web3.js) with the Create React Native App project. This is not an in-depth guide.

  1. Make sure you have Node version 6 or later installed, if not, get it on the Node website

    node --version

  2. Install Create React Native App

@xiaojay
xiaojay / how-to-use-web3-with-react-native.md
Created April 23, 2018 14:53
This file describes how to set up the Ethereum JS API web3.js with the boilerplate Create React Native App

How to set up web3.js with CRNA

This is a simple guide to get you started with using the Ethereum Javascript API (web3.js) with the Create React Native App project. This is not an in-depth guide.

  1. Make sure you have Node version 6 or later installed, if not, get it on the Node website

    node --version

  2. Install Create React Native App

@xiaojay
xiaojay / how-to-use-web3-with-react-native.md
Created April 23, 2018 14:53
This file describes how to set up the Ethereum JS API web3.js with the boilerplate Create React Native App

How to set up web3.js with CRNA

This is a simple guide to get you started with using the Ethereum Javascript API (web3.js) with the Create React Native App project. This is not an in-depth guide.

  1. Make sure you have Node version 6 or later installed, if not, get it on the Node website

    node --version

  2. Install Create React Native App

@xiaojay
xiaojay / Add dbSNP IDs to a VCF file
Created September 15, 2016 06:47 — forked from obenshaindw/Add dbSNP IDs to a VCF file
Add dbSNP IDs to a VCF file that doesn't have them.
#GATK Method <- Slower and keeps original ID plut dbSNP rsID
# R=Reference FASTA
# V=VCF file to add IDs to
# --dbsnp = dbsnp VCF -- download from NCBI FTP
java -jar GenomeAnalysisTK.jar -R /reference/Homo_sapiens_assembly19.fasta -T VariantAnnotator -V vcf_to_add_id_to.vcf --dbsnp /reference/dbsnp_137.b37.vcf.gz --out /data/Broad.chr1.annotated.vcf
#bcftools Method <- Faster, replaces existing ID with dbSNP rsID
/usr/bin/htslib/bcftools/bcftools annotate -a /reference/dbsnp_137.b37.vcf.gz -c ID vcf_to_add_id_to.vcf