Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# CJDNS support in Bitcoin Core3It is possible to run Bitcoin Core over CJDNS, an encrypted IPv6 network that4uses public-key cryptography for address allocation and a distributed hash table5for routing.7## What is CJDNS?9CJDNS is like a distributed, shared VPN with multiple entry points where every10participant can reach any other participant. All participants use addresses from11the `fc00::/8` network (reserved IPv6 range). Installation and configuration is12done outside of Bitcoin Core, similarly to a VPN (either in the host/OS or on13the network router). See https://github.com/cjdelisle/cjdns#readme for more14information.16Compared to IPv4/IPv6, CJDNS provides end-to-end encryption and protects nodes17from traffic analysis and filtering.19Used with Tor and I2P, CJDNS is a complementary option that can enhance network20redundancy and robustness for both the Bitcoin network and individual nodes.22Each network has different characteristics. For instance, Tor is widely used but23somewhat centralized. I2P connections have a source address and I2P is slow.24CJDNS is fast but does not hide the sender and the recipient from intermediate25routers.27## Installing CJDNS29To install and set up CJDNS, follow the instructions at30https://github.com/cjdelisle/cjdns#how-to-install-cjdns.32## Connecting to the CJDNS network34As of CJDNS v22, nodes automatically discover and connect to peers via DNS35seeding. After installation, you can verify that your node has peers:37cjdnstool peers show39If you see peers with status `ESTABLISHED`, your node is connected and no40further peering setup is needed.42Manual peering may be useful if you want to guarantee a connection to a43specific node, or if you have disabled DNS seeding for privacy reasons. See44[doc/peering.md](https://github.com/cjdelisle/cjdns/blob/master/doc/peering.md)45in the CJDNS repository for details.47## Run Bitcoin Core with CJDNS49Once you are connected to the CJDNS network, the following Bitcoin Core50configuration option makes CJDNS peers automatically reachable:52```53-cjdnsreachable54```56When enabled, this option tells Bitcoin Core that it is running in an57environment where a connection to an `fc00::/8` address will be to the CJDNS58network instead of to an [RFC4193](https://datatracker.ietf.org/doc/html/rfc4193)59IPv6 local network. This helps Bitcoin Core perform better address management:60- Your node can consider incoming `fc00::/8` connections to be from the CJDNS61network rather than from an IPv6 private one.62- If one of your node's local addresses is `fc00::/8`, then it can choose to63gossip that address to peers.65## Additional configuration options related to CJDNS67```68-onlynet=cjdns69```71Make automatic outbound connections only to CJDNS addresses. Inbound and manual72connections are not affected by this option. It can be specified multiple times73to allow multiple networks, e.g. onlynet=cjdns, onlynet=i2p, onlynet=onion.75CJDNS support was added to Bitcoin Core in version 23.0 and there may be fewer76CJDNS peers than Tor or IP ones. Therefore, using CJDNS alone without other77networks is discouraged: a node may be unable to fill its outbound connection slots78but will repeatedly try the few addresses it knows and is more susceptible to79[Sybil attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack).80You can use `bitcoin-cli -addrinfo` to see the81number of CJDNS addresses known to your node.83In general, a node can be run with both an onion service and CJDNS (or any/all84of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if one of85the networks has issues. There are a number of ways to configure this; see86[doc/tor.md](/doc/tor.md) for87details.89## CJDNS-related information in Bitcoin Core91There are several ways to see your CJDNS address in Bitcoin Core:92- in the "Local addresses" output of CLI `-netinfo`93- in the "localaddresses" output of RPC `getnetworkinfo`95To see which CJDNS peers your node is connected to, use `bitcoin-cli -netinfo 4`96or the `getpeerinfo` RPC (i.e. `bitcoin-cli getpeerinfo`).98You can use the `getnodeaddresses` RPC to fetch a number of CJDNS peers known to your node; run `bitcoin-cli help getnodeaddresses` for details.100`bitcoin rpc` can also be substituted for `bitcoin-cli`.
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.