The story line is divided into seven eras:
The period is before humans learned of the existence of Trisolaran civilization. The book starts during the Fall of Constantinople with the story of a prostitute seemingly able to retrieve objects and even human organs without penetrating their enclosures. Offering her services to Constantine XI, she is thus tasked with killing Mehmed II, but mysteriously loses her powers the day before Constantinople falls.
The time period (present era – 2208 AD) after Trisolaris and the Trisolarans become widely known and sophons begin to block all scientific progress. The story of this era starts with Yang Dong, the daughter of Ye Wenjie, having uncovered her mother's conspiracy with Trisolaris and losing hope in life; she has a conversation with a colleague that suggests to her that just as civilization is shaped by nature and the environment, so too can civilization change the structure of the Universe. The plot then moves to Yun Tianming, who suffers from terminal cancer. Receiving an unexpected sum of money, Yun Tianming secretly buys a star, DX3906, for scientist Cheng Xin, whom he has loved since college. Cheng Xin is working on a project called the Staircase Program, using nuclear pulse propulsion to send a spacecraft containing a human to the Trisolaran Fleet to potentially gather information. After being forced to lower the maximum weight multiple times, they realize that they will only be able to send a brain, and will not be able to preserve it – the host will have to be dead. They must hope that a Trisolaran ship intercepting the brain will be able to restore the brain to life. The government sends out applications to be the host of the brain. Yun Tianming, about to be euthanized, is told about the program and terminates the euthanasia. He eventually becomes the final choice, and, on death, his brain is sent on an intercepting course towards the Trisolaran fleet, but a mistake in bomb detonation sends Yun's brain off in an unknown direction, potentially lost forever. Cheng Xin's superior, Thomas Wade, reveals that Yun Tianming was the one who gave her DX3906, causing her to feel overwhelming guilt over her role in getting him accepted to the Staircase Program. Cheng Xin enters hibernation to be the Staircase Program's liaison to people of the future.
The age after Luo Ji deters the Trisolarans with the threat of mutually assured destruction by threatening to broadcast the location of their home world, which would indirectly expose the Solar System's location as well. Luo Ji becomes the first Swordholder, the individual endowed with the sole responsibility for initiating broadcast. Earth Federation recalls the two human ships that survived the Doomsday Battle, Bronze Age and Blue Space. Upon their return, the crew of Bronze Age is charged with crimes against humanity for destroying other ships in the fleet, but the captain manages to warn Blue Space not to return to Earth. Earth Federation and Trisolaris together send the ship Gravity to pursue Blue Space. Two Droplets are also sent as assurance to Trisolaris because Gravity has the ability to broadcast the location of Trisolaris. Earth and Trisolaris mysteriously lose contact with Gravity as the pursuit reaches the Oort cloud; the crew of Gravity begin seeing patches of space disappear or see the crew of Blue Space on their own ship, which they rationalize as hallucinations. Cheng Xin awakens from hibernation and meets Ai AA, an astronomer who has discovered valuable planets around DX3906. They sell the planets to Earth but retain ownership of the star; with the money from this transaction, Cheng Xin starts the Halo company, managed by AA. They meet Sophon, a Trisolaran android whose body is directly controlled by Trisolaran sophons, who provides a diplomatic and communicative link between Earth and Trisolaris. She shortly afterwards survives an assassination attempt by her old project manager Wade, who saw her as the most likely winner in the swordholder selection, due to her philosophy of preserving life. Cheng Xin is elected the next Swordholder, as humanity find her unintimidating image reassuring, beating out the other swordholder candidates, all of whom are from the Common Era and significantly more capable of initiating a broadcast due to undiluted male aggression. The Trisolarans, having correctly predicted Cheng Xin's unwillingness to broadcast their location and thus doom both civilizations, begin an invasion immediately after the Swordholder title is transferred from Luo Ji to Cheng Xin, destroying all broadcasting stations in the Solar System. Simultaneously, the Droplets attack Gravity and Blue Space.
The age when Trisolarans prepare Earth for Trisolaran settlement. Within a year, nearly all of humanity is forced to Australia under the threat of Droplet attacks, where the Trisolarans plan to reduce their numbers drastically through starvation. Cheng Xin and Ai AA live under the protection of Fraisse, an Australian aboriginal leader, and Sophon, who still respects them, and thus do not suffer the material shortages of other human refugees. Meanwhile, the Droplets suddenly become incapacitated and narrowly miss Blue Space and Gravity, careening harmlessly into space. Blue Space crew members explain that they have found patches of 4-dimensional space that 3-dimensional beings can enter, through which they manipulated the Droplets, by breaking the strong-interaction forces that held them together. They find a large patch of 4-dimensional space and are able to communicate with an AI aboard an abandoned 4-dimensional ship in this space. The ship describes itself as a tomb of a now-extinct fourth-dimensional race. Four-dimensional space is collapsing into 3 dimensions, and the civilizations who initiated the collapse have already transformed into 3 dimensions, trading out a 4-dimensional dark forest for a 3-dimensional forest instead. The tomb explains that dark forest states cannot exist between different dimensions, the higher dimensions cannot be affected by lower dimensions and the lower dimensions have no resources desirable to higher dimensions. Shortly after the 4-dimensional space collapses completely, viewed in 3 dimensions as the expulsion of significant energy. The two human ships congregate and vote to broadcast the location of Trisolaris in retaliation for the attack on Earth, knowing the Solar System will likely be located and destroyed as well.
This begins after humanity broadcasts the location of Trisolaris from the Oort cloud. One of the three suns of Trisolaris is destroyed by a photoid, a small piece of matter moving so close to light speed that it causes the star to go supernova on impact. The planet Trisolaris is completely incinerated as a result, and Trisolarans cease their planned colonization of Earth on the assumption that Earth will soon be destroyed as well. Humans, including Cheng Xin, return to the other continents. Before leaving Earth, Sophon meets with Cheng Xin and Luo Ji. Out of respect to Luo Ji, the Trisolarans agree to give a yes/no answer to any question he desires, and confirm that there does exist a method to broadcast harmlessness to other civilizations. Sophon informs Cheng Xin that Yun Tianming was located and cloned, and that he wishes to speak to her. Their conversation is meant to be personal and is closely monitored for intelligence that Trisolarans do not want divulged; however, Yun Tianming tells Cheng Xin three interconnected fairy tales. She and Yun promise to meet at DX3906 one day. Cheng Xin understands that the fairy tales are coded messages, and from these fairy tales humanity is able to determine several courses of action for the inevitable dark forest attack: * Curvature Propulsion: a method of lightspeed propulsion via slowing down the speed of light, allowing for light-speed travel but leaving behind a reduced light speed contrail.* Black Domain: Via lowering the speed of light around the solar system to lower than its escape velocity, nothing will be able to leave, and any civilization viewing the solar system will see that Earth is harmless. * Bunker Project: Via analysis of the photoid attack on Trisolaris, it is determined that other planetary bodies such as Jupiter and Saturn could act as shields from the dying sun.
The "bunker project" is chosen as the most feasible, since the black domain project is too far beyond humanity's scientific ability. Although there are debates on researching curvature drive technology, during a dark forest attack false alarm it is discovered that the highest socioeconomic classes had attempted to build interstellar vessels to transport themselves out of the solar system, and research into curvature propulsion is banned as a form of escapism. During a test of these space cities, Cheng Xin meets Wade again. He demands that she turn over her company's vast resources to him, stating that only he has the ruthlessness needed to research illegal lightspeed propulsion technology. Cheng Xin reluctantly agrees and enters hibernation after turning ownership of her company to Wade, but makes Wade promise to reawaken her if his research threatens human lives in any way.
Most humans living on Earth move to space cities in the shadow of Jupiter and other gas giants, having chosen to use them as shields. Research on lightspeed ships remains illegal, but Wade has been making progress by conducting research on his own independent space station. Cheng Xin is woken as Wade has threatened armed resistance with antimatter bullets should the government prevent them from researching lightspeed travel. As Swordholder, Cheng Xin reminds Wade of his promise and demands that he disarm and surrender; he reluctantly honors their agreement and does so, after declaring that humanity that loses its bestial nature loses everything. He is found guilty of illegal research and executed via a high-powered laser as a result.
Fifty-six Earth years later, Singer, an exterminator on an extraterrestrial spacecraft (which the crew regard as the lowest position on the ship) is passively scanning for coordinate broadcasts. It has to be done by a living being, since their supercomputers are incapable of distinguishing false broadcasts of the uninhabited world from real broadcasts. He intuits real broadcasts from many factors, the primary one being fear. However, cleansing star systems is an unimportant task, having no time constraints, need for accuracy or precision, or even a need to be correct. Receiving the coordinates of Trisolaris from Gravity's gravitational wave broadcast he picks up a mass dot (inferred to be a photoid) and prepares to toss it at the Trisolaran star system before realizing it has already been destroyed. He determines that the destruction occurred so quickly due to evidence of curvature propulsion within the vicinity of Trisolaris, thus marking it as a dangerous civilization capable of light-speed travel. Investigating the history of Trisolaris reveals to him a history of communication with another world via electromagnetic waves. These "Star-Pluckers" (due to humanity using the Sun to amplify their radio broadcasts) intrigue him, due to taking no precautions in hiding in the dark forest, especially after having so much time to develop black domain technology (and inadvertently highlighting themselves as either especially arrogant or technologically advanced). He picks up a mass dot before realizing that the presence of other planets would leave blind spots in the sun's destruction. He therefore lazily flicks a dual-vector foil at the solar system before going on to distract himself from the horror that his home world has decided to enter two dimensions.
Cheng Xin is woken from hibernation upon a dark forest attack warning. However, instead of the expected photoid strike, the attack takes the form of a paper-like projectile that begins to collapse space into two dimensions. Since the escape velocity is the speed of light, no human ships can escape, and the entire Solar System faces destruction in a matter of days. Cheng Xin and Ai AA are given a mission to fling selected human artifacts into space so as to safely preserve them in two dimensions, in hopes that later civilizations will be able to reconstruct or at least appreciate the artifacts. As the Solar System is inexorably collapsed into two dimensions, they take a ship provided by Wade's company to Pluto, where Luo Ji, who is now over 200 years old, maintains a museum of priceless human artifacts. Luo Ji reveals that the ship is, in fact, the only human ship capable of lightspeed travel, built in secret with his assistance. Cheng Xin belatedly realizes that the actual message from Yun Tianming was to research either curvature drive technology (it being needed for the creation of a black domain), or a way to reduce humanity into two-dimensional beings, and her earlier decree to terminate Wade's curvature drive technology research would now doom all humans that remained in the Solar System. Cheng Xin and Ai AA depart at lightspeed towards DX3906; Luo Ji chooses to remain on Pluto, and is destroyed along with the rest of the Solar System and every other human living there.
Focusing on Cheng Xin and Ai AA, the only survivors of the dark forest strike, and civilization founded by the surviving crews of Blue Space and Gravity and their descendants, referred to as "Galactic Humans". Cheng Xin and Ai AA travel to Planet Blue, which orbits star DX3906, and meet Guan Yifan, a crew member from Gravity who has been kept in hibernation for over 400 years. Humanity has colonized four planets with another two more in the process of terraforming. One planet has been lost in a black domain, placing itself in the black domain out of fear that it had been detected by another alien civilization. Planet Blue, despite being habitable, is only visited by expeditions due to its proximity to regular alien traffic. Galactic humans lost the location of the first Trisolaran fleet while the second Trisolaran fleet was engaged in a space battle, though Humanity is unaware who the victors of the battle were or the other combatants. Cheng Xin and Guan Yifan leave for an expedition aboard the latter's ship to investigate alien activity detected on a nearby planet. On the way Guan reveals that dimensional attacks like the one that destroyed the Solar System are being used throughout the Universe, and will eventually expand to cover the entire universe and shift it down to two dimensions. Such attacks are usually used by civilizations with the capability of reducing themselves into a lower dimension. Other civilizations are creating chains of black domains to form walls & boundaries in interstellar war. Such black domains will eventually chain together and all connect, resulting in the speed of light in a black domain becoming the new universal constant. It is hypothesized by Galaxy humans that some civilizations are even altering the laws of mathematics. Arriving at the planet, they discover evidence that the visiting aliens were using extreme curvature propulsion, the contrails of the engines having formed "death lines" where the speed of light in space is zero. They receive a call from Ai AA that Yun Tianming has arrived at Planet Blue. However, when attempting to return, Cheng Xin and Guan Yifan's ship is caught in a black domain, caused by the rupture of the deathlines expanding and raising the light speed within them above zero. They are forced to orbit Planet Blue at light speed for 16 days before they can boot up its neural computer and other reduced light speed electronics to slow it down normal speed. By this time, due to time dilation, over 18 million years have passed on Planet Blue, and Ai AA and Yun Tianming are long dead. Cheng Xin and Guan Yifan discover they have carved a message into the bedrock itself: instructions to enter into a miniature universe, constructed by surviving offshoots of Trisolaran civilization, and wait for the Big Crunch and subsequent Big Bang, so that the corrupted laws of physics can finally be reset. They enter the pocket universe, discovering an idyllic small farm administered by Sophon. Their plans to wait out the destruction of the universe are interrupted by a message sent by an unknown civilization to all pocket universes at great expense: the innumerable pocket dimensions created by various civilizations have reduced the mass of the Universe too much, preventing a Big Crunch. If the mass is not returned to the main Universe, a big rip will occur instead, the Universe will never reset, and there will be no life possible anywhere in the cosmos. To save the main Universe from this fate, Cheng Xin and Guan Yifan return all the mass in the pocket universe to the main universe, and leave the pocket universe in a spaceship to explore. They leave behind only a small self-contained habitat for some small fish, and a computer drive with the contained knowledge of Trisolaris and humanity, to serve as a sentimental "message in a bottle" to any far-future explorers after the Universe has finally been reborn. The fate of the Universe, as to whether the weight left in the pocket Universe would be the fate-altering weight that prevents a Big Crunch and causes the end of the Universe, was left untold.