The thoughts you have are good ones, and you can certainly be creative in how you structure things. But just based on all the relevant considerations you highlight, you can see that this is certainly not a DIY project. You should make sure whatever terms you ultimately settle on are properly reduced to a written contract that covers every contingency and protects your rights. An experienced business attorney can assist with that. Good luck.
Answered on Dec 21st, 2015 at 12:09 PM