> What is the source of the known hash?
The known hash is manually entered in the package's Nix file. When adding a new package, you specify its source (e.g., Git or crates.io) and initially leave the hash field empty. Nix will then download the source, compute its hash, and error because it doesn't match the empty value. You simply copy this computed hash from the error message into the file to finalize it.
Check the nixpkgs GitHub repo. Search for a program's package file to see its hash and the PR that updated it.