Radix coinjoin denominations notebook - #14
Conversation
bc1cindy
left a comment
There was a problem hiding this comment.
notebook rendering in a single commit, ready to cherry-pick bc1cindy/docs@9b46eb0
skipped the mdbook-jupyter crate because it's 0.4-protocol only and not in nixpkgs, in favor of a small preprocessor in contrib/, same pattern as mermaid_ssr.py. .ipynb files listed in SUMMARY.md become chapters, rendered from saved outputs.
tested with the #14 notebook via nix build, the notebook needs to live under src/:
wdyt?
| "source": [ | ||
| "#### Gap sizes distribution\n", | ||
| "\n", | ||
| "The next two plots show the gaps in more detail, both their sizes and their sizes in relation to the next larger value. When decomposing into low Hamming weight values, the total balance being decomposed may fall in one of these gaps. The distribution of their sizes bounds the loss from the decomposition. Here too small integer values create visual artifacts, the empty bins for $k>3 are empty because the populated bins interspersing them correspond to successive integer values." |
There was a problem hiding this comment.
I think the closing $ is missing
what's 0.4-protocol? i tried searching and asking the bitcoin security team i mean chatgpt, but didn't get any convincing answer
fwiw that's pretty easy, see nixpkgs'
that sounds reasonable if the 0.4-protocol thing a fundamental issue so please help me understand that if not buildRustPackage might be cleaner than custom code that said i have no plans on changing the notebook and the only other thing that may justify a notebook is the anti sybil / randomization mechanism, and i think it'll be as vanilla as this one if it even happens
looks good, i'll try to figure out a clean way to spit out both dark and light plots instead of just light and hopefully it's easy to switch between them |
i meant the mdbook 0.4.x preprocessor interface, it's the same incompatibility #8 works around #8 (comment) nixpkgs 26.05 ships mdbook 0.5 but the preprocessor crates predate it. the others have upstream releases with 0.5 support we can build, mdbook-jupyter doesn't, it pins mdbook ^0.4 and 0.5 renamed fwiw i also read the converter before skipping it and it has its own problems, unescaped code fences, no ANSI stripping, writes assets mid-preprocess, so the contrib/ script isn't just a packaging workaround |
the preprocessor just embeds whatever outputs are saved, so it won't get in the way. you could save both variants and toggle them with css on mdbook's theme class, but the simplest fix might be transparent backgrounds with mid-tone colors so a single image works on both themes |
if you feel you have the time/energy it may be worthwhile to try to upstream bugfixes to mdbook-jupyter, but this all seems like a good rationale for substituting it at least for now
ack re first part, not sure if it's going to be simpler to generate two versions or a single transaparent version, i did make some assumptions about light bg for the plots themselves and i'm not sure how to use medium lightness colors instead. i'll see what one of the LLMs comes up with for those tweaks tomorrow i'm also going to tweak that a bit to hide the plot related code by default, that code doesn't contribute anything to the understanding |
bc1cindy
left a comment
There was a problem hiding this comment.
I updated the render commit and also worked on one fixing some typos and another improving the style
this PR needs rebase
- render bc1cindy/fungi-docs@cf417f5 - mdbook preprocessor that renders the notebook as a chapter with code cells hidden and tables paginated, moves it under src/.
- typos bc1cindy/fungi-docs@da018bf
- style bc1cindy/fungi-docs@3dbda06 - theme-neutral, colorblind-safe plots (transparent, medium-lightness), re-rendered outputs, same data.
git fetch https://github.com/bc1cindy/fungi-docs.git radix-notebook
git cherry-pick cf417f5 da018bf 3dbda06
is that what you had in mind?
This notebook justifies the choice of low hamming weight denominations in coinjoin transactions and is the theoretical basis for some related cost function terms
Just imported from https://colab.research.google.com/drive/1We_FvfX_Ob9BapFW3X_By9vTtxUrt3pm where it was authored originally