Short Answer
Barring facts discussed below which aren't assumed to be present in the question, a barter of goods in international waters between people from different countries is legal.
But, lurking in this question appears to be one or more misperceptions about the legal consequences of this transaction. The question seems to assume that there are tax or other legal benefits to conducting the transaction in this way that usually aren't present.
There are basically no differences in the legality of a barter v. a cash sale for any purposes.
Conducting the deal in international waters could have tax consequences, but the fact that the deal is conducted in international waters only sometimes results in tax reductions. This is not a major tax loophole.
Conducting the deal in international waters could have an impact on which regulatory laws apply to the deal, but rarely prevent the deal from being subject to any country's regulatory laws.
This is all subject to the caveat at the bottom of this answer. The caveat explains that there are indeed lots of major legal loopholes in international commerce. But private barters of goods in international waters rarely benefit from any of these major legal loopholes.
Long Answer
Barter v. Cash Transactions Very Rarely Matter
For Tax Purposes
A barter transaction is not tax free. In U.S. tax law, for example, a barter transaction is treated as though the goods that you part with were sold by you for cash at fair market value, with the cash then used to purchase the goods received.
In general, there is no tax benefit achieved from bartering under U.S. income tax laws and there is a duty to report significant barter transactions (i.e. those in which the things parted with in any one year with the same person have a fair market value of $600 or more per year) on a Form 1099.
U.S. federal income tax law has some narrow exceptions excluding certain barters from income taxation. The most common of these, however, is limited to barters of investment real estate located in the United States. Other exceptions apply mostly to basically fungible financial assets (like barters of economically identical shares of stock in the same company, or of economically equivalent life insurance policies).
The fact that the transaction is a barter rather than two reciprocal cash sales is irrelevant for all tax purposes in most countries. This isn't only relevant for income tax purposes. If a transaction would otherwise be subject to sales taxes or to a value added tax, the fact that it is structured as a barter transaction only rarely provides any sales tax or VAT benefit.
Bartering may increase the tax compliance costs involved, however, and undermines the certainty of the legal tax treatment of the deal, because usually, if there is a barter transaction, there will also have to be a professional third-party appraisal done to determine the fair market value of the goods bartered for tax purposes that will be subject to litigation with tax authorities.
For Customs Duties And Import Regulations
Similarly, a barter transaction does not change the treatment of the transaction for purposes of customs duties or for purposes of import regulations.
Some customs duties are imposed "in kind" based upon the volume or weight or number of items subject to the duty (e.g. per liter of alcohol imported). But other customs duties are imposed based upon the dollar value of the goods imported posing the same practical difficulties of having to appraise the value of the goods exchanged to determine the proper customs duty. This could lead to major delays in importing the goods because often the valuation dispute would have to be resolved before the goods would be allowed to clear customs.
Also, many non-customs duties regulations of imports require someone bringing goods into a country (even if they are citizen of that country) to document the source of those goods. In ability to do so due to a lack of documentation in a barter transaction conducted in international waters could also make it difficult to get the goods to clear customs.
In cases where goods are brought in without formally passing through a customs station, for example, if an American docks his ship directly at his residence on a coast rather than at a port, the goods could be seized, either in national waters once they are entered by the Coast Guard after an intent not to declare the goods becomes evident, or from the place in the country where the goods are unloaded, and held in some sort of storage until the customs process is completed and the good clear customs.
In the U.S., if the good has reached American soil, Immigration and Customs Enforcement (ICE) agents from the U.S. Department of Homeland Security would seize the goods.
If the goods were still on a boat, the U.S. Coast Guard would be responsible for handling it. Historically, the U.S. Coast Guard was formed as an enforcement agency for customs duties and import regulations at a time when almost all international trade with the U.S. was conducted by sea and customs duties were the primary source of federal tax revenues.
For Regulatory Purposes
A transaction which is illegal if conducted for cash is also illegal if conducted by barter, and a transaction which is legal if conducted for cash is also legal if conducted by barter. It also doesn't change whose law and which legal forums govern legal disputes between the parties.
Currency Regulations
A tiny number of countries, possibly including Venezuela which has had such regulations at some points in the history of that country, but may or may not now, and Russia (in response to international sanctions related to the Ukraine War) impose some restrictions on the use of domestic and/or foreign currency in international commercial transactions.
A barter would get around the currency restrictions in those countries (although not necessarily other regulations of those countries on foreign trade).
But none of the other countries expressly mentioned in the question or in this answer impose limitations on the use of any kind of currency in international commercial transactions.
Legality
To the extent that no illegal technology transfers or international trade sanctions are violated, it is legal to conduct this barter or sale, although it has legal consequences even if it is legal.
But, an American or an American firm or anyone else who purchased technology transfer restricted goods from a seller in the U.S. can't go into international waters to trade barred microchips to China in exchange for shipping containers full of fast fashion, because this would violate U.S. technology export laws.
Similarly, one can't trade American beef for Russian oil, because this would violate laws that the U.S. has imposed as a diplomatic sanction against Russia.
One of the most circumstances where this is most likely to come up is in a transaction between someone from Cuba and someone from the U.S. due to U.S. embargoes of trade with Cuba. I don't know the specifics of that law well enough to know whether or not, or under what circumstances, the contemplated transaction would be legal. But I strongly suspect that selling Cuban sourced goods directly to an American would violate U.S. sanctions laws against Cuba.
Income Taxation
U.S. Federal Income Taxation
The fact that the transaction takes place in international waters is irrelevant for the income taxation of U.S. citizens and U.S. residents who are taxed on their worldwide income.
U.S. income taxes generally don't apply to people who are neither citizens nor residents of the U.S. who engage in commerce or earn income outside the U.S.
For Other Income Taxes
While doing the transaction in international waters doesn't change the federal income tax treatment of the transaction for a U.S. citizen or U.S. resident, it could impact which U.S. state, if any, is entitled to impose its income tax on the sale and could impact whether the sale is subject to national income taxes in some countries.
Normally, sale income tax is due on income earned in a state and income earned by people who reside in the state which is not earned in another U.S. state, although the details are tricky and are not always 100% consistent between U.S. states and localities that impose income taxes.
Sale Taxes, Use Taxes And VAT In International Waters Transactions
For U.S. Style Sales And Use Taxes
In the U.S., state and local sales taxes are usually imposed only upon retail sales of goods to final customer that take place in the state or locality in question. Wholesale purchases of goods (i.e. purchases of goods for resale to third-party customers) are sales tax free in most U.S. states, as are purchases of goods by non-profit entities and governments.
So, a sale in international waters avoids A sale in international waters also probably avoids all state and local sales taxes in the U.S. on the goods.
But, most U.S. state and local sales taxes are backstopped by what is called a "use tax" on retail purchasers who are not non-profit entities or governments, who buy something in a place other than the place where they live and then bring that thing home to their residence in which there is a sales and use tax.
So, for example, suppose that you buy office supplies (not for resale) for your accounting firm someplace in Alaska where you take delivery of the goods that doesn't have a sale tax, and bring it back to your office in Denver where there is an 8% sales and use tax, to use in your business. Neither you nor the seller in Alaska owe any sales tax in Alaska or Colorado, but your accounting firm owes an 8% use tax on the good you brought back from Alaska to use in Denver, Colorado which is imposed on you but not on the Alaskan seller.
Use taxes are typically not really rigorously enforced, but are imposed when government sales and use tax collection agencies become aware of systemic and economically significant failures to pay a use tax obligation.
For VAT
No U.S. jurisdiction has a true value added tax (VAT) but most countries in the world do have a VAT.
A Value-Added Tax (VAT) is a consumption tax assessed on the value added in each production stage of a good or service. Every business along the value chain receives a tax credit for the VAT already paid. The end consumer does not, making it a tax on final consumption.
No VAT would typically be paid on a purchase of goods in international waters. But if the goods purchased in international waters are purchased for resale, the seller would not receive any credit for VAT paid on the inventory purchased, so effectively this increases the VAT that the reseller of the goods purchased in international waters will bear when the goods are sold.
This benefits the seller of the goods in international waters, except that the price in international waters would usually be discounted in order to shift the incidence of the higher VAT that the buyer will eventually pay economically back to the seller.
Not paying a VAT does benefit a final retail consumer purchaser of the goods purchased in international waters, however, unless there is a customs duty owed on the goods when they are brought back into the country. Often, however, countries with a VAT impose a customs duty on imported goods not imported for resale equal to the VAT that would have been imposed if the goods had been sold in the country into which they are imported.
The inconvenience of going to international waters to buy things and the possibility of a customs duty on good returned to the retail buyer's domicile, however, makes this loophole a modest one.
Customs Duties And Regulations
Whether or not you pass through a regularly staffed port of entry in an airport or seaport, you usually have a legal duty to declare and pay any applicable customs duties on anything brought into the country, even if you are a citizen of that country.
In the U.S., the law states that items not declared are subject to civil forfeiture, although there is case law under the excessive fines clause of the U.S. constitution that provides that civil forfeiture can sometimes amount to an unconstitutionally severe fine for a mere technical non-reporting violation.
Often customs duties are paid by someone who buys something abroad and then imports it, either in a more than ordinary middle class personal consumption amount, or for resale.
The only benefit from a customs perspective to conducting the deal in international waters (which has nothing to do with it being a barter v. a transaction for credit or cash) is most easily illustrated with an example.
Suppose you are a U.S. person who lives in Maine. You go into international waters and buy $100,000 of escargot from a French snail products company and conclude the purchase at sea in international waters. You then deliver the escargot from your ship in international waters to your customer in Mexico.
Even though you are U.S. person, since the goods never entered the U.S., the goods are not subject to U.S. customs duties or regulations, only to Mexican customs duties and regulations.
So, for example, if the U.S. had a 10% customs duty on imported escargot, and banned escargot from France due to public health concerns, but Mexico only had a 5% customs duty on imported escargot and did not ban imports of it from France, it would be desirable to take delivery of the escargot in international waters or in France, and to ship them from international waters or France directly to Mexico rather than taking delivery of the goods in Maine and then shipping them to Mexico from there. You couldn't legally take delivery of French escargot in Maine at all, and if you too delivery instead of Belgian escargot which was not embargoed for public health reasons, you'd still pay a 10% U.S. customs duty in addition to the 5% Mexican customs duty.
To avoid the inconvenience of having to actually do a business sale of commercial quantities of goods at sea, or the need to ship directly, there are a handful of ports under the laws of many countries in which goods placed in specially regulated warehouses are treated as not yet having entered the country for customs duty and inspection purposes until the goods are removed from the warehouse and brought into the country. So, in those places, sometimes called duty free zones or "free ports" one can avoid customs duties and inspections in the country where the port and warehouse where delivery of goods is taken when the goods are still in transit to a final destination outside the country where the port is located.
Countries allow this because these duty free zones still allow the country to make money from income taxes on the people involved in the operation of the warehouse and ports in the duty free zone, and to make sales tax income from sailors and/or airline crew who enter the country after their work for the day is done, even though the country doesn't get the customs duties. If the customs duties and inspections had been required, the country wouldn't have gotten any income from this commerce at all because the deal would have been done in international waters or with a direct shipment or via a different third-party intermediary country.
Choice of Law And Transactional Law Issues
The common belief that no country has international jurisdiction over the kind of private exchange you present is not true.
At a minimum the country or countries under whose flag the party's ships are flying would have jurisdiction.
All countries have jurisdiction for some purposes (e.g. piracy and war crimes), sometimes under international treaties (there are a series of "law of the sea" treaties, for example, and there are also treaties that govern interactions between people affiliated with signatory nations like the Convention on the International Sale of Goods), and sometimes under what amounts to international common law.
These legal rights can often be enforced in the domestic courts of a country where the person who violated those laws is domiciled or organized (under a legal theory of personal jurisdiction known as "general jurisdiction"), or where the person who violated those laws owns property (under a legal theory of personal jurisdiction is called "quasi-in rem" jurisdiction).
Some countries have extraterritorial jurisdiction over their citizens and/or residents for some purposes, and over people who harm their citizens (for other purposes), which they enforce in their own courts. For example, the U.S. government claims and acts upon its claim of authority in its own courts over acts of terrorism committed against U.S. persons outside the U.S.
When you do a business deal in international waters, a choice of law issue arises if there is a dispute in the transaction giving rise to a possible lawsuit.
Continuing the example above, suppose that you agreed to buy 1000 kg of large escargot which was worth $100 a kilogram and the seller misled you and only gave you small escargot which is worth only $50 a kilogram.
Whose law and whose courts govern this dispute?
If the buyer and seller are from different countries, the Convention on the International Sale of Goods (CISG) provides the substantive law if both buyer and seller are citizens of signatory countries, and the buyer would probably have to sue the seller in the courts of the seller's country.
Portugal, France, Canada, the United States, and Mexico are all parties to the CISG, as are many other countries. The signatories are a minority of countries in the world, but account for most of the world's international trade.
It is also possible, for example, if the CISG did not apply because the seller was from a country that wasn't a signatory, that the law of the country under which the ship involved was flying under the flag of applied. So, if the deal took place in international waters on a Panamanian ship, the laws of Panama would apply.
As a result, in practice, it doesn't matter that much if the CISG applies or not, because most countries which are not signatories have domestic laws governing the sale of goods which are substantially similar to the CISG in most respects.
Caveat
For the sake of clarity, it is important to note that there can indeed be major tax loopholes involved in legal international commerce, and there can also be significant regulatory law consequences that arise from legal international commerce that can benefit some of the parties to that international commerce.
But, those loopholes can only rarely be benefitted from with a transaction structured as a barter of goods conducted in international waters between private persons.
Many of the tax and regulatory benefits associated with international trade arise from conducting actual economic production activity, like manufacturing, in a country with low taxes on that activity and in a country with weak regulation of that activity. But these benefits aren't so much a legal loophole to close, so much as they are the product of a substantive policy decision made collectively by the laws of countries all over the world over which countries should have tax and legal jurisdiction over which kinds of activities.
Most of the other tax benefits associated with international trade arise from manipulation of intangible financial assets and liabilities between countries to take advantages of loopholes in the tax laws for these types of intangible asset transactions. Usually, these loopholes in the treatment of intangible assets were not contemplated when the tax legislation containing these loopholes was drafted.
Sometimes these loopholes persist because legislative authorities are not aware of the loopholes or don't understand what is happening.
Sometimes legislative authorities lack the time and expertise to figure out a good solution to the problem that doesn't create a greater problem in some other part of the tax law.
Sometimes the loopholes persist once the loopholes are discovered because they are deliberately ignored as a legislative boon to a special interests because this boon is not very visible or salient to most members of the general voting public.
I saw all three of these reasons play out first hand when I was working as an aide in Congress for a House Ways and Means Committee member for a while in the early 1990s.