Skip to content

Conversation

@rustaceanrob
Copy link
Collaborator

@rustaceanrob rustaceanrob commented Jul 18, 2025

The rust-bitcoin type has a nice feature where the human-readable OP-codes are printed when using the Display version of ScriptBuf. Some users might find this interesting, as this is a feature of the almighty Sparrow wallet.

To see for yourself:

let mut output = String::new();
addr.fmt_asm(&mut output).unwrap();
println!("{output}");

Which should have an output similar to this for a fully built out example:

OP_0 OP_PUSHBYTES_20 1cd30fcc6cc9793c08a1105893c6d1e584a57e48

Changelog notice

  • Added Display for Script

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

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

Yep I use this all the time! Thanks for adding it here.

ACK 18046ac

@rustaceanrob rustaceanrob force-pushed the script-display-7-18 branch from 18046ac to ac6a72f Compare July 30, 2025 11:06
The `rust-bitcoin` type has a nice feature where the human-readable
OP-codes are printed when using the `Display` version of `ScriptBuf`.
Some users might find this interesting, as this is a feature of the
almighty Sparrow wallet.
@thunderbiscuit thunderbiscuit merged commit e4dd37f into bitcoindevkit:master Jul 30, 2025
23 checks passed
@rustaceanrob rustaceanrob deleted the script-display-7-18 branch July 30, 2025 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants