Anything called a lock or key counts, but things similar to locks or keys but not called as such do not count. See related market here.
Update 2025-05-19 (PST) (AI summary of creator comment): The market question has been updated by the creator. The question is now: Are there more locks than keys?
Update 2025-05-19 (PST) (AI summary of creator comment): The creator's comment indicates that the following types of digital items are considered for the count:
Database locks (such as those taken by SQL queries, as discussed in the thread)
Encryption keys
Update 2025-05-20 (PST) (AI summary of creator comment): The creator confirms that abstract meanings of key are included in the count.
For example, a key in the sense of 'a crucial step or requirement' (as per Wiktionary definition 3 for 'key') counts. The creator has requested input on how such abstract keys would be quantified.
Update 2025-05-20 (PST) (AI summary of creator comment): The abstract definition of key as 'a crucial step or requirement' (e.g., Wiktionary definition 3 for 'key') will not be counted. This reverses the information in the AI summary from 2025-05-20, which stated such abstract keys would be included.
Update 2025-05-20 (PST) (AI summary of creator comment): The creator has clarified how locks of hair will be counted:
Only one lock of hair per organism will be counted.
Update 2025-05-20 (PST) (AI summary of creator comment): The creator acknowledged a user's argument for counting Lomer-Cottrell locks (a type of crystal dislocation) as 'good'. The creator also referenced user estimations and their own estimation method for such locks, suggesting their inclusion in the count.
There is also this thing but it's an acronym so idk if it counts: https://www.nature.com/articles/s41467-020-20830-9 and this https://pubchem.ncbi.nlm.nih.gov/compound/57681688
Protein L3MBTL1 is involved in epigenetics as a complex that suppresses transcription. Because of this, it has been referred to by researchers as a "chromatin lock."
https://pubmed.ncbi.nlm.nih.gov/17540172/
https://www.sigmaaldrich.com/US/en/product/mm/442640m
Sources for abundance of L3MBTL1: https://pax-db.org/protein/9606/ENSP00000398516
According to PaxDB, this protein has an abundance of 0.27ppm, which I believe in PaxDB means 0.27 per 1 million proteins.
According to this site, mammalian cells have about 10^10 proteins. https://book.bionumbers.org/how-many-proteins-are-in-a-cell/ Humans have about 3*10^13 cells. There are about 10^10 humans. This gives us a lower bound of 10^26 L3MBTL1 proteins.
This protein also occurs in a bunch of other model organisms, so it's probably in a lot more than just humans. https://pax-db.org/search?q=L3MBTL1&pageSize=20. An extremely loose estimate for the total number would use something like the 10^31 total cells on earth multiplied by the 10^7 proteins in a "simple cell" https://www.sci.news/biology/cell-protein-molecules-05618.html, but I don't feel like looking up the abundance of this protein for so many different organisms. I spent way too much time on this.
A Lomer-Cottrell lock is a type of configuration of dislocations in a face-centered cubic crystal. Semantically, each individual such dislocation is a discrete "Lomer-Cottrell lock," and it is referred to as such by experts.
https://www.nature.com/articles/srep01061
https://www.sciencedirect.com/science/article/abs/pii/S092150931930084X
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4121962
Such dislocations are found in all face-centered cubic metals, such as aluminum, copper, gold, silver, platinum, and nickel. It is somewhat difficult to estimate the volumetric density of LC locks, since dislocations are typically represented as 1d structures, and so dislocation density is typically measured in the number of dislocations intersecting a given unit area.
However, even if we were to use the figure for the number of dislocations in a unit area of cold-worked metal, 10^14/m^2, to be the number of dislocations in a cubic meter, this is a significant amount. More calculations can be found in this paper, which I could probably use for a better estimate if I was more knowledgeable about this topic
https://www.researchgate.net/publication/253575917_Volume_density_of_dislocation_lock_sources
In order to estimate the amount of relevant metal on Earth, we can look at manmade and natural metals. Most metals for humans usage are cold-worked, which have more dislocations than annealed metals. Aluminum is by far the most abundant FCC metal used by humans, with an estimated 10^12 kg or 3*10^8 m^3 of aluminum produced in total. From the lower bound earlier, this would give at least 10^22 locks.
Of the FCC metals, copper is most abundant in its metallic form in the crust. From a quick estimate, there seems to be 10^18 kg of copper in Earth's crust, from Earth's crustal mass being 2.77*10^22kg, and abundance of copper being 70ppm in Earth's crust. I couldn't find any sources on what percent of crustal copper is native copper (metallic copper) though.
https://international-aluminium.org/landing/75-of-all-aluminium-ever-produced-is-still-in-use-today/#:~:text=From%201888%2C%20when%20aluminium%20was,still%20be%20in%20use%20today.
Either way, these numbers will likely surpass any possible computer-science related keys or locks. There are around 10^21 transistors and 10^21 bits of memory in total produced by humans, so computer-based keys or locks seem unlikely to surpass those in terms of physically manifested keys.
@100Anonymous estimated roughly 10^32 (10^24 kg metal*10^8 locks per sq.meter; I estimated 1 kg metal = 1 sq .mtr surface area)
https://en.wiktionary.org/wiki/key has (3) "A crucial step or requirement."
Do these count as keys? If so, is there any way to count them?
@TheAllMemeingEye That was what I was thinking. If it counts, we can make the case that there are an infinite number of keys, and therefore keys wins.
Every time a database query is run, it takes a lock on every table that it uses. (That's an oversimplified summary, but you can see the full story for SQL Server here: https://www.sqlshack.com/locking-sql-server/.)
Those locks only exist while the query is active, but we could try to estimate the total number of concurrent queries across all databases in the world. It's probably roughly similar to the total number of database tables.
@TimothyJohnson5c16 yes, and within them are usually quite a good number of key-value pairs, so this might come down to a comparison of queries to entries.
Ah, good point. Not all tables have key-value pairs, but they often do have primary keys:
https://www.geeksforgeeks.org/primary-key-in-dbms/
Or potentially multiple foreign keys: https://www.geeksforgeeks.org/foreign-key-in-dbms/
But hash tables with key-value pairs probably swamp everything else.
@TimothyJohnson5c16 On the previous market, I counted 1-10 trillion hashtables. If each hashtable has on average 100 key-pairs, That would be at most 10^16 keys, right?
@Driftloom Can we count the lock and key model of enzymes? I'm not sure if the objects themselves are actually called locks and keys.
@TimothyJohnson5c16 I’ve only personally heard that used pedagogically, as a metaphor to imagine what is happening. Let me noodle on it.
Edit: Didn’t take me long. The ‘lock and key model’ is metaphorical. Enzymes and substrates aren’t formally named locks or keys in the literature to my knowledge. As far as I’ve seen, the terms don’t migrate into naming conventions, even informally. So unless someone shows me a PDB structure entry labeled ‘lockase,’ I’d say no. If it’s not called a key, it’s just a very specifically shaped friend.
Locks of hair? don't encryption keys often not have a corresponding lock though? i assume those probably exist in extreme quantities
@MingCat And often multiple keys for a given cryptographic lock.
Keys also don’t imply locks, while locks imply keys. Consider the keys on a keyboard. Or a piano.