▶ Hackathon project
§ Project file

Runtime BTC Knots policy changes

The permanent record for this hackathon project: write-up, links, team, tags, and prizes.
2nd Overal Bitcoin++ Pool Edition
Changes to BTC Knots policy (aside from certain configurable options) require a recompilation of the client source code. Addressing this grants us many benefits.
The write-up

Inspiration

Updating mempool transaction policy requires a full rebuild of the bitcoin client, which:

  • Presents a challenge to less technical users
  • Slows iteration time for testing/adjusting policy changes
  • Centralizes policy acceptance
  • Prevents sharing custom policies between users
  • Decreases visibility of policies currently in effect

By removing this rebuild limitation, we address these challenges (and potentially many more)!

What it does

  • During runtime, evaluates zero or more lua scripts when determining whether (or not) to accept a given transaction into the node's mempool

How we built it

  • Install bitcoinknots/bitcoin dependencies
  • Install lua
  • Add references to sol2
  • Evaluate script(s) within IsStandardTx (policy.cpp)

Challenges we ran into

  • Not familiar with project's build scripts -> lengthy time to get dependencies added and working
  • Had to work around issue with Clang_IndVarSimplify_Bug_SanityCheck

What's next for Runtime BTC Knots policy changes

  • Pass transaction details and configuration options to lua script
  • Add configuration to enable/disable this functionality
  • Curate collection of useful scripts for users to opt-in (by downloading & placing in the scripts directory)

Try it out