Naval mines are an unglamorous, little discussed, range of weapon types. They are very cheap and effective, being unmanned - compared to all types of labour intensive weapons (ship, submarines and naval aircraft).
Here and below is a quick history of naval mines up to modern times:
MORE DETAIL
Wikipedia has many entries on mines, such as:
Types of naval minesincludingInfluence Mines
Modern influence mines such as the BAE Stonefish are computerised, with all the programmability this implies, such as the ability to quickly load new acoustic signatures into fuses, or program them to detect a single, highly distinctive target signature. In this way, a mine with a passive acoustic fuze can be programmed to ignore all friendly vessels and small enemy vessels, only detonating when a very large enemy target passes over it. Alternatively, the mine can be programmed specifically to ignore all surface vessels regardless of size and exclusively target submarines.
Even as far back as WWII it was possible to incorporate a "ship counter" function in mine fuzes. This might set the mine to ignore the first two ships passing over it (which could be minesweepers deliberately trying to trigger mines) but detonate when the third ship passes overhead, which could be a high-value target such as an aircraft carrier or oil tanker. Even though modern mines are generally powered by a long life lithium battery, it is important to conserve power because they may need to remain active for months or even years. For this reason, most influence mines are designed to remain in a semi-dormant state until an unpowered (e.g. deflection of a mu-metal needle) or low-powered sensor detects the possible presence of a vessel, at which point the mine fuze powers up fully and the passive acoustic sensors will begin to operate for some minutes.
It is possible to program computerised mines to delay activation for days or weeks after being laid. Similarly, they can be programmed to self-destruct or render themselves safe after a preset period of time. Generally, the more sophisticated the mine design, the more likely it is to have some form of anti-handling device to hinder clearance by divers or remotely piloted submersibles."
USE AGAINST NORTH VIETNAM - ONE DAY CHINA?
Even during the Vietnam War (49 years ago) US mines were highly complex, including those used in American Operation Pocket Money
In early May 1972"There were 37 foreign-flag ships in Haiphong [North Vietnam's main naval and civilian harbour] : 16 Soviet, 5 Chinese, 5 Somalian, 4 British, 3 Polish, 2 Cuban, and 1 East German. The mines were set with a series time fuze delay of 72 hours to allow these neutral ships time to leave port, and another series time fuze would disable the mine after 180 days...
"On 4 August 1972 dozens of the mines spontaneously detonated. The U.S. Navy determined this was caused by magnetic radiation from a geomagnetic storm triggered by a coronal mass ejection on the Sun; this was confirmed by scientific research in 2018.[9][10]
One British and four Soviet ships left Haiphong before the mines' time fuzes armed. The remaining ships were immobilized for 300 days while the port of Haiphong was closed."
----------------------------
Against China?
If/when China attempts to invade Taiwan US mining of Chinese naval bases (often also part/near civilian ports) is an option. There would be an impact on non-Chinese flagged vessels, of course.