Skip to content

Instantly share code, notes, and snippets.

View tynes's full-sized avatar
👽
take me to your leader

Mark Tyneway tynes

👽
take me to your leader
View GitHub Profile
@braydonf
braydonf / reading-blocks-bcoin.js
Last active February 6, 2019 01:43
Read bitcoin blocks from disk with bcoin
// original: https://gist.github.com/braydonf/e9572bb40c084691fa20
'use strict';
const path = require('path');
const {Block, Network} = require('bcoin');
const fs = require('bfile');
const bufio = require('bufio');
(async function() {
@markblundeberg
markblundeberg / P2I.md
Last active June 1, 2019 15:20
"Pay To Identity" — a proposed use of OP_CHECKDATASIG

"Pay To Identity" — a proposed use of OP_CHECKDATASIG

Dr. Mark B. Lundeberg, 2018 September 6 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

A mechanism where a Bitcoin Cash payment is made to a personally identifying string (real name, email address, social media handle, etc.) instead of directly to a cryptographic key. The payment can only be claimed by the recipient if they generate a public key and get it certified by an identity verifier. This certification signature is confirmed in script via the new opcode OP_CHECKDATASIG.

Characteristics:

  • Pay anyone, right now -- recipient doesn't need to have any cryptographic keys nor do they even need a phone/computer. (They only need these to claim the funds later.)
@holmberd
holmberd / socks-proxy.md
Last active May 29, 2021 08:30
Configure remote SSH service and set up local SSH SOCKS proxy tunnel

REMOTE: Set up SSH service on the remote host

  • Skip if already set up, check with: sudo service ssh status
  • sudo apt-get install ssh
  • Edit ssh config file with the lines below: sudo vim /etc/ssh/sshd_config
PermitRootLogin no              #Disable direct login from root
AllowUsers user1 user2 user3    #*Only* allow this users to connect
AllowTcpForwarding yes          #Required to setup the tunnel, yes or commented out
PubkeyAuthentication yes        #Enables public key authentication
Port 22                         #Listening port of the server
@hrkrshnn
hrkrshnn / BribeContract.yul
Last active October 10, 2022 14:42
Run by `solc --strict-assembly --optimize --ir-optimized`. Context: https://twitter.com/NoahZinsmeister/status/1499845282598731782 Need to use Yul, since there is no `verbatim` in Solidity's inline assembly.
// UNTESTED!
object "BribeContract" {
code {
let size := datasize("BribeRuntime")
codecopy(0, dataoffset("BribeRuntime"), size)
return(0, size)
}
object "BribeRuntime" {
code {
// Bribe by sending ETH. To try and claim, send a tx without ETH. Assumes that a tx with


  BIP: 324
  Layer: Peer Services
  Title: Version 2 Peer-to-Peer Message Transport Protocol
  Author&#58; Jonas Schnelli <dev@jonasschnelli.ch>
          Dhruv Mehta <dhruvkaran@pm.me>
  Status&#58; Draft
  Type&#58; Standards Track
  Created&#58; 2019&#45;03&#45;08
  License&#58; PD

EIP-1559 transaction pool design improvement proposal

Author: Zsolt Felfoldi (zsfelfoldi@ethereum.org)

New difficulties introduced by EIP-1559

Transaction pools currently order transactions based on a single metric (gasPrice), fetching the highest elements when constructing a new block and discarding the lowest elements when the pool is full. With EIP-1559 transaction ordering becomes more difficult because the effective miner reward (MIN(tx.tip, tx.feeCap-headBlock.baseFee)) depends on the latest block's base fee. A new EIP-1559 compatible pool design suggested by this proposal and implemented in this pull request orders transactions primarily based on feeCap in the eviction queue while the current efferctive reward is used for block construction. This is a good first approach because inclusion chance correlates with feeCap on the low end. The only potential danger is that `feeCap

@denji
denji / unbound-osx-homebrew.md
Last active November 27, 2022 08:33
Install unbound DNS(SEC) resolver on OS X, on the basis of https://www.spatof.org/blog/unbound-dns-resolver-on-osx.html
To install unbound you can use homebrew
$ brew install unbound ldns
Now we can edit the configuration file of unbound which by default is located in /usr/local/etc/unbound/unbound.conf:
@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.