Where does tidal energy come from?

Though total potential energy of the system of solid earth + oceans + moon + sun would remain approximately constant the energy of one of these can increase at the expense of the other three. Thats how the tidal energy comes up. Tidal friction does contribute to the reduction of the total gravitational potential energy of the entire system. It also causes reduction in the rotation speed of the earth.


My question is, where does that energy come from exactly? More specifically, what potential energy source is getting depleted to do that work? Is the earth minutely slowing down in its spin - or are the orbits of earth and the moon subtly altered over time by the counteractive movement and friction of liquids and gasses?

In the case of the Earth's oceans and of the volcanoes of Io and Enceladus, the source of the energy is the planet's rotational kinetic energy rather than orbital energy. I wrote extensively about Io in this answer to the question When a planet is heated through gravitational pull, where is the energy taken from at this site. Unless there are objections, I'll let that answer stand with regard to explaining the source of the sulfur volcanoes on Io and the cryovolcanoes on Enceladus.

In the case of the Earth's oceans, the Earth's rotation rate (one revolution per day) is much faster than the Moon's orbital rate (once revolution per month). Friction, viscosity, the Coriolis effect, and the sizes and shapes of the ocean basins means that the tides raised by the Moon are simultaneously slowly slowing down the Earth's rotation rate and are slowly making the Moon recede from the Earth.

The slowing of the Earth's rotation rate and the Moon's orbital rate are written in rock (hardened clay, actually) in eclipses of the Moon and the Sun recorded by ancient Babylonian astronomers. For example, the path of totality of the total solar eclipse observed in Babylon on 15 April 136 BC would have passed over Algiers rather than Babylon if the Earth's rotation rate and the Moon's orbital rate were constant (stephenson).

The slowing of the Earth's rotation rate and of the Moon's orbital rate are even more clearly written in rock (quite literally) in the form of some fossils and tidal rythmites, sedimentary rock formations that have extremely ancient records of daily/monthly/yearly variations in the tides. The day was a couple of hours shorter than it is now 450 million years ago, shorter yet 900 million years ago (williams).


References:

R. Stephenson, "Historical eclipses and Earth's rotation", Astronomy & Geophysics 44:2 (2008): 22-27.

G. Williams, "Geological constraints on the Precambrian history of Earth's rotation and the Moon's orbit," Reviews of Geophysics 38.1 (2000): 37-59.


My question is, where does that energy come from exactly? More specifically, what potential energy source is getting depleted to do that work?

This in general depends on the frame of reference to which the definition of energy refers. The frame co-moving with the Earth-Moon center but free of rotation can be regarded as inertial. In this frame, the kinetic energy of the solid Earth decreases, as well as kinetic energy of the Moon. The gravitational potential energy of the system increases, as well as the internal energy of the Earth (swirling ocean and atmosphere). So in this view, the energy for the tides, waves and heating comes from the kinetic energies of both solid bodies.