Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.8k stars 360 forks source link

GPL license of Zokrates standard library #1370

Open jswalens opened 4 months ago

jswalens commented 4 months ago

I have a question regarding the license of the ZoKrates standard library. Not sure if this is the right place to ask, feel free to direct me elsewhere. (I already asked on Gitter, but did not receive a reply.)

Abstract

The ZoKrates standard library is released under LGPLv3, like the rest of the compiler. Does that mean that, when any ZoKrates program that uses the stdlib is distributed, it needs to be open sourced? Is this intentional?

Details

If I understand correctly, the LGPL requires a program that includes an LGPL library to either:

  1. Supply the source or object code of the whole program in such a way that the library can be swapped with a modified version of the library.
  2. Use the LGPL library as a "shared library", e.g. using dynamic linking. (So that the library can be swapped with a modified version, without needing the source or object code of the whole program.)

(See Section 4 point d) of the LGPL, or https://softwareengineering.stackexchange.com/a/86158.)

If I compile a ZoKrates program to an executable, all dependencies are "statically linked" into the final executable, i.e. there's just one executable that contains the compiled version of both my code and the stdlib code. There's no way in ZoKrates to "separate out" the calls to the stdlib. So we cannot do option (2) in ZoKrates.

For option (1), I also cannot provide "object code", as there's no such notion in ZoKrates (I think)?

Hence, if I compile a ZoKrates program that uses the stdlib to an executable, and distribute the executable to anyone, I need to give them the whole source code of my program as well (if I understand the LGPL correctly).

My main question is: is this the intention? In my opinion, it would make more sense to put the standard library under a more permissive license. (This does not necessarily mean the whole project needs to be under that license.)

For comparison, Python is licensed under a specific license that allows use of the standard library without requiring source code to be released. The Rust language and its stdlib is dual-licensed under Apache-2.0 & MIT, Go & its stdlib is licensed under BSD 3-clause -- which also allow their std libs to be used without requiring source code to be released.

jswalens commented 1 month ago

Any updates on this? I'd like to release some code I've written (as part of a research paper) using Zokrates as open source, but my employer does not wish to release under the (L)GPL licenses. Thus, I'm currently blocked on this.

dark64 commented 1 month ago

Any updates on this? I'd like to release some code I've written (as part of a research paper) using Zokrates as open source, but my employer does not wish to release under the (L)GPL licenses. Thus, I'm currently blocked on this.

We are in the process of migrating everything to the MIT license, should be completed soon