Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChainHash type: best location #481

Closed
dr-orlovsky opened this issue Sep 14, 2020 · 3 comments · Fixed by #878
Closed

ChainHash type: best location #481

dr-orlovsky opened this issue Sep 14, 2020 · 3 comments · Fixed by #878
Milestone

Comments

@dr-orlovsky
Copy link
Collaborator

Lightning network has defined a ChainHash: a u32 number identifying network version, which is the hash of genesis block (https://github.com/lightningnetwork/lightning-rfc/blob/ffeece3dab1c52efdb9b53ae476539320fa44938/00-introduction.md#chain_hash)

However, now ChainHash is not anymore just a Lightning feature: it will be used in on-chain part of DLCs (https://github.com/discreetlogcontracts/dlcspecs/blob/master/Protocol.md#the-offer_dlc-message) and we plan to move to it in RGB. This type is useful, since it allows support of an open set of network; for instance it's quite simple to add support for Liquid w/o data structure modifications. I was planning to implement this type in LNP/BP library (library for L2/L3 applications), but taking the fact that rust-lightning uses this type, I think it worth putting it into rust-bitcoin.

Right now rust-bitcoin provide "Network" type; I propose to introduce this second type ChainHash as a part of util mod.

@apoelstra
Copy link
Member

Yeah this seems reasonable to me

@dr-orlovsky dr-orlovsky added this to the 0.29.0 milestone Jan 10, 2022
@tcharding
Copy link
Member

Is this still under discussion?

@dr-orlovsky
Copy link
Collaborator Author

@tcharding it seems that it just awaits implementation, and I simply forgot about it. Will do in the next week or so

Davidson-Souza pushed a commit to Davidson-Souza/rust-bitcoin that referenced this issue Jul 12, 2023
An internal function had a non-unsafe signature but could be called
with data that would cause it to exhibit UB. Move the unsafety inside
of the function so that the function signature now enforces soundness.

Fixes rust-bitcoin#481
Davidson-Souza pushed a commit to Davidson-Souza/rust-bitcoin that referenced this issue Jul 12, 2023
…n unsafe{} boundary

0f29348 move some unsafe code inside an unsafe{} boundary (Andrew Poelstra)

Pull request description:

  An internal function had a non-unsafe signature but could be called
  with data that would cause it to exhibit UB. Move the unsafety inside
  of the function so that the function signature now enforces soundness.

  Fixes rust-bitcoin#481

Top commit has no ACKs.

Tree-SHA512: b1ffc643aa11e9c8d0b7a32965a1504da14f6ac3f9e0aa175d2c09d7d7b6bf84e228f64e1f57800d75500e2c65066a4991f0070a3a1d0a19c1bd84ca0dd44363
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this issue Mar 23, 2024
…ted PR)

a358076 test: absolute/relative timelocks in satisfaction (Daniela Brozzoni)
cb9a769 tests: plan capabilities (Daniela Brozzoni)
d29c298 Add plan capabilities to miniscript (Alekos Filini)
fc20eb0 Fix test_cpp (sanket1729)
448fbd8 Add full_derivation_paths on DescriptorPublicKey (Daniela Brozzoni)
7ca9ba1 Add relative and absolute timelock in Satisfaction (Alekos Filini)

Pull request description:

  This PR builds on top of rust-bitcoin#481, fixing all the review comments.

  I didn't squash my last commits on purpose to make review easier, I can squash them before merging if preferred.

ACKs for top commit:
  apoelstra:
    ACK a358076
  sanket1729:
    ACK a358076

Tree-SHA512: 32e547eedaf56d7ddb9ab8069ab394b655f46f6eae7b971d521befc800abadb785335a84c977875b050bcb202517381aba0fb9d8f2d418cd59a1f87147491d67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants