Library / Case Studies
Secure Infrastructure To Store Bitcoin In The Cloud at Coinbase
A real-world engineering write-up from Coinbase on distributed Security.
By Coinbase engineers · Coinbase · Added 2026-10-12
All content belongs to Coinbase engineers / Coinbase. We only link to it and give credit. Report a problem
Learn this case study
About 37 min left. Your work is saved as you go.
What you are about to study
Coinbase explains a real system. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
- Web Security
- OWASP risks, XSS, CSRF, CORS and secure design.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Core Concepts: How Things Actually Work · 9 minStoring passwords and managing sessionsHashing, salting and slow password hashes, plus how sessions and tokens keep users signed in safely.Read here
Never store the password
You do not need to know a user's password, only to check it. So store a one-way hash of it.
Why plain hashes are not enough
General-purpose hashes (MD5, SHA-256) are built to be fast. An attacker with your leaked hashes can try billions of guesses per second, and use precomputed tables (rainbow tables) for common passwords.
What to do instead
- Add a unique random salt per user, stored next to the hash. Identical passwords then produce different hashes, and precomputed tables are useless.
- Use a password hashing function designed to be slow and memory-hungry: Argon2id, bcrypt or scrypt, with a work factor you raise as hardware improves.
- Optionally add a server-side secret ("pepper") kept outside the database.
100%Figure SDA-CORE-06-1 · What to do instead · © forcsguy.com
Sessions: staying signed in
After login, the server must recognise the user on later requests.
- Server-side session: the server stores session data and gives the browser an unguessable session ID in a cookie. Easy to revoke (delete the record).
- Token-based (for example JWT): the server signs a token containing the user's identity and the client sends it each time. No lookup is needed, but revoking one before it expires is hard, so keep lifetimes short and use refresh tokens.
Neither is automatically better. Server-side sessions are simpler and safer for typical web apps; tokens suit APIs and service-to-service calls.
Cookie settings that matter
HttpOnly: scripts cannot read it, which limits damage from cross-site scripting.Secure: only sent over HTTPS.SameSite=LaxorStrict: reduces cross-site request forgery.- A sensible expiry, and a new session ID after login to prevent session fixation.
Other protections
- Rate limit login attempts and add lockout or delays.
- Offer multi-factor authentication.
- Compare secrets with a constant-time comparison.
- Reset passwords with short-lived, single-use links sent to a verified email.
- Never log passwords or tokens.
Real-world reading
Related reading
- Pagelets Parallelize Server-side Processing at YelpYelp engineers · YelpCase Studies
- Server Side Rendering at WixWixYouTube
- MongoDB at Baidu: Multi-Tenant Cluster Storing 200+ Billion Documents across 160 ShardsMongodb engineers · MongodbCase Studies
- Secure Infrastructure To Store Bitcoin In The Cloud at CoinbaseCoinbase engineers · CoinbaseCase Studies
Show 6 moreShow fewer
- Sherpa: Distributed NoSQL Key-Value Store at YahooYahoo engineers · YahooCase Studies
- Akutan: Distributed Knowledge Graph Store at eBayeBay engineers · eBayCase Studies
- The Site Reliability WorkbookGoogle SRE team · O'Reilly / GoogleBooks
- Espresso: Distributed Document Store at LinkedInLinkedIn engineers · LinkedInCase Studies
- Datadog Engineering BlogDatadog engineers · DatadogBlogs
- Novoda Engineering BlogNovoda engineers · NovodaBlogs
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Secure Infrastructure To Store Bitcoin In The Cloud at Coinbase.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Clock Skew when Syncing Password Payloads at Drobbox
How Dropbox Passwords fixed sync errors from clock skew by replacing a two-way timestamp merge with a three-way merge against a base payload.
DrobboxIntermediate
Case Studies · Read here
OAuth Audit Toolbox at Indeed
Integrating third party apps with GSuite can be risky. Indeed's OAudit Toolbox allows you to educate your users and improve application security.
IndeedIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…