Skip to content

Instantly share code, notes, and snippets.

View harding's full-sized avatar

David A. Harding harding

View GitHub Profile

A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.

Abstract

The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

#!/bin/bash -eu
# NO WARRANTY PROVIDED OR IMPLIED. USE AT YOUR OWN RISK.
###########
## Paths ##
###########
# This is the keypath provided in the Casa recovery email minus the "m"
KEYPATH="/49/0/0"
strategic_hr = 0.25
normal_hr = 0.005
normal_hr = 1 - strategic_hr
a = 1
b = 2
a_1 = 0.9
b_1 = 2.2
assert(a_1 < a)
@harding
harding / instructions.md
Last active February 5, 2024 20:28
Working With Multiple Repositories On GitHub

Working With Multiple Repositories On GitHub

Most projects on GitHub have a main repository that's the focal point of activity. For example, the Example organization has the Example.com repository:

https://github.com/example/example.com

Developers of Example.com typically call this the 'upstream' repository. We'll come back to it in a moment.

@harding
harding / joinpools.md
Created January 28, 2020 18:27
A description of joinpools elided from Optech Newsletter #48

*Bitcoin Optech [Newsletter #48][] described Jeremy Rubin's OP_CHECKOUTPUTSHASHVERY (COSHV) soft fork proposal. Originally, that content included descriptions of several advanced uses of COSHV, but that material was [removed][] shortly due to publication because of concerns that it was not adequately reviewed and so may have contained errors. Optech initially planned to obtain more reviews and publish the extra content the following week but, by then, the COSHV proposal was withdrawn in favor of a modified proposal with a new name, so the extra content went into limbo. The following section comes from that lost content; it has not been updated since the original COSHV proposal

#!/bin/bash -eu
## Year with the final blocks we want to check.
## Replace with "2024" for market
YEAR=2022
## Block to start scanning backwards from. Replace with "" (empty) to
## scan all blocks. Use "" (empty) for market
START_BLOCK="770000"
year_epoch=$( date -d "$YEAR-12-31" +%s )

Re: https://twitter.com/super_testnet/status/1725239338533810410

WARNING: this is a five-minute write up in response to a post I saw on X. I haven't thought about this carefully.

Problem: a mobile wallet spender pays a hold invoice that doesn't settle immediately. The spender goes offline. The payment eventually times out far downstream, with each forwarding node settling it offchain until it reaches the initial downstream node. So far, so good, but then the mobile spender is offline when its downstream peer tries to settle with

From a mailing list post I never sent.

The probability of a miner confirming a transaction is directly proportional to that miner's hashrate (ignoring propagation-related effects, including accidental or deliberate selfish mining).

Users who choose to send their unconfirmed transactions directly to miners will likely put more effort into contacting miners with large percentages of total network hashrate and less effort into contacting miners with small percentages of hashrate. For example, if Alice gives

@harding
harding / bitcoin-fediverse-best-practices.md
Created August 8, 2018 17:50
Suggestions for how to best get along with other Bitcoiners on the Fediverse (Mastodon/GNU Social/Pleroma/ActivityPub/Etc)

Price toots

Some people really don't want to hear about the price! But this is other people's favorite topic. If you adhear to the following two rules whenever talking about price, or something related to the price like altcoin prices, we should all be able to continue interacting about our common interests in Bitcoin:

  1. Use a Content Warning (the CW in the Mastodon user interface) to allow people to opt-into seeing your price-related information and images. Note that replies to CW-content are also automatically wrapped in the same CW.
@harding
harding / reporter-1-email-1.md
Last active January 2, 2023 19:45
Reply to journalists about BIP148 network disruption

Hi Dave, I found your name among those contributing to the Bitcoin code. Would you be willing to field a question or two about the significance of this potential Bitcoin network outage?

https://bitcoin.org/en/alert/2017-07-12-potential-split

I'm happy to answer questions by email, but please note that I can only speak for myself. I don't speak for the Bitcoin project, Bitcoin.org, or any other Bitcoin project, and nobody can speak for Bitcoin any more