Skip to content

Instantly share code, notes, and snippets.

View fjahr's full-sized avatar
🏠
Working from home

Fabian Jahr fjahr

🏠
Working from home
View GitHub Profile
@fjahr
fjahr / tests.md
Created December 31, 2019 13:06
Destination Group coin selection

This succeeds:

  • 50 outputs of 1 BTC in the same destination
  • Send 10.5 BTC
  • 2 groups are used for the inputs, in total there are 20 inputs
    def test_destination_groupings(self):
        '''
        If a destination has more than 10 outputs, exactly 10 outputs should
        be used when spending from that destination
        '''
@fjahr
fjahr / ibd.md
Last active January 21, 2020 18:44
IBD outputs filesizes for https://github.com/bitcoin/bitcoin/pull/17887

With --enable-debug

$ src/bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 220002,
  "headers": 613884,
  "bestblockhash": "00000000000000f8e6ea4282254b6cbc518a519ac7e1de83a8b7f413c16bc2c7",
  "difficulty": 3275464.586565617,
@fjahr
fjahr / load_all_comments_gh.js
Last active August 13, 2020 16:15
Load all the GH comments
function f() {
setTimeout( () => {
if(document.getElementsByClassName("ajax-pagination-btn").length){
Array.from(document.getElementsByClassName("ajax-pagination-btn")).forEach(l => l.click());
f();
} else {
console.log("Done");
}
}, 1000); // May need to adjust this depending on your internet connection and machine performance
}
@fjahr
fjahr / ffm_topics.md
Last active August 27, 2020 13:59
Bitcoin Socratic Seminar @ Bitcoin Week Frankfurt (27.08.2020)

Bitcoin Socratic Seminar in Frankfurt (27.08.2020)

Part of Bitcoin Week. For more information on Bitcoin Socratic Seminars in general, see https://bitdevs.org/ and https://bitdevs.berlin/.

Usually we talk about new topics of the last 4 weeks but since this group is not meeting regularly it will be more of a "best-of" of the last ~2 months. Also, feel free to bring your own topic if you feel something is missing (has to be in line with our general selection guidelines, no promotion of commercial services please). Ideally notify me before we start so I can make time for it or send me a message on twitter (@fjahr).

Security

@fjahr
fjahr / good_first_review.md
Created September 9, 2020 12:19
"Good first review" PR label

Good first review label

Goals

  • Make it easier for new contributors to start reviewing PRs

How?

  • Complexity level low, tentative small change
  • Detailed description of the PR background if needed
@fjahr
fjahr / rolling_utxo_set_hash.md
Last active April 30, 2021 17:00
Rolling UTXO Set Hash proposal

Rolling UTXO Set Hash proposal

TL;DR

I have picked up Pieter Wuille's proposal from 2017 to use a rolling hash for the UTXO set hash. It deals with the problem of a long computation time of the UTXO set hash which results in a slow RPC call gettxoutsetinfo (can take several minutes depending on hardware). I investigated three hash functions: MuHash, ECMH and LtHash and started implementing them in Bitcoin Core for comparison. However only MuHash has a rolling hash implementation

@fjahr
fjahr / application.html.erb
Last active October 4, 2021 10:35 — forked from suryart/application.html.erb
Displaying Rails 5 flash messages with Twitter Bootstrap 4 (last tested on Alpha-v6). Updated version of https://gist.github.com/suryart/7418454
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@fjahr
fjahr / debugging_workshop.md
Last active March 3, 2022 11:09
Debugging Bitcoin Core Workshop - Advancing Bitcoin 2020

Debugging Bitcoin Core Workshop

Short link: http://bit.ly/2H2rKjp

Goals of this workshop

  • Learn to use GDB/LLDB when you need it
  • Practice basic commands
  • Drills / Wax on, wax off.
  • We stay high level
@fjahr
fjahr / peer_ips.md
Last active January 28, 2023 13:40
Just a note for myself

Examples for getting a list of active peer IPs in the bitcoin network

From your own node

Get the list of IPs known to your node and save them to the file peers_ips.txt. Then count how many IPs are in the file.

$ src/bitcoin-cli getnodeaddresses 0 | jq -r '.[] | .address' > peer_ips.txt
$ wc -l peer_ips.txt
@fjahr
fjahr / bitcoin_v25_asmap.md
Last active February 7, 2023 13:44
Theoretical v25.0 deployment with ASMap