# Ideal wire and resistance

I am having a bit of trouble understanding what an ideal wire is.

Let's assume there is a positive charge on the positive terminal of the battery and a negative on the other side which will give us the same results. Now electric potential is given as integral of E.dr. Therefore the potential will decrease with the distance .How is it possible that there is same potential across a wire. Electrons would not move if this was the case.

Also it is said that potential is dropped across a resistor and all the energy lost is made in heat energy,and that the battery provides this energy,now when an electron moves closer to a proton because of Coulomb attraction potential energy is also lost but no one has to provide it in this case? Also when it moves closer energy is lost and similar happens in a resistance although resistance provides an obstruction the energy lost in that should be different how can we equate these two and make them heat dissipation?Can someone answer these questions