Say I have created a new (DSP) algorithm. Will I have some advantage if I open source the algorithm under copyleft licence (GPL etc.)? From what I know about licensing this should lock people out from using the exactly same code as closed source, but would they be able to "rewrite" the algorithm as closed source?

Note: I don't really know if the algorithm is new but it has not been released as open source yet. Since I am from the European Union do I need to look for software patents if I wanted to copyleft it?

  • 21
    I'm voting to close this question as off-topic because it is asking for legal advice. It can only be answered correctly by an IP lawyer for a specific jurisdiction.
    – user22815
    Jun 8, 2015 at 11:39
  • 1
    I recommend researching the history of black box reverse engineering. While it is not the same thing as what you are asking, there is a lot of interesting information about IP law, contracts, reverse engineering, patents, etc. that are relevant.
    – user22815
    Jun 8, 2015 at 11:40
  • 2
    @Snowman: as you can see here, meta.programmers.stackexchange.com/questions/1655/…, not every question concerning legal topics is generally off-topic. I guess, at least for essential parts of this question our community has some knowledge to share. Though I agree that for an in-depth answer one will probably need a lawyer.
    – Doc Brown
    Jun 8, 2015 at 14:21
  • 2
    This question was asked 8 hours ago and it already has 1880 views. This looks like a very popular and needed question. Glad somebody asked it. Jun 8, 2015 at 16:14
  • 2
    While this question may be popular and interesting, the "debatable" answers below illustrate exactly why these kinds of questions of legality are a poor fit for PSE and why they are off topic here.
    – Eric King
    Jun 8, 2015 at 17:56

5 Answers 5


The restrictions in copyleft licenses like the GPL apply to modified versions of your code as well as your original code. So they can't just tweak the whitespace or brace style and then delete your license statement.

However, you can't patent/copyright/copyleft/whatever an "algorithm" in its most abstract sense. You can put a license on your favorite implementation of quicksort, but you can't license quicksort itself. If someone reads your code just to learn the algorithm, and then rewrites the algorithm from scratch in their own way, that's fine.

As far as I know, there is no "advantage" to being the first one to publish an algorithm other than possibly some fame and (real-world) reputation if it's particularly noteworthy. Being the first to copyleft it definitely doesn't gain you anything, but the fact that someone copylefted it will be seen as a benefit to the free software community.

  • 27
    This answer contains some correct and some debatable information, so be careful. AFAIK, patents have been tried to be applied to much less substantial pieces of software, and they have been tried for abstract ideas, not just implementations. This depends very much on local law and is very different even in different states in Europe. Publishing a new algorithm as the first might create a case for "prior art" (en.wikipedia.org/wiki/Prior_art) when someone later tries to patent the same idea in a different implementation.
    – Doc Brown
    Jun 8, 2015 at 8:19
  • 10
    Oracle v Google was not about the implementation of Java; quite the opposite, it was about the API. I would be very reluctant to say that algorithms aren't patentable in general, especially in the US.
    – sapi
    Jun 8, 2015 at 10:37
  • 9
    Can't patent algorithms? Have we forgotten about the GIF and MP3 patents already?
    – nobody
    Jun 8, 2015 at 13:27
  • 2
    @Bakuriu: you missed the point. Both the GIF and MP3 patent holders sued other companies for using algorithms (or at least threatened to sue them), not because those other companies copied a specific implementation.
    – Doc Brown
    Jun 8, 2015 at 15:16
  • 4
    @AbhinavGauniyal: Patenting a way of doing something is perfectly normal. It's called a process/method patent. For example if you have a new way to make car bumpers you can patent it. Not car bumpers, the process of manufacturing car bumpers. Process patents is one of the cornerstones of software patents. But the idea of software patents clashes with another aspect of patent law: you can't patent mathematical formulas (at least in the US). And it can be argued that algorithms a part of pure maths we call "computer science".
    – slebetman
    Jun 8, 2015 at 20:05

If you want to prevent a patentable thing from being patented and then "closed off" from the greater community you could do a defensive disclosure. Cuis Smalltalk, for instance, did this with some new anti-aliasing techniques:

  • 3
    If you release something , de jure it can't be patented anymore because prior art exists. De facto, patent offices worldwide usually don't care enough to research this (because they won't get money for that) and allow pretty much all patents that don't look too fishy. If the patent holder then sues someone, the patent won't hold in court (if there is a court process. they cost a lot of money...)
    – Josef
    Jun 8, 2015 at 10:27
  • 2
    @Josef Not entirely true, most patent offices (certainly true in the US and EU) are first-to-file now, but this only matters for inventions that occur close together. If someone publishes (but does not patent) an algorithm, someone else could patent it the very next day and possibly get away with it. The specific legal issues surrounding this are complex, and one should definitely consult with an IP lawyer if trying to pull this off.
    – user22815
    Jun 8, 2015 at 11:36
  • @Snowman to avoid next-day patenting would it help to publish in encrypted form and then publish the key a few months later? Jun 9, 2015 at 0:15
  • 1
    @trichoplax I don't know to be honest. I try to stay up to date on these laws, but this is a recent change in the US where I live. If I were going to try to do this I would consult with an IP attorney who knows more. The way I understand it is there is a big gray area and someone who specializes in the law would need to guide me.
    – user22815
    Jun 9, 2015 at 0:18
  • Just to clarify, I intended my answer to specifically talk about ideas, algorithms, etc., because lots of people started talking about source code while the OP was asking about algorithms. If in doubt (and you should be), consult an IP lawyer. Jun 9, 2015 at 8:17

I see some valuable information in the other answers and the comments, but also some misinformation, so I try to give a summary and add some additional things.

Will I have some advantage if I open source the algorithm under copyleft licence (GPL etc.)?

By publishing the source code of an implementation of your algorithm under GPL (I assume that is what you meant), you get the advantage of demonstrating your algorithm works as intended, and everyone can inspect your source code to make sure it does not contain anything "unusual" like severe bugs or malware. Maybe you will get some contributors for further improvements. And since you are the copyright holder, you are still free to publish or sell your implementation to others under a different license.

A different question is if it brings you any advantage to be the first publishing that algorithm. By beeing the first you could try to prevent someone else to get a patent on that algorithm, since your implementation will serve as some kind of proof you are the inventor. But as @Snowman has correctly pointed out in a comment, due to the first-to-file (as opposed to first-to-invent) policy of many european patent regulations, that may actually not work.

From what I know about licensing this should lock people out from using the exactly same code as closed source, but would they be able to "rewrite" the algorithm as closed source?

You lock people from publishing your source code or modifications of it in closed source, not from using it inside a commercial organization. You lock people from publishing it as open or closed source under a different license than GPL. However, you do not lock people from publishing a new "clean-room" implementation of your algorithm under an arbitrary license, which is an implementation made only from your description of the algorithm, without actually looking into the source code.

Since I am from the European Union do I need to look for software patents if I wanted to copyleft it?

Though the laws of many european countries formally forbid patents on pure algorithms, lots of companies have circumvented those laws in the past by declaring specific algorithms as "computer-implemented inventions". AFAIK, European patent offices did not accept as many algorithmic patents as US patent offices in the past, nethertheless they have accepted thousands of patents over the years which can be interpreted as patents on algorithms. If those patents would actually hold in court is a different question, but someone who wants to find out will typically have to the put this on trial, with all related risks. Two of the most popular groups of examples were mentioned in the comments, the patents concerning GIF image compression and the patents concerning MP3 compression / decompression, see here for more examples.

So if you want to reduce the risk of getting sued, before publishing a software containing a specific algorithm, you should probably look if there is someone who is holding a patent on it, even in the EU.

  • Really good comprehensive answer. I just have some trouble with the last paragraph: How am I assumed to search for patents I might be infringing? I, for one, can't deduce from their title if they might apply to my code. Nor do I know of a comprehensive thematic index for them. Searching for keywords won't cut it, so even Google is useless, the wording could be completely unimaginable to me. And given the thousands of patents, I am unable to check them all. Afaik it's plain impossible to actually search for a patent I might be infringing, I can only wait and see if someone sues me :-( Jun 8, 2015 at 20:22
  • 1
    @cmaster: your best chance in Europe is probably the search engine of the european patent office, see epo.org/searching.html
    – Doc Brown
    Jun 8, 2015 at 20:48
  • 1
    @cmaster: you're supposed to spend millions on lawyers doing a patent review, by actually reading the patents. I understand this even works in big projects outside of software (imagine a new car), because they are developed in a more "waterfall" way and have fewer ideas. But of course, that's not practical for software, so big companies often just cross-license patents, and small ones can't protect themselves. Jun 9, 2015 at 8:36

You can't "copyleft" an algorithm. "Copyleft" relies upon copyright protection for its enforceability, but algorithms are not copyrightable, so you can't "copyleft" an algorithm. In other words, your question might be based on a faulty premise.

Copyright can only be used to protect a specific implementation, not the idea of the algorithm. So, you could protect a specific implementation of an algorithm using copyright-based licenses (such as a "copyleft" style license), but it would not prevent anyone else from building a different implementation of the same algorithm. Consequently, there is no way to "copyleft an algorithm".

In particular, the GPL license is built upon the foundation of copyright law. Copyright law says (roughly): no one can copy your copyrighted content without your permission. The GPL license says: I give permission to copy the copyrighted content (the code) under certain conditions (the conditions of the "copyleft" license). So, for things that are copyrightable, this allows bootstrapping the "copyleft" license upon existing copyright law. But, for things that are not copyrightable, this approach is useless. Copyright law only protects creative expression, not ideas. In particular, it doesn't protect algorithms.

Patent law is a different matter. In some jurisdictions, it might be possible to obtain a patent for an algorithm. This will depend heavily upon the legal jurisdiction and possibly on the specifics of your situation. Generally speaking, publishing your algorithm might help establish prior art that prevents others from patenting the algorithm, but the details of this are tricky, and best to consult a lawyer. In general, if you want solid advice on anything relating to algorithm patents, I suggest you contact an IP lawyer, as this is too broad to answer in general without knowledge of that information.

  • IMHO the question is not based on a "faulty premise", it is just not precisely worded. I am pretty sure the OP actually meant to open source an implementation of his algorithm.
    – Doc Brown
    Jun 8, 2015 at 19:28
  • 1
    @DocBrown: The OP is also interested in enforcing a License against any clean-room implementations of his algorithms (rewrite). So D.W. interpretation of the question is correct.
    – slebetman
    Jun 8, 2015 at 20:08

Copyleft doesn't have anything to do with copyright or patent protection. It doesn't provide any protection to you, the copyright holder, that you wouldn't otherwise already have.

It has everything to do with distribution, however. Copyleft protects users of your code by requiring you and anyone else who uses their code to distribute the entire source code of their collective work and any changes they make to it. It doesn't have anything to say about copyright or patent protections, other than to give your user certain specific rights that they might not otherwise have, such as the freedom to reverse-engineer DRM in GPL3.

Not the answer you're looking for? Browse other questions tagged or ask your own question.