bitcoindevkit / bdk

A modern, lightweight, descriptor-based wallet library written in Rust!
Other
864 stars 311 forks source link

Upsteam code to rust-bitcoin #586

Closed tcharding closed 2 years ago

tcharding commented 2 years ago

Hi,

In bdk there is some nice code for signing PSBTs, I'd like to upstream it to rust-bitcoin so others can use it (actually, so I can use it while writing PSBT tests/examples).

I've started this work already but I wanted to explicitly check in with you guys. There are three questions I'd like to answer please

  1. Do you guys mind me doing this?
  2. What sort of attribution would you like, is a comment in the rust-bitcoin source code ok?
  3. Is it ok to re-license the code under the CC0 license [0] or do you want to retain the Apache license?

The specific code I'm referring to is the sighash() implementations for Legacy [1] and Segwitv0 [2]

Thanks a bunch!

LLFourn commented 2 years ago

Hi @tcharding,

I personally don't care about attribution but as I said in the thread I think you should copy paste the stuff from rust-miniscript anyway which doesn't have this problem.

tcharding commented 2 years ago

Ha! That's what I've been working on this morning, I was going to get it ready before posting here but anyways. I'll close this. Thanks

afilini commented 2 years ago

Is it ok to re-license the code under the CC0 license [0] or do you want to retain the Apache license?

I'll just answer here in case you find something useful in the future: I don't know how licensing works exactly, but if the decision can be up to just one of the maintainer (without involving the individual contributors) I would be ok with this!

I think it's a win-win for us if our code gets upstreamed, it means that we have to maintain fewer lines of code and the lines that get moved will be re-reviewed by a bunch of experienced devs, which doesn't hurt.

I think adding a comment in the code plus mentioning it in the PR would be a good way to attribute the original implementation of that code to us.

Necessary disclaimer:

I'm not assuming any malice from you or the rust-bitcoin org, but just in case other projects come here and try to copy our code, I should mention:

TheBlueMatt commented 2 years ago

but if the decision can be up to just one of the maintainer (without involving the individual contributors) I would be ok with this!

IANAL, but my understanding is no, it cannot be, it needs to come from the author unless the author has some additional agreement with the maintainer (like a CLA - this is the primary reason for CLAs)

tcharding commented 2 years ago

I think it's a win-win for us if our code gets upstreamed, it means that we have to maintain fewer lines of code

This sums it up :)

I believe @TheBlueMatt is correct though, it sure would be easier if there was only one free software license.

tcharding commented 2 years ago

Thanks for the write up @afilini.

notmandatory commented 1 year ago

For a little more context on the differences between MIT, Apache 1.0 and CC0 below.

https://choosealicense.com/licenses/mit/ https://choosealicense.com/licenses/apache-2.0/ https://choosealicense.com/licenses/cc0-1.0/