Bitcoin tracing is a crazy idea I had back in 2019 and added to bitcoin in 2020[1]. nostr:npub1kyxqqqq8n2pu7f5pthr48zqcmr2k52vrud6wxzjpg0jsqcyhs3tshfc6vv took the idea and fleshed it out[2] so its now actually useable now!

The basic idea is that you add "tracepoints" into the codebase, which are like ports you can plug into to monitor data flowing through it in realtime (connections, mempool changes, etc)

You can then build external tools that plug into these ports for monitoring. This is ideal so you don't have to get bogged down in core PRs when you want to add monitoring features.

bitcointap is one of these monitoring tools that leverages tracepoints. it will simply plug in and print the data out in a developer-friendly way.

[1] https://github.com/bitcoin/bitcoin/pull/19866

[2] https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md

nostr:note1m2vvqryzprqrqv0thnyayawhjspalwnf5x3ufh0veq5s57t3dy0s8tv63c

Reply to this note

Please Login to reply.

Discussion

What's next? Adding Lua plugins? Could be funny to allow node runners to write their own spam filter, etc. with Lua scripts.

these taps can't affect logic, they can only monitor streams of data flowing through the node

Can the monitoring process call "bitcoin-cli setban"? 😅

I like that Will that when ur grinding its posted in real time for the nostrers 😄

Keep grinding and posting 🤙

How is this different / better than utilizing open telemetry for plugging in your own consumers later?

I’ve never used otel but this is what o3 says:

Reach for OpenTelemetry (OTel) instead of eBPF when the thing you care about is business‑level, portable, distributed observability—​not kernel‑level tracing sorcery.

If you need cross‑OS support, rich service traces with custom attributes, painless vendor hand‑off, or you’re in an environment where you simply can’t (or won’t) run privileged kernel programs, OTel is the right hammer. eBPF shines when you want zero‑instrumentation, ultra‑low‑overhead, Linux‑only deep dives into syscalls, network flows or security events. They’re complementary, but they solve very different problems.

Great idea!