I'm in sri lanka & i'm looking forward to buy an iphone 5 from ebay?

I'm in sri lanka & i'm looking forward to buy an iphone 5 from ebay… So if i buy an Sprint or Verizon phone would I be able to use it in my country by unlockingit with an rsim…(and by the way what is bad esn… Can I unlock a bad esn phone to use in sri lanka)

ESN = Electronic Serial Number. It's the unique identifier assigned to each phone.

A bad ESN means that the phone has been reported lost or stolen and then blocked so that it can't be used on any network. The block can't be reversed without assigning a new ESN to the phone, and only the manufacturer or their official repair outlets can do that. In practice, it's not usually economical to assign a new ESN.

If a blocked phone is later recovered, then the insurer who paid out for the loss owns the phone or if no insurance claim was made, the phone belongs to the origin owner. So there's a legitimate and legal trade in phones with bad ESNs. But that trade in legal phones is hard to separate from the illegal trade in stolen phones which have never been recovered.

Because blocking a phone is not a universal worldwide process it may be possible to unlock the phone in other countries and then insert a local SIM and have a functioning phone. But companies like Sprint and Verizon also have overseas affiliates owned by the same parent companies and so a block on a phone may also disbar it from being used on all other affiliates of the same parent worldwide. The phone therefore might not work on many Sri Lankan networks unless you pay to have a new ESN assigned, and no legitimate provider will do that without proof that the phone has been legally acquired. There are illegal backstreet operators who will assign a new ESN, but you can't trust a criminal and will have a large risk of finding that the phone carries malware or spyware which will steal your data, and there's also a very large risk that the ESN may be cloned so that you end up paying for someone else's phone usage.

In summary, buying a phone with a bad ESN can get you a legitimate bargain, but there will be a risk of buying a useless phone or even one which the seller has no legal right to sell. You may also incur significant additional costs/risks if you have to get a new ESN assigned, on top of any unlocking costs. Putting it simply, it's a significant gamble which you could easily lose.