If you are partnering with someone in purchasing a home you should always have a written partnership agreement. This would include how much each person will contribute, how expenses will be shared and how proceeds will be divided upon dissolution. It should also state how the partnership will be dissolved.
Partnering in the purchase of anything, but especially real estate, should not be taken lightly especially when you are providing the entire deposit. A real estate attorney should write the contract to make sure it is legally binding and reflects the agreement of the parties.