After eight years of negotiations, the United Nations today adopted a sweeping treaty on the law of the sea, but the United States voted against the agreement, leaving in limbo ultimate control over trillions of dollars in minerals waiting to be mined from the ocean floor.

Despite the American opposition, the treaty will be opened for signature at a ritual session in Caracas, Venezuela, this December, and will come into force when 60 nations have ratified it.

The text includes provisions setting a 12-mile limit, regulating shipping lanes, environmental protection, scientific exploration and fisheries, establishing a 200-mile "economic zone" for coastal nations that defines oil drilling rights, and guaranteeing free navigation for naval forces.

All these provisions, on which consensus was reached during marathon negotiations, are expected to become accepted international law for signatories and non-signatories alike.

In themselves, even opponents of the treaty concede, they constitute a significant achievement of multilateral diplomacy.

From the very start of the Third U.N. Conference on the Law of the Sea in 1974, the sea-bed mining provisions were the focus of a controversy that in the end could not be resolved. The differences forced the conference to move from its basic procedure of agreement by consensus to a formal ballot on the final product that ended with 130 nations voting for the package, four against and 17 abstaining.

Venezuela, Turkey and Israel joined the United States in opposing the treaty. The Soviet Bloc (with the exception of Romania) abstained, along with Belgium, Britain, Italy, Luxembourg, the Netherlands, Spain, Thailand and West Germany. France, Canada and Japan were the key Western nations voting with the majority.

The heart of the American objection lies in the Reagan administration's view that the treaty does not adequately protect the U.S. firms that have pioneered the technology and exploration for the mineral nodules that lie in profusion, waiting to be scooped from the deep-sea bed.

Washington accepted the principle that revenues from this bonanza should be shared with developing nations and that an international "enterprise" should be established to mine some of the choice sites, along with private firms.

Even this position has brought protests from opponents who reject what they call the "giveaway" of the right of private enterprise to exploit the manganese nodules--which also contain cobalt, zinc, copper and other minerals--freely.

Even had the Americans' demands here been met, the treaty would have faced strong opposition in the Senate.

Earlier administrations had accepted most of the treaty provisions in principle, but when President Reagan took over, the United States announced that it was reconsidering participation in the talks. After a year of study, the administration demanded massive changes in the consensus that had been reached earlier.

Third World negotiators accepted compromise articles in the treaty that would guarantee four of the American pioneering consortiums preferential mining sites, along with firms from France, Japan, India and the Soviet Union. The majority also agreed to give the United States more of a role in the international sea bed authority that is to regulate ocean mining.

But after the vote, chief American delegate James L. Malone, while conceding that "some modest improvements have been made" in the text, charged that "there has been an unyielding refusal on the part of some to engage in real negotiations on most of the major concerns."

Malone insisted that the administration's objections were not designed to protect a few "U.S. business interests," but were based on "deep conviction and principle, which will continue to guide our actions in the future."

Alvaro de Soto of Peru, the chief Third World negotiator, agreed that the American opposition "was more of an ideological than a practical nature." He added, however, that "there was no way to make the ends meet--time would not have helped the U.S. scale down its demands."

Malone listed these specific objections:

* While providing access to pioneer firms, the treaty does not ensure that other qualified miners from the private sector will have access to future mine sites.

* The decision-making process in the deep sea authority, which now requires a three-fourths majority of a 36-nation council to adopt major decisions, still does not "give a proportionate voice to those countries most affected by the decisions."

* The provision for opening the treaty to amendment after 20 years, while requiring a three-fourths vote for the ratification of changes in deep sea mining procedures, is still "clearly incompatible with United States processes for incurring treaty obligations." The American fear is that the Third World will gang up after 20 years to prevent U.S. firms from obtaining full return on their mining investments.

* The provision for mandatory transfer of mining technology from private firms to the international enterprise is unacceptable.

* The distribution of benefits to national liberation movements, as well as to Third World nations, creates a precedent that is "not appropriate."

Malone also said that a treaty provision limiting production quotas for deep sea mining ventures--adopted at the behest of land-based mineral producers ranging from Canada to Zaire-- is one of the "key problems for the U.S. Congress."

Even without U.S. participation in the treaty, American firms that choose to accept its terms would be able to reserve their pioneering mining sites if one company participating in their consortium is based in a country signing the treaty.

It will be harder, but not impossible, for American companies to launch actual mining operations under the treaty by reincorporating in nations that have ratified the pact.

The ability of American firms to claim mining sites even if the United States does not sign the treaty was the principal reason the Soviet Union gave for abstaining today. The Soviets contended that their state-run deep sea mining operation would be at a competitive disadvantage because of this provision, but most diplomats expect Moscow and its allies to sign the treaty eventually.

De Soto contended that the adoption of the treaty "obliges all elements of future sea bed mining to be carried out under the treaty," because "no bank is going to finance any outside venture, if only out of the fear of claim jumping."

But without the American companies, sea bed mining could be delayed for additional years, and the expectation of most diplomats is that the United States, perhaps under a future administration, will eventually join the fold.