Skip to content

Instantly share code, notes, and snippets.

@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?
@lauris
lauris / markov.py
Last active February 6, 2018 15:21
Markov Chains
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
import string
import re
from collections import Counter
#!/usr/bin/env python
# pgp-words.py
# Copyright (C) 2015 Joe Ruether jrruethe@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#