Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

John Newbery jnewbery

🐢
View GitHub Profile
@jnewbery
jnewbery / shared_ptr.cpp
Created Apr 18, 2020
Passing shared pointers
View shared_ptr.cpp
#include <iostream>
#include <memory>
struct Base
{
Base() { std::cout << " Base::Base()\n"; }
~Base() { std::cout << " Base::~Base()\n"; }
};
struct TraceByVal
@jnewbery
jnewbery / labitcoin_schnorr_notes.md
Last active Jul 8, 2020
Labitconf schnorr/taproot presentation links and notes
@jnewbery
jnewbery / wallet_dev.md
Last active Sep 22, 2020
Wallet development
View wallet_dev.md

Wallet development

What are a wallet’s functions?

  • Key management
    • Identify owned transactions
    • Generating new addresses
    • Determining how to sign transactions
  • Constructing and sending transactions
    • Parsing addresses and turning them into txOuts
@jnewbery
jnewbery / tx_relay_peer_prioritization.md
Last active Jul 17, 2019
P2P peer prioritization logic for tx relay
View tx_relay_peer_prioritization.md

Scenario

Bitcoin nodes relay txs to each other over the P2P network. If a node receives a valid tx from a peer, it adds it to the mempool and relays it to its other peers. If it receives an invalid tx from a peer, it must decide what action to take. We distinguish three cases:

  1. a transaction which is valid according to consensus rules, but invalid according to the node's policy rules.
  2. a transaction which is valid according to long-established consensus rules,
View git-br.py
#!/usr/bin/env python3
import subprocess
import os
if os.name == 'posix':
RED = "\033[1;31m"
BLUE = "\033[0;34m"
CYAN = "\033[0;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
You can’t perform that action at this time.