Bitcoin Forum
May 22, 2024, 08:51:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is technical difference between database and wallet.dat?  (Read 185 times)
coyotela (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
October 20, 2022, 02:13:00 PM
 #1

Hello,

What is technical difference between database and wallet.dat?
When one bitcoin is mined, this transaction is inside wallet our database files?

Thank you
Charles-Tim
Legendary
*
Offline Offline

Activity: 1554
Merit: 4907


Leading Crypto Sports Betting & Casino Platform


View Profile
October 20, 2022, 02:18:35 PM
 #2

The wallet file backup for Bitcoin Core is in wallet.dat. It is entirely different from blockchain which is an open ledger where bitcoin are stored.

Bitcoin is registered and stored on the blockchain, it is called an open ledger. I do not think it should be called database like those when referring to where data of a company or an organization is stored.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
October 20, 2022, 02:59:22 PM
Merited by bitmover (2)
 #3

Database also gives the impression it's something that's stored and accessible online (particularly from multiple devices/via an external host) which isn't the case for the wallet.dat bitcoin core uses.

It's more of a data file as the name suggests and a lot of systems with wallet.dats are normally the only one running with that file.

The blockchain may be explained as a database in a lot of contexts as it's a more innovative design of one - it's also not exactly a database as that's what your chainstate is - it's literally a log of transactions/commands.
seoincorporation
Legendary
*
Offline Offline

Activity: 3164
Merit: 2954


Top Crypto Casino


View Profile
October 20, 2022, 03:36:23 PM
 #4

Hello,

What is technical difference between database and wallet.dat?
When one bitcoin is mined, this transaction is inside wallet our database files?

Thank you

You can't compare a wallet.dat file with a database, they are two different things, but you can compare the Blockchain with a database.

The wallet.dat is a file where you have your privatekeys and address, but the information of the transactions isn't in that file, that info is part of the blockchain.

If you want to learn more about the wallet file, i would recommend the next article:
https://en.bitcoin.it/wiki/Wallet

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
October 20, 2022, 07:26:06 PM
Merited by ABCbits (1)
 #5

You can't compare a wallet.dat file with a database, they are two different things, but you can compare the Blockchain with a database.

Technically speaking wallet.dat is a database, as it reuses data storage solution from BerkeleyDB.
Functionally speaking, you are right, blockchain is our “database” (maybe “registry” is a better term) and wallet.dat only keeps users data needed to access his assets.

Database also gives the impression it's something that's stored and accessible online (…)

Oh, who remembers MicroSoft Access?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
October 20, 2022, 08:26:15 PM
Merited by NeuroticFish (3), ABCbits (2)
 #6

Hello,

What is technical difference between database and wallet.dat?
When one bitcoin is mined, this transaction is inside wallet our database files?

Thank you

A "database" is a generic term for any form of data access and storage. There are dozens of database structures and architectures in existence throughout all forms of technology.

"wallet.dat" is a specific file used for data storage by the Bitcoin Core wallet (and other wallets that are based off of the original Bitcoin Core design). It contains information specific to a single instance of the software such as private keys, addresses, and unspent transaction outputs.

Currently, when a block is solved more than ONE bitcoin comes into existence.  Instead, 6.25 bitcoins are created by the solo miner or mining pool that creates the block. Those bitcoins can then be split up and shared (by sending them with a transaction) to one or more participants in a mining pool.  In either case (creating 6.25 Bitcoins in a new block, or receiving 1 bitcoin in a transaction) the data is stored the same way.  It is represented in the blockchain as a transaction within a block, and it can additionally be represented in any form that a wallet software creator might want to within the wallet's storage (for example as an unspent output tracked with Bitcoin Core.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
October 20, 2022, 09:25:20 PM
 #7

Database also gives the impression it's something that's stored and accessible online (…)

Oh, who remembers MicroSoft Access?

Be careful what you say, many people were asking me at the start of the pandemic why no one uses Skype anymore and then everyone started using Teams (they're both compatible with each other) - just after companies realised zoom wasn't free/upped its prices.

They might find a way to reinvent Access.
nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5616


Self-proclaimed Genius


View Profile
October 21, 2022, 09:38:02 AM
 #8

I think his question is related to his other thread: http://bitcointalk.org/index.php?topic=5417467.0
which is about recovering the old mined 50bitcoins of his "friend".

Unfortunately, the block's (4111) coinbase transaction and the "generated" transaction displayed in his wallet doesn't match.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5829


not your keys, not your coins!


View Profile WWW
October 24, 2022, 09:44:48 AM
 #9

Hello,

What is technical difference between database and wallet.dat?
When one bitcoin is mined, this transaction is inside wallet our database files?

Thank you
A database is a computing concept for storing data in an organized fashion.
https://en.wikipedia.org/wiki/Database

The wallet.dat file stores your private keys.
It's pretty much all in this function: https://github.com/bitcoin/bitcoin/blob/master/src/wallet/walletdb.cpp#L322

The wallet.dat is either a BerkeleyDB database, or a SQLite database, depending on whether you have decided to make a descriptor wallet (SQLite if so).

The database is used as a key-value store, where every key always begins with a length prefixed ascii string indicating the type of the record. From there, the data stored depends on the record type and is just a bunch of different objects serialized. You will have to look at each object's serialization methods to figure that out.

BerkeleyDB is a key-value database so libraries for it provide access to that directly. For SQLite, the database is a single table with two columns, the first named "key" and the second "value".

There is no file that stores your Bitcoins.
Furthermore, when you mine a block (you don't mine a bitcoin), that block sits in your node's mempool (chainstate) and is broadcasted to other nodes. If it's not broadcasted, it doesn't exist on the blockchain and you got no block reward.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6753


bitcoincleanup.com / bitmixlist.org


View Profile WWW
October 26, 2022, 10:37:31 AM
 #10

There is no file that stores your Bitcoins.

That is because they are stored on the blockchain, which can be described simply as the collection of nodes (think about the Borg) that are running real databases with the transaction history.



The wallet.dat is a specific kind of database that stores addresses and private keys as well as wallet metadata. You need this, because you need a record for each private key and address and they have to be stored in one place.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!