Skip to content

Instantly share code, notes, and snippets.

View benzmuircroft's full-sized avatar

Benz Muircroft benzmuircroft

View GitHub Profile
@gavinandresen
gavinandresen / SmartFee Design.md
Last active May 4, 2022 07:51
Smart fee design

The reference implementation of Bitcoin (bitcoind/Bitcoin-Qt) has ad-hoc code for dealing with transaction priorities and fees. In particular, there are several 'magic' constants that are chosen by the core developers, setting policies for minimum transaction fees, minimum transaction priorities and minimum output sizes.

This document describes the algorithms used by my 'smartfee' branch to replace most of those arbitrary constants with values that will rise and fall based on transaction volume and miners' willingness to include transactions in their blocks.

Fee/Priority estimation

The reference implementation needs to know two things to provide a good user experience:

  1. If a transaction has priority X, is it likely to be included in the next N blocks?
  2. If a transaction has a fee of Y, is it likely to be included in the next N blocks?