I'm writing a cyberpunk book and I'm trying to make it as hard-science as possible, my cyborgs have artificial eyes and an artificial optic nerve made of cyanobacteria inside a cable that transmit the electrical signals and chemicals from the artificial eye to the brain, is this possible?
The short answer is no.
The optic nerve isn't just a cable. It's bundle of "arms" extending from the lateral geniculate nucleus in the brain. It's actually more correct to think of the eyes as an extension of the human brain rather than a separate organ. In fact, brain organoids produced in the lab can be stimulated to generate rudimentary eyes quite easily, and in utero, the fetus's eyes form as an outgrowth of the brain.
Nerves themselves are not cells; rather they are the axons or dendrites extending from the cell bodies (called the soma). Axons carry impulses away from the cell body, dendrites carry it to the cell body. Both axons and dendrites terminate in one or more synapses, which are connections to other cell axons or dendrites. In fact, the fact that neurons have axons and dendrites is the reason they're the largest cells in the body. For example, it's not simply that neurons from your hand pass information to your brain, cells in your central nervous system, such as those in your spine, actually are as long as your arm. Your brain is literally integrated directly into your body.
This results in the distinctions known as "white matter" vs "grey matter." The white matter is the extensions, the "arms," of the central body of the cell, which is the grey matter. Nerves are entirely white matter, and thus they are not cells.
The optic nerve carries information from retinal cells, and so it is a dendritic extension.
When the optic nerve is severed, you're literally cutting a part of the neuron's body out, directly damaging the cell.
In the real world, cells damaged like this do not regrow and lose their ability to synapse (connect) to the eye. There are a number of chemical cues, dubbed "GO" and "NOGO" by scientists that study inter-cell signaling. GO and NOGO control whether or not the cell will grow its nerve extensions. One of the problems with the optic nerve is that damage to it results in strong "NOGO" signaling, which ultimately causes the nerve to decay.
A better scenario for your story would be to have the optic nerve "grow" into your artificial retina. In this case, you will need to overcome the inflammatory signaling that prevents the nerve from synapsing on your technology.
This is where you can use your bioengineered organisms. Cyanobacteria are far too small to use, so instead, my recommendation is to have specially engineered glial cells.
Glial cells are a special type of scaffolding cell in the central nervous system which hold and care for neurons. They are involved in the chemical communication of the brain and have a rich and complex chemical signaling language that rivals the electro-chemical communication between neurons in complexity.
So perhaps your scenario is this: An artificial eye with internal digital signal processing connects to a "wetware" chip. This wetware chip contains glial cells which have been bioengineered to guide and coax the dendrites of the optic nerve to connect to artificial synapses. The cells have been engineered to release strong GO signaling, while suppressing local NOGO signaling of the nerve. The optic nerve then grows into the wetware interface to connect to the cybernetic eye. The eye's internal DSP chip learns how best to communicate with the optic nerve through a combination of machine learning and complex calibration patterns which are fed to the optic nerve while observing the results of the visual cortex processing them.
After a few days of calibration, the user of the artificial eye begins to see better than they ever would have with a "Mark-1" biological eyeball.
A quick search shows that cyanobacteria use photosynthesis to live and thrive. Light hits the retina where the rods and cones are. These react to the light, sending an electrical pulse over the optic nerve. That means no light is in the optical nerve, making it an unhospitable environment fir the bacteria. They would all die.
Besides that there seems to be no discernible organisation or functions that can transmit a signal effectively. Normally highly specialised bundles of cells are used. Nerve cells in several forms for sending the information and maintaining the pathways. A random phylum simply can't be used for such complex transfer of information.
Not to mention the problems they would cause. They create oxygen, which is one of the worst thing you want anywhere. It is incredibly useful in many processes of the body, but that easy to react with things is also the reason for destruction. Fire and corrosion. You need to be able to get any such by products away safely.
In short: no. A cyanobacteria can't transfer the information, nor survive in the optical nerve. If you could solve the issues of organisation, communication and light, you still have a host of other problems to deal with.