Skip to content

Radix coinjoin denominations notebook - #14

Open
yuval-block wants to merge 1 commit into
mainfrom
radix-coinjoin-notebook
Open

Radix coinjoin denominations notebook#14
yuval-block wants to merge 1 commit into
mainfrom
radix-coinjoin-notebook

Conversation

@yuval-block

Copy link
Copy Markdown
Collaborator

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

@bc1cindy bc1cindy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/:

Image Image

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."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the closing $ is missing $k>3$

@nothingmuch

Copy link
Copy Markdown
Contributor

skipped the mdbook-jupyter crate because it's 0.4-protocol only

what's 0.4-protocol? i tried searching and asking the bitcoin security team i mean chatgpt, but didn't get any convincing answer

and not in nixpkgs

fwiw that's pretty easy, see nixpkgs' buildRustPackage function

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.

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

wdyt?

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

@bc1cindy

bc1cindy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

what's 0.4-protocol?

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 sections to items in the book JSON, so buildRustPackage compiles it fine but the binary breaks at runtime. making it work would mean maintaining a ported fork of a crate with 2 releases, both from last november, and no activity since

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

@bc1cindy

bc1cindy commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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

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

@nothingmuch

Copy link
Copy Markdown
Contributor

what's 0.4-protocol?

...

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

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

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 bc1cindy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the render commit and also worked on one fixing some typos and another improving the style

this PR needs rebase

git fetch https://github.com/bc1cindy/fungi-docs.git radix-notebook
git cherry-pick cf417f5 da018bf 3dbda06

Image Image Image Image Image Image Image Image

is that what you had in mind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants