From a US Constitutional perspective, rights are inherent, and the Bill of Rights protects citizens from laws that infringe on those rights. Rights are not given by the government via laws, they are inherent protections from invasive laws set by government.
That concept is called 'natural rights', and it wasn't invented by the US constitution. That document is just one of the more notable formal recognitions of natural rights in modern times.
Natural and human rights exist too, and they are often a bar by which we judge legal rights.