Spies take note: from now on stow a little packet of salt upon your person. The fate of the free world may depend on it.

For generations, espionage – or, at least, childhood games and ripping yarns about espionage – involved at some point the application and revealing of invisible ink. Writing messages that can’t be seen by bad guys is a critical part of any decent spy’s tradecraft.

The trouble is, most invisible inks are anything but. Sure, they might look invisible – if that’s not a contradiction in terms – but as soon the shadowy code-breakers on the other side start applying a bit of heat or a few drops of acid to the paper, the message shows up bright and clear and the next thing you know 16 secret agents have been arrested.

Now, however, the problem may have been solved. A team of researchers led by Congyang Zhang of the Shanghai Jiao Tong University in China has come up with a truly invisible ink made from lead-based metal-organic frameworks, or MOFs.

MOFs are used in many fields for storage, carbon capture and the manufacture of pharmaceuticals and sensors. Typically, they are made of metal ions joined together by organic linkers. Essentially, they are crystalline powders full of molecule-sized holes.

Zhang’s team developed a lead-based MOF that is completely invisible yet can be used in a printer to produce detailed documents to order. Using heat or acid or any other traditional method to break the invisibility encryption is doomed to fail.

Applying salt, however, is another matter. Putting salt on the invisible MOF structures turns them into easily readable luminescent perovskite nanocrystals. This type of crystal is the focus of widespread research, because it has potential applications in fields as diverse as making liquid-crystal television displays and the manufacture of quantum dots.

In the invisible ink made by Zhang and his colleagues, the applied salt essentially works as a two-way switch. The first time it is deployed the crystals become visible and the message is revealed. A second application reverses the process, rendering the message unseeable once again.

The scientists imagine multiple applications in fields such as security and encryption for their new invention. Budding James Bonds, however, might care to consider one important aspect, before trying to place an order.

Being lead-based, the invisible ink is toxic. Zhang and his colleagues say they are working on developing a safer version, using a different type of base metal.

The research is published in the journal Nature Communications.