distributed-lab / distributed-lab/op_rand

SDK refactoring

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Noir
Stars
15
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Currently, the SDK exposes single methods for transactions building. These methods require many arguments, including cryptographic inputs (commitments, proofs), locktime, amounts, outpoints, etc.

To improve ergonomics, readability, and testability, we should enhance the SDK to use the Builder Pattern with a fluent interface, allowing method chaining like:

```rust
let builder = ChallengeTxBuilder::new()
.with_challenger_pubkey(...)
.with_challenge_amount(...)
.with_locktime(...)
...;

let psbt = builder.build_psbt(...)?;
```

Key points:

- Abstractions for commitment/proof generation should be introduced and reused.
- The builder should eventually support signing or serializing the PSBT.
- Internal logic for constructing transactions and proving commitments should be modular and reusable by other transaction types.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.