Can a company sell software I wrote for them if they never gave me a contract
<p>I was asked by companyA(UK) to rewrite their legacy application, which I have been doing for a year. CompanyA have made a deal to sell the application to CompanyB(USA). The deal will complete at some date in the near future. In the meantime, CompanyB have been bankrolling development (paying me).</p>

<ul>
<li>Neither companyA or CompanyB have given me me a contract or any letter of agreement. </li>
<li>I am a freelance developer. I work from home on my own    equipment,
to my own schedule.</li>
<li>I handle my own tax and I have one    other client.</li>
<li>CompanyA gives me broad direction (e.g. please write a    bookings
feature) I design the graphical user interface and    architecture,
and then implement the feature. As of now I have
completely replaced the front-end, most of the back-end, and have added
many features. </li>
<li>I invoice CompanyB monthly as a software consultant    and they have
paid on time.</li>
</ul>

<p>I'd like to know:
1. Do I own the copyright to the software I have written. And if so does CompanyA have any right to sell the product to CompanyB without me signing it over?
2. Should I register or take other action to protect what I consider to be my original work?
3. What rights do CompanyB have, given that they have been paying me?</p>

<p>Thank you</p>

<p><a href="https://law.stackexchange.com/a/9340/4501">This answer</a> to a related question sums up the relevant concepts regarding work for hire. Since, according to your description of your relationship to A, you are not an employee (<a href="https://supreme.justia.com/cases/federal/us/490/730/" rel="nofollow noreferrer">Commun. for Non-Violence (CCNV) v. Reid 490 U.S. 730</a>), and you do not a written agreement, under US law, this would not be a work for hire: thus you hold copyright to something. I presume Company A gave you the source code and you are rewriting it to fit some technical requirement, so you have been given permission by the copyright holder to create a derivative work. You do not gain copyright to the original code: you only hold copyright to what you wrote. You would therefore need the permission of the copyright holder (of the original program) to sell copies of the modified program (currently A, company B in the future once the transfer is complete).</p>

<p>There isn't a special "signing-over" ceremony for permission to copy, but the situation you describe is very messy. Even without a written agreement, you do understand that they intend to make multiple copies of the resulting program which includes your contribution, and you have received something of value in exchange for your contribution. So, one would argue, you have at least given permission to copy your stuff, even without a piece of signed paper -- in hiring you, you have given them an implied license to use what they paid you to create. The unclarity would be in whether you transferred your property rights, or simply licensed them to use it. Hence the recommendation to get an IP attorney.</p>

copyright software