<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eklitzke</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Eklitzke"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Eklitzke"/>
	<updated>2026-05-24T23:26:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Satoshi_Client_Node_Discovery&amp;diff=64267</id>
		<title>Satoshi Client Node Discovery</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Satoshi_Client_Node_Discovery&amp;diff=64267"/>
		<updated>2017-11-22T00:15:42Z</updated>

		<summary type="html">&lt;p&gt;Eklitzke: update dns seed list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Overview==&lt;br /&gt;
&lt;br /&gt;
The Satoshi client discovers the IP address and port of nodes in several different ways.&lt;br /&gt;
&lt;br /&gt;
# Nodes discover their own external address by various methods.&lt;br /&gt;
# Nodes receive the callback address of remote nodes that connect to them.&lt;br /&gt;
# Nodes makes DNS request to receive IP addresses.&lt;br /&gt;
# Nodes can use addresses hard coded into the software.&lt;br /&gt;
# Nodes exchange addresses with other nodes.&lt;br /&gt;
# Nodes store addresses in a database and read that database on startup.&lt;br /&gt;
# Nodes can be provided addresses as command line arguments&lt;br /&gt;
# Nodes read addresses from a user provided text file on startup&lt;br /&gt;
&lt;br /&gt;
A timestamp is kept for each address to keep track of when the node&lt;br /&gt;
address was last seen. The AddressCurrentlyConnected in [https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp net.cpp] handles&lt;br /&gt;
updating the timestamp whenever a message is received from a node.&lt;br /&gt;
Timestamps are only updated on an address and saved to the database&lt;br /&gt;
when the timestamp is over 20 minutes old.&lt;br /&gt;
&lt;br /&gt;
See the Node Connectivity article for information on which type of&lt;br /&gt;
addresses take precedence when actually connecting to nodes.&lt;br /&gt;
&lt;br /&gt;
In the first section we will cover how a node handles a request for&lt;br /&gt;
addresses via the &amp;quot;getaddr&amp;quot; message. By understanding the role of&lt;br /&gt;
timestamps, it will become more clear why timestamps are kept the way&lt;br /&gt;
they are for each of the different ways an address is discovered.&lt;br /&gt;
&lt;br /&gt;
==Handling Message &amp;quot;getaddr&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
When a node receives a &amp;quot;getaddr&amp;quot; request, it first figures out how many&lt;br /&gt;
addresses it has that have a timestamp in the last 3 hours.&lt;br /&gt;
Then it sends those addresses, but if there are more than 2500 addresses&lt;br /&gt;
seen in the last 3 hours, it selects around 2500 out of the available&lt;br /&gt;
recent addresses by using random selection.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now lets look at the ways a node finds out about node addresses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Discovery Methods==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Local Client&#039;s External Address===&lt;br /&gt;
The client uses public web services which return the information to determine its own external, routable IP address.&lt;br /&gt;
&lt;br /&gt;
The client runs a thread called ThreadGetMyExternalIP (in [https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp net.cpp])&lt;br /&gt;
which attempts to determine the client&#039;s IP address as seen from the outside&lt;br /&gt;
world.&lt;br /&gt;
&lt;br /&gt;
First, it attempts to connect to 91.198.22.70 port 80, which should be&lt;br /&gt;
the checkip.dyndns.org server. If connection fails, a DNS request is made&lt;br /&gt;
for checkip.dyndns.org and a connection is attempted to that address.&lt;br /&gt;
Next, it attempts to connect to 74.208.43.192 port 80, which should be&lt;br /&gt;
the www.showmyip.com server. If connection fails, a DNS request is made&lt;br /&gt;
for www.showmyip.com and a connection is attempted to that address.&lt;br /&gt;
&lt;br /&gt;
For each address attempted above, the client attempts to connect,&lt;br /&gt;
send a HTTP request, read the appropriate response line, and parse the&lt;br /&gt;
IP address from it.&lt;br /&gt;
If this succeeds, the IP address is returned, it is advertised to any connected&lt;br /&gt;
nodes, and then the thread finishes (without proceeding to the next&lt;br /&gt;
address).&lt;br /&gt;
&lt;br /&gt;
===Connect Callback Address===&lt;br /&gt;
When a node receives an initial &amp;quot;version&amp;quot; message, and that node initiated the connection, then the node advertises its address to the remote so that it can connect back to the local node if it wants to.&lt;br /&gt;
&lt;br /&gt;
After sending its own address, it sends a &amp;quot;getaddr&amp;quot; request message to the remote node to learn about more addresses, if the remote node version is recent or if the local node does not yet have 1000 addresses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===IRC Addresses===&lt;br /&gt;
&lt;br /&gt;
As of version 0.6.x the Bitcoin client no longer uses IRC bootstrapping by default, and as of version 0.8.2 support for IRC bootstrapping has been removed completely.  This documentation below is accurate for most prior versions.&lt;br /&gt;
&lt;br /&gt;
In addition to learning and sharing its own address, the node learned about other node addresses via an IRC channel. See [https://github.com/bitcoin/bitcoin/blob/847593228de8634bf6ef5933a474c7e63be59146/src/irc.cpp irc.cpp].&lt;br /&gt;
&lt;br /&gt;
After learning its own address, a node encoded its own address into a string to be used as a nickname. Then, it randomly joined an IRC channel named between #bitcoin00 and #bitcoin99. Then it issued a WHO command. The thread read the lines as they appeared in the channel and decoded the IP addresses of other nodes in the channel. It did this in a loop, forever, until the node was shutdown.&lt;br /&gt;
&lt;br /&gt;
When the client discovered an address from IRC, it set the timestamp on the address to the current time, but it used a &amp;quot;penalty&amp;quot; of 51 minutes, which means it looked like it was actually seen almost an hour earlier.&lt;br /&gt;
&lt;br /&gt;
===DNS Addresses===&lt;br /&gt;
Upon startup, if peer node discovery is needed, the client then issues DNS requests to learn about the addresses of other peer nodes.  The client includes a list of host names for DNS services that are seeded.  As of November, 2017 the list (from chainparams.cpp&amp;lt;ref&amp;gt;[https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L139 bitcoin/src/chainparams.cpp at master]&amp;lt;/ref&amp;gt;) includes:&lt;br /&gt;
&lt;br /&gt;
* seed.bitcoin.sipa.be&lt;br /&gt;
* dnsseed.bluematt.me&lt;br /&gt;
* dnsseed.bitcoin.dashjr.org&lt;br /&gt;
* seed.bitcoinstats.com&lt;br /&gt;
* seed.bitcoin.jonasschnelli.ch&lt;br /&gt;
* seed.btc.petertodd.org&lt;br /&gt;
&lt;br /&gt;
A DNS reply can contain multiple IP addresses for a requested name.&lt;br /&gt;
&lt;br /&gt;
Addresses discovered via DNS are initially given a zero timestamp, therefore they are not advertised in response to a &amp;quot;getaddr&amp;quot; request.&lt;br /&gt;
&lt;br /&gt;
===Hard Coded &amp;quot;Seed&amp;quot; Addresses===&lt;br /&gt;
The client contains hard coded IP addresses that represent bitcoin nodes.&lt;br /&gt;
&lt;br /&gt;
These addresses are only used as a last resort, if no other method has produced any addresses at all. When the loop in the connection handling thread ThreadOpenConnections2() sees an empty address map, it uses the &amp;quot;seed&amp;quot; IP addresses as backup.&lt;br /&gt;
&lt;br /&gt;
There is code is move away from seed nodes when possible. The presumption is that this is to avoid overloading those nodes. Once the local node has enough addresses (presumably learned from the seed nodes), the connection thread will close seed node connections.&lt;br /&gt;
&lt;br /&gt;
Seed Addresses are initially given a zero timestamp,&lt;br /&gt;
therefore they are not advertised in response to a &amp;quot;getaddr&amp;quot; request.&lt;br /&gt;
&lt;br /&gt;
===Ongoing &amp;quot;addr&amp;quot; advertisements===&lt;br /&gt;
Nodes may receive addresses in an &amp;quot;addr&amp;quot; message after having sent a &amp;quot;getaddr&amp;quot; request, or &amp;quot;addr&amp;quot; messages may arrive  unsolicited, because nodes advertise addresses gratuitously when they relay addresses (see below), when they advertise their own address periodically, and when a connection is made.&lt;br /&gt;
&lt;br /&gt;
If the address is from a really old version, it is ignored; if from a not-so-old version, it is ignored if we have 1000 addresses already.&lt;br /&gt;
&lt;br /&gt;
If the sender sent over 1000 addresses, they are all ignored.&lt;br /&gt;
&lt;br /&gt;
Addresses received from an &amp;quot;addr&amp;quot; message have a timestamp, but the timestamp is not necessarily honored directly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For every address in the message:&lt;br /&gt;
# If the timestamp is too low or too high, it is set to 5 days ago.&lt;br /&gt;
# We subtract 2 hours from the timestamp and add the address.&lt;br /&gt;
&lt;br /&gt;
Note that when any address is added, for any reason, the code that calls AddAddress() does not check to see if it already exists. The AddAddresss() function in [https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp net.cpp] will do that, and if the address already exists, further processing is done to update the address record. If the advertised services of the address have changed, that is updated and stored.&lt;br /&gt;
&lt;br /&gt;
If the address has been seen in the last 24 hours and the timestamp is currently over 60 minutes old, then it is updated to 60 minutes ago.&lt;br /&gt;
&lt;br /&gt;
If the address has NOT been seen in the last 24 hours, and the timestamp is currently over 24 hours old, then it is updated to 24 hours ago.&lt;br /&gt;
&lt;br /&gt;
====Address Relay====&lt;br /&gt;
&lt;br /&gt;
Once addresses are added from an &amp;quot;addr&amp;quot; message (see above), they then may be relayed to the other nodes. First, the following criteria must be set [9]:&lt;br /&gt;
&lt;br /&gt;
#The address timestamp, after processing, is within 60 minutes of the current time&lt;br /&gt;
#The &amp;quot;addr&amp;quot; message contains 10 addresses or less&lt;br /&gt;
#And fGetAddr is not set on the node. fGetAddr starts false, is set to true when we request addresses from a node, and it is cleared when we receive less than 1000 addresses from a node.&lt;br /&gt;
#The address must be routable.&lt;br /&gt;
&lt;br /&gt;
For every address that meets the above criteria, the node hash the address, the current day (in the form of an integer), and a random 256 bit value (generated at client startup). The node takes the two addresses with the lowest hash values and relays &amp;quot;addr&amp;quot; messages to them. This ensures that each node only relays &amp;quot;addr&amp;quot; messages to two other clients at any given time, that the two other clients are randomly selected, and that the random selection starts over at least once every 24 hours.&lt;br /&gt;
&lt;br /&gt;
====Self broadcast====&lt;br /&gt;
&lt;br /&gt;
Every 24 hours, the node advertises its own address to all connected nodes.&lt;br /&gt;
&lt;br /&gt;
It also clears the list of the addresses we think the remote node has, which will trigger a refresh of sends to nodes. This code is in SendMessages() in [https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp main.cpp].&lt;br /&gt;
&lt;br /&gt;
====Old Address Cleanup====&lt;br /&gt;
&lt;br /&gt;
In SendMessages() in [https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp main.cpp], there is code to remove old addresses.&lt;br /&gt;
&lt;br /&gt;
This is done every ten minutes, as long as there are 3 active connections.&lt;br /&gt;
&lt;br /&gt;
The node erases messages that have not been used in 14 days as long as there are at least 1000 addresses in the map, and as long as the erasing process has not taken more than 20 seconds.&lt;br /&gt;
&lt;br /&gt;
===Addresses stored in the Database===&lt;br /&gt;
Addresses are stored in the database when AddAddress() is called.&lt;br /&gt;
&lt;br /&gt;
Addresses are read on startup when AppInit2() calls LoadAddresses(), which is located in [https://github.com/bitcoin/bitcoin/blob/master/src/db.cpp db.cpp].&lt;br /&gt;
&lt;br /&gt;
Currently, it appears all addresses are stored all at once whenever any address is stored or updated&amp;lt;ref&amp;gt;[http://bitcointalk.org/index.php?topic=26436.0 Lots of disk activity on Bitcoin startup: easy fix?]&amp;lt;/ref&amp;gt;. Indeed, AddAddress is seen to take over .01 seconds in various testing and is typically called tens of thousands of times in the initial 12 hours of running the client.&lt;br /&gt;
&lt;br /&gt;
===Command Line Provided Addresses===&lt;br /&gt;
&lt;br /&gt;
The user can specify nodes to connect to with the&lt;br /&gt;
 -addnode &amp;lt;ip&amp;gt; &lt;br /&gt;
command line argument. Multiple nodes may be specified.&lt;br /&gt;
&lt;br /&gt;
Addresses provided on the command line are initially given a zero timestamp, therefore they are not advertised in response to a &amp;quot;getaddr&amp;quot; request.&lt;br /&gt;
&lt;br /&gt;
The user can also specify an address to connect to with the -connect &amp;lt;ip&amp;gt;&lt;br /&gt;
command line argument. Multiple nodes may be specified.&lt;br /&gt;
&lt;br /&gt;
The -connect argument differs from -addnode in that -connect addresses are not added to the address database and when -connect is specified, only those addresses are used.&lt;br /&gt;
&lt;br /&gt;
===Text File Provided Addresses===&lt;br /&gt;
&lt;br /&gt;
The client will automatically read a file named &amp;quot;addr.txt&amp;quot; in the bitcoin data directory and will add any addresses it finds in there as node addresses. These nodes are given no special preference over other addresses. They are just added to the pool.&lt;br /&gt;
&lt;br /&gt;
Addresses loaded from the text file are initially given a zero timestamp, therefore they are not advertised in response to a &amp;quot;getaddr&amp;quot; request.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Network#Bootstrapping|Network - Boostrapping]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>Eklitzke</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=User:Eklitzke&amp;diff=64246</id>
		<title>User:Eklitzke</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=User:Eklitzke&amp;diff=64246"/>
		<updated>2017-11-19T20:18:10Z</updated>

		<summary type="html">&lt;p&gt;Eklitzke: Created page with &amp;quot;I am Evan Klitzke. I have [https://eklitzke.org/ a website] and a [https://github.com/eklitzke a GitHub].&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I am Evan Klitzke. I have [https://eklitzke.org/ a website] and a [https://github.com/eklitzke a GitHub].&lt;/div&gt;</summary>
		<author><name>Eklitzke</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Data_directory&amp;diff=64245</id>
		<title>Data directory</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Data_directory&amp;diff=64245"/>
		<updated>2017-11-19T20:12:22Z</updated>

		<summary type="html">&lt;p&gt;Eklitzke: /* chainstate subdirectory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The data directory is the location where Bitcoin&#039;s data files are stored, including the [[Wallet|wallet]] data file.&lt;br /&gt;
&lt;br /&gt;
==Default Location==&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
Go to Start -&amp;gt; Run (or press WinKey+R) and run this:&lt;br /&gt;
&lt;br /&gt;
 %APPDATA%\Bitcoin&lt;br /&gt;
&lt;br /&gt;
Bitcoin&#039;s data folder will open. For most users, this is the following locations:&lt;br /&gt;
&lt;br /&gt;
 C:\Documents and Settings\YourUserName\Application data\Bitcoin (XP)&lt;br /&gt;
 &lt;br /&gt;
 C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Vista and 7)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;AppData&amp;quot; and &amp;quot;Application data&amp;quot; are hidden by default.&lt;br /&gt;
&lt;br /&gt;
You can also store Bitcoin data files in any other drive or folder. &lt;br /&gt;
&lt;br /&gt;
If you have already downloaded the data then you will have to move the data to the new folder.&lt;br /&gt;
If you want to store them in D:\BitcoinData then click on &amp;quot;Properties&amp;quot; of a shortcut to bitcoin-qt.exe and&lt;br /&gt;
add -datadir=D:\BitcoinData at the end as an example:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;C:\Program Files (x86)\Bitcoin\bitcoin-qt.exe&amp;quot; -datadir=d:\BitcoinData&lt;br /&gt;
&lt;br /&gt;
Start Bitcoin, now you will see all the files are created in the new data directory.&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
By default Bitcoin will put its data here:&lt;br /&gt;
&lt;br /&gt;
 ~/.bitcoin/&lt;br /&gt;
&lt;br /&gt;
You need to do a &amp;quot;ls -a&amp;quot; to see directories that start with a dot.&lt;br /&gt;
&lt;br /&gt;
If that&#039;s not it, you can do a search like this:&lt;br /&gt;
&lt;br /&gt;
 find / -name wallet.dat -print 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
=== Mac ===&lt;br /&gt;
&lt;br /&gt;
By default Bitcoin will put its data here:&lt;br /&gt;
&lt;br /&gt;
 ~/Library/Application Support/Bitcoin/&lt;br /&gt;
&lt;br /&gt;
==Directory Contents==&lt;br /&gt;
&lt;br /&gt;
===Files===&lt;br /&gt;
&lt;br /&gt;
An overview of these is in [https://github.com/bitcoin/bitcoin/blob/master/doc/files.md files.md] in the Bitcoin Core documentation.&lt;br /&gt;
&lt;br /&gt;
* .lock&lt;br /&gt;
** Bitcoin data directory lock file&lt;br /&gt;
* bitcoin.conf [optional]&lt;br /&gt;
**Contains [[Running_Bitcoin#Bitcoin.conf_Configuration_File|configuration options]].  &lt;br /&gt;
* blk&#039;&#039;xxxx&#039;&#039;.dat [Versions prior to v0.8.0]&lt;br /&gt;
**Contains concatenated raw blocks.  Stored are actual Bitcoin blocks, in network format, dumped to disk raw.&lt;br /&gt;
* blkindex.dat [Versions prior to v0.8.0]&lt;br /&gt;
**Indexing information used with blk&#039;&#039;xxxx&#039;&#039;.dat&lt;br /&gt;
* __db.&#039;&#039;xxx&#039;&#039;&lt;br /&gt;
**Used by BDB&lt;br /&gt;
* db.log&lt;br /&gt;
* debug.log&lt;br /&gt;
**Bitcoin&#039;s verbose log file. Automatically trimmed from time to time.&lt;br /&gt;
* wallet.dat&lt;br /&gt;
**Storage for keys, transactions, metadata, and options. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Please be sure to make backups of this file.  It contains the keys necessary for spending your bitcoins.&amp;lt;/span&amp;gt;&lt;br /&gt;
* addr.dat [Versions prior to v0.7.0]&lt;br /&gt;
** Storage for ip addresses to make a reconnect easier&lt;br /&gt;
* peers.dat [Versions v0.7.0 and later]&lt;br /&gt;
** Storage for peer information to make a reconnect easier.  This file uses a bitcoin-specific file format, unrelated to any database system&amp;lt;ref&amp;gt;[http://bitcointalk.org/index.php?topic=119525.msg1287284#msg1287284 Ultraprune merged in mainline]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
* fee_estimates.dat [Versions v0.10.0 and later]&lt;br /&gt;
** Statistics used to estimate fees and priorities. Saved just before program shutdown, and read in at startup.&lt;br /&gt;
The data, index and log files are used by Oracle [http://en.wikipedia.org/wiki/Berkeley_DB Berkeley DB], the embedded key/value data store that Bitcoin uses.&lt;br /&gt;
&lt;br /&gt;
===database subdirectory===&lt;br /&gt;
Contains BDB journaling files&lt;br /&gt;
&lt;br /&gt;
===testnet3 subdirectory===&lt;br /&gt;
Contains testnet versions of these files (if running with -testnet)&lt;br /&gt;
&lt;br /&gt;
===blocks subdirectory===&lt;br /&gt;
[v0.8 and above] Contains blockchain data.  &lt;br /&gt;
&lt;br /&gt;
* blk*.dat &lt;br /&gt;
** Stored are actual Bitcoin blocks, in network format, dumped to disk raw.  They are only needed for re-scanning missing transactions in a wallet, reorganizing to a different part of the chain, and serving the block data to other nodes that are synchronizing.&lt;br /&gt;
&lt;br /&gt;
* blocks/index subdirectory&lt;br /&gt;
** [v0.8 and above] A LevelDB database that contains metadata about all known blocks, and where to find them on disk. Without this, finding a block would be very slow.&lt;br /&gt;
&lt;br /&gt;
===chainstate subdirectory===&lt;br /&gt;
[v0.8 and above] A LevelDB database with a compact representation of all currently unspent transaction outputs and some metadata about the transactions they are from. The data here is necessary for validating new incoming blocks and transactions. It can theoretically be rebuilt from the block data (see the -reindex command line option), but this takes a rather long time. Without it, you could still theoretically do validation indeed, but it would mean a full scan through the blocks (150 GB as of Nov 2017) for every output being spent.&lt;br /&gt;
&lt;br /&gt;
===locks subdirectory===&lt;br /&gt;
[v0.8 and above] Contains &amp;quot;undo&amp;quot; data. &lt;br /&gt;
&lt;br /&gt;
* rev*.dat&lt;br /&gt;
You can see blocks as &#039;patches&#039; to the chain state (they consume some unspent outputs, and produce new ones), and see the undo data as reverse patches. They are necessary for rolling back the chainstate, which is necessary in case of reorganizations.&lt;br /&gt;
&lt;br /&gt;
===Personally identifiable data [v0.8 and above]===&lt;br /&gt;
This section may be of use to you if you wish to send a friend the blockchain, avoiding them a hefty download.&lt;br /&gt;
&lt;br /&gt;
*wallet.dat&lt;br /&gt;
**Contains addresses and transactions linked to them. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Please be sure to make backups of this file.  It contains the keys necessary for spending your bitcoins.&amp;lt;/span&amp;gt; You should not transfer this file to any third party or they may be able to access your bitcoins.&lt;br /&gt;
*db.log&lt;br /&gt;
**May contain information pertaining to your wallet. It may be safely deleted.&lt;br /&gt;
*debug.log&lt;br /&gt;
**May contain IP addresses and transaction ID&#039;s. It may be safely deleted.&lt;br /&gt;
*database/ folder&lt;br /&gt;
**This should only exist when bitcoin-qt is currently running. It contains information (BDB state) relating to your wallet.&lt;br /&gt;
*peers.dat&lt;br /&gt;
**Unknown whether this contains personally identifiable data. It may be safely deleted.&lt;br /&gt;
&lt;br /&gt;
Other files and folders (blocks, blocks/index, chainstate) may be safely transferred/archived as they contain information pertaining only to the public blockchain.&lt;br /&gt;
&lt;br /&gt;
==Transferability==&lt;br /&gt;
&lt;br /&gt;
The database files in the &amp;quot;blocks&amp;quot; and &amp;quot;chainstate&amp;quot; directories are cross-platform, and can be copied between different installations. These files, known collectively as a node&#039;s &amp;quot;block database&amp;quot;, represent all of the information downloaded by a node during the syncing process. In other words, if you copy installation A&#039;s block database into installation B, installation B will then have the same syncing percentage as installation A. This is usually &#039;&#039;far&#039;&#039; faster than doing the normal initial sync over again. However, when you copy someone&#039;s database in this way, you are trusting them &#039;&#039;&#039;absolutely&#039;&#039;&#039;. Bitcoin Core treats its block database files as 100% accurate and trustworthy, whereas during the normal initial sync it treats each block offered by a peer as invalid until proven otherwise. If an attacker is able to modify your block database files, then they can do all sorts of evil things which could cause you to lose bitcoins. Therefore, you should only copy block databases from Bitcoin installations under your personal control, and only over a secure connection.&lt;br /&gt;
&lt;br /&gt;
Each node has a unique block database, and all of the files are highly connected. So if you copy just a few files from one installation&#039;s &amp;quot;blocks&amp;quot; or &amp;quot;chainstate&amp;quot; directories into another installation, this will almost certainly cause the second node to crash or get stuck at some random point in the future. If you want to copy a block database from one installation to another, you have to delete the old database and copy &#039;&#039;all&#039;&#039; of the files at once. Both nodes have to be shut down while copying.&lt;br /&gt;
&lt;br /&gt;
Only the file with the highest number in the &amp;quot;blocks&amp;quot; directory is ever written to. The earlier files will never change. Also, when these blk*.dat files are accessed, they are usually accessed in a highly sequential manner. Therefore, it&#039;s possible to symlink the &amp;quot;blocks&amp;quot; directory or some subset of the blk*.dat files individually onto a magnetic storage drive without much loss in performance (see [[Splitting the data directory]]), and if two installations start out with identical block databases (due to the copying described previously), subsequent runs of rsync will be very efficient.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Running Bitcoin]]&lt;br /&gt;
* [[Securing your wallet]]&lt;br /&gt;
* [[Splitting the data directory]]&lt;br /&gt;
* [http://bitcoin.stackexchange.com/a/11108/153 What is the database for?] Question on Bitcoin Stack Exchange&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
&lt;br /&gt;
[[es:Directorio de datos]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Eklitzke</name></author>
	</entry>
</feed>