Why give up all of your equity ? As a founder you created something, shouldn't you insist on a buyout?
This would likely be moderately illegal if done at a stage that the equity is demonstrably worth something (e.g. Eduardo Saverin's FB situation) but I don't think it would be much of an civil/legal issue before the startup had any demonstrable financial value. I could be wrong. And people will diverge widely on how they see the moral/ethical implications of this.
After spending a year building the product I would hate to walk away.