# Are hashes only used to confirm data integrity when used for distributed ledgers?

I have a couple questions related to hashing and data. Please let me know if the questions I have are too broad for this site, or if clarification is needed.

I have read a lot about hashing as it relates to distributed ledger technology (DLT) like blockchains and directed acyclic graphs (DAG), but I am I am wondering if hashing is only to confirm that the data being hashed was unaltered, so I have some questions:

1. Can hashes be used in other ways? For example, can a hash be used as an address to locate data?

2. Since a hash is only one way I am guessing someone cannot obtain the original data before hashing, which means a hash is only a confirmation that data is unaltered?

3. If data in the past is altered, the current hash encompassing previous data will change, but where is the original hash to compare it to that lets a user know that a hash has changed? I am guessing the correct hash is held by a majority of people in the DLT?

• If a hash function $$H$$ is second-preimage-resistant, and you know $$h = H(m)$$, then it is hard for an adversary to retroactively find $$m' \ne m$$ such that $$h = H(m')$$ even if they know $$m$$.
• If a hash function $$H$$ is collision-resistant, then it is hard for an adversary to actively find $$m' \ne m$$ such that $$H(m') = H(m)$$, which would enable them to hand you a benign message $$m$$ for you to review, and later substitute a malicious message $$m'$$ for it without anyone being any the wiser because the hash didn't change.