rust-bitcoin / rust-bitcoin/rust-miniscript

Introducing `Older/After` Translation functionality

Open
#435 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
426
Forks
200
Avg merge
7d 17h
Merged PRs (30d)
8

Description

In the same way as #434

Up until now, we had support for key translation (and upcoming hash translations) which provide similar analysis guarantees as before. Doing the same for older/after does change things, and some of the miniscripts analysis we are able to do might not be possible. For example:- script_size requires us knowing the serialized length of the older/after time integer parameter.
Besides associating the Older type for a generic MiniscriptKey to u32, there are following possibilities we can try to offer:

  1. All the miniscripts are analyzable and we always keep the type Older -> u32 association.
  2. We introduce Analyzable trait, and use it to store the association as above for proper analysis. (More involving to implement, but gives us more flexibility working with generic miniscripts)
  3. We migrate the analysis requiring older/after parameter u32 to only support MiniscriptKey + ToPublicKey, but we might lose some flexibility here. (easier to implement)
    I'm confused here and would like to know others' view on the same.

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 reading issue #434 and the existing key and hash translation support referenced here. Resolve which of the three listed designs should govern Older/After translation and analysis, with completion defined by implementing the chosen approach while preserving the applicable Miniscript analysis guarantees.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.