Skip to content

Instantly share code, notes, and snippets.

mhchia / attestation.txt
Created Mar 29, 2021
ZKOPRU trusted setup attestation
View attestation.txt
I contributed to the ZKOPRU Trusted Setup Multi-Party Ceremony.
The following are my contribution signatures:
Circuit: zk_transaction_1_2
Contributor # 136
Hash: 7cf4214d aa960bfc b496601f ddbae666
f6b1457e 06d36f67 4858b8b2 8eb24924
c119483c 78471897 140a6d4c 496aaf9a
8814ea2f f0a7f905 63d5d957 df82d2bb
mhchia /
Last active Jun 24, 2020
This script crawls the top-ranked ERC20 tokens' name and abbreviation from
This script crawls the top-ranked ERC20 tokens' name and abbreviation from .
from typing import Tuple, Union
import re
from bs4 import BeautifulSoup
import requests
mhchia /
Created Feb 3, 2020
`async_generator.asynccontextmanager` fails in Python 3.7-dev
import asyncio
from async_generator import asynccontextmanager
async def async_iterator():
yield 1
import random
from multiaddr.protocols import (
protocols = tuple(filter(lambda x: x.code != P_IP6ZONE, PROTOCOLS))
mhchia /
Created Mar 8, 2019
timeit benchmark for different implementation of the pipe-like stream reader writer
from io import BytesIO
class BytesIOReaderWriter:
_buf: BytesIO
def __init__(self):
self._buf = BytesIO()
def write(self, data):
mhchia /
Created Feb 24, 2019
Copy bindings code from py-libp2p-daemon-bindings to trinity, and modify import paths
# TODO: currently only support "bindings to trinity", probably need the reverse direction as well.
echo "Run this script with a new process spun up because of the usage of \`exit\`"
mhchia / test-proto-tracerstate.go
Last active Aug 10, 2018
To reproduce `proto: duplicate proto type registered: basictracer_go.wire.TracerState`
View test-proto-tracerstate.go
package main
import (
logging ""
appdash ""
appdashtracer ""
func main() {
remoteCollector := appdash.NewRemoteCollector("localhost:8701")
mhchia /
Last active Aug 4, 2017
I fail to use `RLPList` in viper in this case
from import tester as t
from ethereum import utils
import rlp
code = """
def test(a1: bytes <= 1000) -> num:
tempa = RLPList(a1, [num])
return tempa[0]