Skip to content

Instantly share code, notes, and snippets.

@arowser
arowser / threshold_ecdsa.md
Created November 11, 2019 10:04 — forked from Haseeb-Qureshi/threshold_ecdsa.md
Fast Multiparty Threshold ECDSA with Fast Trustless Setup @ CESC

Fast Multiparty Threshold ECDSA with Fast Trustless Setup

Steven Goldfeder

Digital signatures authorize transactions in cryptocurrencies

  • Alice's device, containing her private key, is a single point of failure

Multiparty authentication

  • Instead of having a single device store your key material...
    • You can split it into multiple devices
  • Designed your address as protected by multiple keys
@arowser
arowser / pr.md
Created July 1, 2018 03:20 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@arowser
arowser / test_vectors.md
Created March 6, 2018 01:00 — forked from kallewoof/test_vectors.md
Test vectors, Schnorr signatures

Schnorr signature test vectors

Test vector overview

  1. Hash function H(m) = SHA256(SHA256(m))
  2. Hash function H(m) = SHA256(m)

Basics

  • For a private key x, the public key is xG.
  • A signature on the message m with private key x is (R, s) where R=kG, s=k+H(R,X,m)x.
@arowser
arowser / lnhstest.py
Created January 31, 2018 07:50 — forked from AdamISZ/lnhstest.py
Simple BOLT 8 Lightning handshake in Python3
#!/usr/bin/env python
"""
This script implements a handshake with a remote Lightning
Network node; see BOLT8:
https://github.com/lightningnetwork/lightning-rfc/blob/master/08-transport.md
, which is the Noise-based transport protocol
for Lightning network nodes.
Specify server, port and remote node pubkey as three command line arguments;
here's an example invocation:
@arowser
arowser / readme.md
Created January 2, 2018 00:01 — forked from n1bor/readme.md
Bitcoin Chainstate Download

Chainstate only download - Proof of Concept

Introduction

The bitcoin blockchain is currently (9th Sept 2016) 88Gig but the Chainstate is only 1.7 Gig. That is a factor of 50 different. One concern for bitcoin at the moment is a lack of full nodes. This is partly due to the length of time to download and process the blockchain from scratch. And in addition a significant cost of hosting a full node is the cost of bandwidth for serving historical blocks - and a lot of this is to nodes that start downloading the blockchain and then abandon. A node can still operate as a full node with just a valid chainstate - there is little need for the full blockchain. From my tests only 30% of chains that start syncing get to completion.

Overview of proposal

  1. Every 100'th block nodes take a snapshot of the LevelDB chainstate database.
  2. They then calculate a hash of hashes of that 1.7gig database (takes about 2mins).
@arowser
arowser / convertSegwit.js
Created December 23, 2017 00:54 — forked from junderw/convertSegwit.js
Convert all your existing addresses from bitcoind to segwit P2SH addresses (multisig will not work)
'use strict';
// first, run sudo apt-get install jq nodejs npm
// second, run npm install bluebird co to install dependencies, and make sure bitcoin-cli can run these commands.
// third, run node thisScript.js and it will change all the addresses on your bitcoind into segwit addresses.
var Promise = require('bluebird');
var co = require('co');
var exec = Promise.promisify(require('child_process').exec);
var main = function() {
@arowser
arowser / _README.md
Created July 27, 2017 06:25 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
@arowser
arowser / build_cross_gcc
Created December 22, 2016 00:46 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@arowser
arowser / json_manipulator.sql
Created April 27, 2016 02:37 — forked from matheusoliveira/json_manipulator.sql
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@arowser
arowser / configure_measure.sh
Created December 2, 2015 07:54 — forked from laanwj/configure_measure.sh
Measure during compile process
./configure --disable-ccache --with-gui=qt5 --with-incompatible-bdb CC="$PWD/../devtools/mtime.sh gcc" CXX="$PWD/../devtools/mtime.sh g++" CPP="$PWD/../devtools/mtime.sh cpp"