rust-bitcoin / rust-bitcoin/rust-bitcoin
We should store `WitnessProgram` in addresses rather than recreating it as an enum variant
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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