What if someone commits a crime on a private boat in the middle of the Pacific Ocean? Who has jurisdiction? What legislative body writes these laws, who enforces them, and what court system do they go to? Where are the international jails? Is there an "international bar association?"

Is there a certain altitude that a countries jurisdiction stops? Does the United States have jurisdiction over all air space up to the thermosphere? What about crimes committed in outer space? Is there an extraterrestrial bar association? lol.