If you walk away from your home and it goes to foreclosure, the deficiency balance left over at the end of the sale representing the difference between what you owed and what the bank was able to sell it for and net will be the amount you'll be responsible for.
Some banks will just write it off and 1099 you for the forgiveness of debt. Other banks will sue for that deficiency. If they sue and get a judgement, then that will blow up your credit pretty much for as long as it stays there - which will be long AFTER the foreclosure hit itself is not longer weighing your score down.
Once a judgement shows up, the bank can try to garnish your state income tax returns until the debt is paid and they can try to get a court order to tap into whatever bank accounts you own. You'd never be able to keep your money in a bank but would have to instead squirrel it away in cash under a mattress.
Is that the way you want to live? If not, consider a short sale and consider getting in touch with an agent that has done many, many short sales and knows how to negotiated your deficiency amount so it doesn't follow you around through life.
This is a legal questions and would require a lot more information to answer properly. Let me ask you a question, why would you walk away from your mortgage and suffer the worst potential consequences instead of doing a short sale? In many cases a successful short sale can result in no further action against you, allow you to rebuild your credit and ability to get another mortgage faster and will allow you to live in the home while the process goes on.
Before you decide anything, spend a few minutes with an experience Real Estate Lawyer who can advise you impartially. There can be cases where a short sale may not be the best answer, but more often than not it is.