rust-bitcoin / rust-bitcoin/rust-bitcoin

We should store `WitnessProgram` in addresses rather than recreating it as an enum variant

Open
#3,012 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.7k
Forks
1k
Avg merge
4d 1h
Merged PRs (30d)
88

Description

          OT but why don't we store `WitnessProgram` here so that we could just call `ScriptBuf::new_witness_program`?

Originally posted by @Kixunil in https://github.com/rust-bitcoin/rust-bitcoin/pull/2955#discussion_r1673420329

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the address representation and the WitnessProgram type, then inspect ScriptBuf::new_witness_program and the discussion from pull request #2955. Determine where addresses currently recreate the enum variant and verify the refactor with the relevant address and script tests; done means addresses retain WitnessProgram and use the constructor consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.