Imagine a future in which a machine can scan your brain and migrate the essentials of your mind to a computer. It’s called mind uploading—preserving a person’s consciousness in a digital afterlife. As a neuroscientist, I’m convinced that mind uploading will happen someday. There are no laws of physics that stand in the way. It depends, however, on technology that has not yet been invented, so nobody knows when mind uploading might become available.

The brain relies on an elegant, underlying principle: A simple working part, the neuron, is repeated over and over to create complexity. The human brain contains about 86 billion neurons interconnected by about 100 trillion synapses. Information flows and transforms through those vast connected networks in complex and unpredictable patterns, creating the mind.

To upload a person’s mind, at least two technical challenges would need to be solved. First, we would need to build an artificial brain made of simulated neurons. Second, we would need to scan a person’s actual, biological brain and measure exactly how its neurons are connected to each other, to be able to copy that pattern in the artificial brain. Nobody knows if those two steps would really re-create a person’s mind or if other, subtler aspects of the biology of the brain must be copied as well, but it is a good starting place.

The first technical challenge is all but solved. Engineers already know how to create artificial, simulated neurons and connect them together through synapses. We can simulate networks of thousands or even millions of neurons. The modern wonders of artificial intelligence, like Siri or self-driving cars, depend on large artificial neural networks. Simulating a brain with 86 billion neurons is a little beyond current technology, but probably not for long. Computer technology is always improving.

The second challenge is much harder. A team of scientists at Albert Einstein College of Medicine recently used an electron microscope to map the complete “connectome”—the pattern of connectivity among all neurons—in a roundworm, a tiny creature that has about 300 neurons. The task required almost 10 years. It’s a milestone. But to upload a human brain, we probably want a scanner that doesn’t kill the subject, and we would need it to scan about a hundred million times as many details. That technology doesn’t yet exist. The most wildly optimistic predictions place mind uploading within a few decades, but I would not be surprised if it took centuries.