distributed-lab / distributed-lab/op_rand
SDK refactoring
- 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.