Could you please elaborate on the process of generating private keys in the world of cryptocurrency? What are the underlying mechanisms and algorithms that are employed to ensure their uniqueness, security, and randomness? How do these keys play a pivotal role in maintaining the integrity of digital transactions and ensuring the safety of users' assets?