Contact mechanisms and design principles for (Ohmic and Schottky) metal (M) contacts to semiconductor nanowires (NWs) have been studied. The NWs have been assumed to be cylindrical. A unified model has been developed for the contacts. The model takes into consideration the amorphicity of the M/NW interface structure, the diameter dependence of the energy band gap, the barrier height modulation, and the fluctuations in both the barrier height and the applied bias. While the fluctuations in the barrier height are assumed to involve band tails, the fluctuations in applied bias are assumed to involve tiny Gaussian peaks. Several different features of the Ohmic and the Schottky contacts have been addressed. These include temperature and dimension dependencies of the current-voltage characteristics, the influence of the M/NW interface on the contact characteristics, the relationship between the barrier height and the ideality factor, and the barrier height reduction as a function of temperature. The model appears to be very general. It seems to explain all experimental results available to date in the literature. The calculated results are almost always in good correspondence with the experimental results. The study seemingly demonstrates an alternative to the doping dependence of the Ohmic contacts. It elucidates the fundamental physics underlying M/NW contacts. It highlights means to yield low-resistivity Ohmic contacts by thermionic emission. It describes design criteria for both Ohmic and Schottky contacts. The design criteria for Ohmic contacts tend to address the long-term reliability concerns for devices. They explain also the behavior of both good and bad Ohmic contacts. All these may be the most striking attributes of the study. These attributes explain why Schottky contacts to NWs, with proper gate modulation, may act also as Schottky barrier transistors.