Skip to content

Instantly share code, notes, and snippets.

View amiller's full-sized avatar

Andrew Miller amiller

View GitHub Profile
@amiller
amiller / Dockerfile
Last active September 20, 2023 18:12
hibe
FROM python:3.8.0-buster AS charm
# Get the Dockerfile from here
# https://raw.githubusercontent.com/sbellem/docker-charm-crypto/master/latest/python3.8/buster/Dockerfile
# docker build -f docker-charm-crypto/master/latest/python3.8/buster/Dockerfile -t charm .
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y --no-install-recommends \
bison \
flex \
@amiller
amiller / VeiledToken.sol
Created June 19, 2023 16:30
Off-chain linear scan ORAM token
Struct AddrBal = { address addr; uint balance };
enum RequestType = { TRANSFER; DEPOSIT; WITHDRAW };
Struct Request = { RequestType type, address from; address to; uint amt; bytes32 memo }
Struct Response = { uint seqNo, bool status, uint amt, string response };
contract {
// Key for encryption
bytes32 key;
// Checkpoint public state
@amiller
amiller / Auction-template.sol
Last active December 12, 2022 05:47 — forked from jcb82/ArbitrationTest.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=undefined&gist=
pragma solidity ^0.4.22;
import "gist/Timer.sol";
contract Auction {
address internal timerAddress;
address internal sellerAddress;
address internal winnerAddress;
// constructor
pragma solidity ^0.8.0;
// "SPDX-License-Identifier: UNLICENSED"
/*
Honey Object as an Oasis Sapphire contract
Could be used to demonstrate side channels
*/
#! python2.7
#
# tinybitcoinpeer.py
# A toy bitcoin node in Python. Connects to a random testnet
# node, shakes hands, reacts to pings, and asks for pongs.
# - Andrew Miller https://soc1024.com/
#
# Dependencies:
# - gevent
# - https://github.com/petertodd/python-bitcoinlib
@amiller
amiller / ObjExporter.rb
Created April 13, 2012 09:05
Sketchup OBJ Exporter (put in "%APPDATA%/Google Sketchup 8/Sketchup/Plugins" http://sketchuptips.blogspot.com/2009/01/wavefront-obj-exporter-with-materials.html
#-----------------------------------------------------------------------------
#
# WaveFront .Obj File Exporter for Google SketchUp
# Author: M van der Honing, mvdhoning@noeska.com
#
# Based on ZbylsXExporter by Zbigniew Skowron, zbychs@gmail.com
#
# I'd like to thank Jonathan Harris and Erwan de Cadoudal for their exporters.
# They helped me a lot.
#

If I hardforked: a doxxing of Satoshi Nakamoto

By Andrew Miller

If I hardforked would he mine it. Would he mine it if I forked it. 
Would he mine it would Satoshi would Satoshi would would he mine it. 
If Satoshi if I hardforked if I hardforked if Satoshi. 
Would he mine it if I forked it if I hardforked if Satoshi. 
Would he mine it if Satoshi if Satoshi if I softforked. 

If I hardforked if Satoshi if Satoshi if I softforked.

@amiller
amiller / gist:2232636
Created March 29, 2012 02:33
alternate bitcoin proof of work
"""
An alternate proof-of-work scheme for Bitcoin where competitive mining implies a
low marginal cost of "honesty." The new work has nothing to do with GPUs, but
instead requires random access to the 'tx_outputs' database, just as you would need
in order to thoroughly double check incoming transactions against history, i.e. to
be "honest" in the sense of the Satoshi paper [1]. May we lug Ascii Bernanke around
forever.
Parameters:
N: the total number of txoutputs, each of which can be spent at most once
"""
gmaxwell's proof-of-storage
https://bitcointalk.org/index.php?topic=310323.0
"""
import random
from bisect import bisect_left
H = lambda v: (hash(("1",v)), hash(("2",v)))
def setup(k, seed):