Google just bought Nest for $3.2 billion cash, and that means the startup’s early investors Kleiner Perkins Caufield Byers and Shasta Ventures have struck it rich. Multiple sources say Kleiner invested $20 million in Nest and got a 20X return to pull in $400 million. [Update: Meanwhile, the deal returned “almost all” of Shasta’s second $250M fund.]

Nest didn’t disclose the size of its Series A and B rounds or who invested how much. That makes it’s hard to pinpoint who earned what on the sale of the home automation startup that sells smart thermostats and smoke detectors.

Shasta and KPCB funded all of Nest’s Series A round back in September 2010, just a few months after the connected device startup was founded. Then in August 2011, they both participated in Nest’s Series B, which also included Google Ventures, Lightspeed Venture Partners, Intertrust, and Generation Investment Management.

Multiple sources say Kleiner Perkins was Nest’s biggest investor, and was able to invest $20 million in Nest across the A and B rounds. Our sources say the $3.2 billion cash price Google paid for Nest will generate a 20X return for KPCB — which matches the 20X multiple Fortune’s Dan Primack heard from a source. The money came from 2010’s $650 million KPCB XIV fund, which means Kleiner returned over 60% of the fund with just its Nest investment. The treasure should also boost the status of KPCB partner Randy Komisar, who sourced the investments and sat on Nest’s board.

The win for Kleiner Perkins Caufield Byers is reminiscent of its early home runs on investments in Google, Amazon, AOL, and Intuit in the 1990s. Recently, it’s gotten a piece of huge exits like Facebook and Twitter as well as rising stars like Square and Spotify, but not until later rounds when potential returns are much lower. But with Nest, KPCB got in on the ground floor and will reap the benefits when the acquisition by Google officially closes.

As for Shasta Ventures, today is a massive win for the firm and its managing director Rob Coneybeer, who we hear fought relentlessly to get the $250 million Shasta II fund into Nest’s Series A and B rounds.

[Update: A source familiar with Google’s deal to acquire Nest tells us Shasta’s investment will bring it enough money to return “almost all” of the $250 million Shasta II fund. That means Shasta pulled in $200 million or more from the Nest acquisition.]

The Nest deal almost surely trumps other Shasta hits like Zenprise which was bought by Citrix, and Mint which was bought by Intuit. The returns could bolster confidence in limited partners and help Shasta raise its next fund.

Google Ventures also pulled in big money today, as it led Nest’s Series B and C rounds. Oh, and so did Nest’s founders Tony Fadell and Matt Rogers.

For the venture capital industry as a whole, the Nest acquisition may contribute to a frothy market for hardware entrepreneurs. If companies like Google are out there paying billions in cash for young startups that build devices instead of software, it may become easier for hardware tinkers to raise serious capital and move from their garage to a real laboratory.

[Additional reporting by Kim-Mai Cutler]

Click below to read the full story on Google buying Nest: