Skip to main content

Module render

Module render 

Source
Expand description

Canonical Descriptor → BIP 388 @N-template renderer.

Walks an md1 Descriptor AST (Tag / Body / Node / UseSitePath, no rust-miniscript) and emits the keyless wallet-policy template string with @i placeholders — e.g. wsh(or_i(and_v(v:after(1000000),...),multi(3,@0/<0;1>/*,...))).

This is the single source of truth for the template rendering: the md CLI (md decode / md inspect) delegates here, and the mnemonic toolkit’s inspect renders the same template: line by calling descriptor_to_template — guaranteeing byte-identical output across both binaries.

Lifted verbatim from md-cli’s format/text.rs (the renderer previously lived only in the CLI). The structural-guard error type changed from the CLI’s CliError::TemplateParse to the dedicated RenderError so md_codec::Error stays a pure wire/decode taxonomy.

Enums§

RenderError
Error returned by the descriptor_to_template renderer.

Functions§

descriptor_to_template
Render a Descriptor back to a BIP 388 template string with @i placeholders.