Except as otherwise provided, all valuable mineral deposits in lands belonging to the United States, both surveyed and unsurveyed, shall be free and open to exploration and purchase, and the lands in which they are found to occupation and purchase, by citizens of the United States and those who have declared their intention to become such, under regulations prescribed by law, and according to the local customs or rules of miners in the several mining districts, so far as the same are applicable and not inconsistent with the laws of the United States.
(R.S. § 2319.)