This is your good faith deposit which helps to show how committed you are to the purchase. The check will go to the attorney once a contract is signed and they will hold it in their escrow account until it needs to be dispersed. It will be credited towards your purchase price at closing. If you walk away for any reason before the due diligence period ends or if the seller breaches the contract then you will get this money back. The only way you will lose your earnest money deposit is if you breach the contract and walk away after that due diligence period ends. Everything else beside the due diligence fee earnest money deposit can be paid at closing, including inspections, appraisal, and other closing costs.