Configuring an Air-gapped, Offline Computer
Cardano uses numerous cryptographic key pairs to secure your wallet and stake pool. A key pair is comprised of a public verification key file having the .vkey file name extension and a secret key file having an .skey extension. You use key pairs to generate addresses, certificates and other related files securely. For more details, see Cardano Key Pairs.
Store and safeguard the sensitive secret (private) keys for your stake pool using an air-gapped, offline computer. The most effective technique to prevent private key exposure is to guarantee that a necessary private key is never held for any length of time on any Internet-connected computer, also known as a hot node. Your air-gapped, offline computer may also be referred to as a cold environment.
Your air-gapped, offline computer:
- Protects against key-logging attacks; malware- or virus-based attacks; and, other firewall or security exploits
- Must not have a wired or wireless network connection
- Is not a virtual machine (VM) on a computer having a network connection
- Is physically isolated from the rest of your network
Read more about requirements to Air Gap.
System Requirements
The system requirements for the air-gapped, offline computer that you use to support your stake pool operation are minimal:
- The computer must use the same operating system that you install on your hot nodes.
- To facilitate transporting files to and from your block-producing node using a USB stick or other removable media, your cold environment requires a USB port.
For example, you may use a Raspberry Pi or an upcycled older computer or laptop.
Copying the Cardano CLI Binary
Copy the cardano-cli binary that you produced when Compiling Cardano Node to your air-gapped, offline computer.
To copy the cardano-cli binary to your cold environment:
1. Insert the removable media that you want to use to transfer files into a hot node where you compiled the cardano-cli binary.
2. If you followed the CoinCashew guide, then copy the cardano-cli binary located in the folder /usr/local/bin/ to the removable media that you inserted in step 1
If you do not know the location of the cardano-cli binary, then type which cardano-cli
3. Eject the removable media from your hot node, and then insert the removable media into your air-gapped, offline computer.
4. On your air-gapped, offline computer, copy the cardano-cli binary from the removable media to the /usr/local/bin/ folder.
5. To give execute permissions to the cardano-cli binary, type:
sudo chmod +x /usr/local/bin/cardano-cli
Challenge | To list shared libraries that Cardano CLI requires to run as well as the full path where the dynamic linker expects to find the libraries, type libsodium.so.23 => /usr/local/lib/libsodium.so.23 |
Setting the NODE_HOME Environment Variable
For convenience when following the CoinCashew guide, create a NODE_HOME environment variable on your air-gapped, offline computer set to the same file path that you set on your block-producing and relay nodes when Installing Shared Libraries.
To create a NODE_HOME environment variable:
1. On your air-gapped, offline computer, open the file $HOME/.bashrc using a text editor, and then add the following line at the end of the file:
export NODE_HOME="$HOME/cardano-node"
2. To create the folder set for the NODE_HOME environment variable in the $HOME/.bashrc file, type:
mkdir $HOME/cardano-node
3. To reload your shell profile, type:
source $HOME/.bashrc
Installing libsecp256k1
To use the cardano-cli binary on your air-gapped, offline computer you must also install the libsecp256k1 library that you installed on your hot nodes. Use the following procedure to install libsecp256k1 without connecting your air-gapped, offline computer to the Internet.
To install the libsecp256k1 library on your air-gapped, offline computer:
1. On the air-gapped, offline computer, open the $HOME/.bashrc file using a text editor, and then add the following lines at the end of the file:
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
2. Save and close the $HOME/.bashrc file.
3. To reload the $HOME/.bashrc file, type:
source $HOME/.bashrc
4. On the air-gapped, offline computer, if the /usr/local/lib/pkgconfig folder does not exist, then type the following command to create the folder:
sudo mkdir /usr/local/lib/pkgconfig
5. Using removable media, copy the following files from a block-producing or relay node where you installed libsecp256k1 to the same location on your air-gapped, offline computer:
/usr/local/lib/libsecp256k1.a
/usr/local/lib/libsecp256k1.la
/usr/local/lib/libsecp256k1.so.2.0.2
/usr/local/lib/pkgconfig/libsecp256k1.pc
/usr/local/include/secp256k1_ecdh.h
/usr/local/include/secp256k1_ellswift.h
/usr/local/include/secp256k1_extrakeys.h
/usr/local/include/secp256k1.h
/usr/local/include/secp256k1_musig.h
/usr/local/include/secp256k1_preallocated.h
/usr/local/include/secp256k1_schnorrsig.h
6. To set file permissions and ownership for the libsecp256k1 library files on the air-gapped, offline computer, type the following commands using a terminal window:
cd /usr/local/lib
sudo chown root:root libsecp256k1.*
sudo chmod 644 libsecp256k1.a
sudo chmod 755 libsecp256k1.la
sudo chmod 755 libsecp256k1.so.2.0.2
sudo chown root:root ./pkgconfig/libsecp256k1.pc
sudo chmod 644 ./pkgconfig/libsecp256k1.pc
cd /usr/local/include
sudo chown root:root secp256k1*
sudo chmod 644 secp256k1*
7. To create symbolic links, type:
cd /usr/local/lib
sudo ln -s libsecp256k1.so.2.0.2 libsecp256k1.so
sudo ln -s libsecp256k1.so.2.0.2 libsecp256k1.so.2
8. Type ls -la and then confirm that in step 7 you created the following symbolic links:
lrwxrwxrwx root root libsecp256k1.so -> libsecp256k1.so.2.0.2
lrwxrwxrwx root root libsecp256k1.so.2 -> libsecp256k1.so.2.0.2
9. To update available symbolic links for currently shared libraries, type:
sudo ldconfig
10. To verify that the libsecp256k1 library is recognized, type ldconfig -p | grep libsecp256k1 and then confirm that the output includes the following line:
libsecp256k1.so.2 (libc6,x86-64) => /usr/local/lib/libsecp256k1.so.2
Installing Sodium
On your air-gapped, offline computer, without connecting to the Internet install the Sodium release that IOHK maintains.
To install the IOHK Sodium release without connecting to the Internet:
1. Using removable media, copy the following files and folders from a block-producing or relay node where you installed Sodium to the same location on your air-gapped, offline computer:
/usr/local/lib/libsodium.a
/usr/local/lib/libsodium.la
/usr/local/lib/libsodium.so.23.3.0
/usr/local/lib/pkgconfig/libsodium.pc
/usr/local/include/sodium.h
/usr/local/include/sodium/
2. To set file permissions and ownership for the Sodium library files and folders on the air-gapped, offline computer type the following commands using a terminal window:
sudo chown root:root /usr/local/lib/libsodium.*
sudo chmod 755 /usr/local/lib/libsodium.*
sudo chmod 644 /usr/local/lib/libsodium.a
sudo chown root:root /usr/local/lib/pkgconfig/libsodium.pc
sudo chmod 644 /usr/local/lib/pkgconfig/libsodium.pc
sudo chown root:root /usr/local/include/sodium.h
sudo chmod 644 /usr/local/include/sodium.h
sudo chown -R root:root /usr/local/include/sodium/
sudo chmod -R 644 /usr/local/include/sodium/
sudo chmod 755 /usr/local/include/sodium/
3. To create symbolic links. type:
cd /usr/local/lib
sudo ln -s libsodium.so.23.3.0 libsodium.so
sudo ln -s libsodium.so.23.3.0 libsodium.so.23
4. Type ls -la and then confirm that in step 3 you created the following symbolic links:
lrwxrwxrwx root root libsodium.so -> libsodium.so.23.3.0
lrwxrwxrwx root root libsodium.so.23 -> libsodium.so.23.3.0
5. To update available symbolic links for currently shared libraries, type:
sudo ldconfig
6. To verify that the IOHK Sodium shared library is recognized, type ldconfig -p | grep libsodium and then confirm that the output includes the following line:
libsodium.so.23 (libc6,x86-64) => /usr/local/lib/libsodium.so.23
Installing the blst Library
To install the blst library on your air-gapped, offline computer without connecting to the Internet:
1. Using removable media, copy the blst folder from a block-producing or relay node where you installed the library to your air-gapped, offline computer.
2. Type the following commands:
cd blst
sudo cp libblst.pc /usr/local/lib/pkgconfig/
sudo cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/
sudo cp libblst.a /usr/local/lib
sudo chmod u=rw,go=r /usr/local/{lib/{libblst.a,pkgconfig/libblst.pc},include/{blst.{h,hpp},blst_aux.h}}
3. To update available symbolic links for currently shared libraries, type:
sudo ldconfig
