RGB-WG / rgb-core

RGB Core Library: consensus validation for private & scalable client-validated smart contracts on Bitcoin & Lightning
https://spec.rgb.tech
Apache License 2.0
207 stars 52 forks source link

Pedersen commitment improvements #182

Closed dr-orlovsky closed 11 months ago

dr-orlovsky commented 11 months ago

According to the suggestions by Adam Back and Blockstream team.

API changes are breaking, thus it can go only into v0.11

codecov[bot] commented 11 months ago

Codecov Report

Merging #182 (cf1de4a) into master (c0be2d9) will increase coverage by 3.6%. Report is 3 commits behind head on master. The diff coverage is 60.6%.

@@           Coverage Diff            @@
##           master    #182     +/-   ##
========================================
+ Coverage    12.5%   16.1%   +3.6%     
========================================
  Files          31      31             
  Lines        3188    3379    +191     
========================================
+ Hits          400     544    +144     
- Misses       2788    2835     +47     
Flag Coverage Δ
rust 16.1% <60.6%> (+3.6%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/contract/mod.rs 12.5% <ø> (ø)
src/stl.rs 100.0% <ø> (ø)
src/validation/status.rs 0.0% <ø> (ø)
src/validation/validator.rs 0.0% <0.0%> (ø)
src/validation/model.rs 0.0% <0.0%> (ø)
src/contract/fungible.rs 71.2% <89.3%> (+28.3%) :arrow_up:
src/vm/op_contract.rs 0.0% <0.0%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

dr-orlovsky commented 11 months ago

Oh wow... Different semantic IDs for the core RGB lib. Is this a pushback or a fast-forward?

Neither. It is a bugfix, meaning the existing way Pedersen commitments are done was non-standard and may contain inflation issues. I was seeking for Blockstream review of the way we use their API for Pedersen commitments and only now do we have it, thus we need this fix.

dr-orlovsky commented 11 months ago

It is not the only change which is needed - there are a bunch of other required PRs some of which are breaking. Also, we need to get RGB and std libraries updated and ensure that all PSBT methods create properly balanced Pedersen commitments and tapret commitments. Thus please no releases before that is accomplished.

dr-orlovsky commented 11 months ago

@zoedberg thank you for the good point with tests. I have committed your doc fixes, fixed different lints and resolved conflicts with master branch as well.