Bitcoin Forum
November 05, 2024, 06:43:06 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Open and edit wallet.dat  (Read 1604 times)
Satosh¡ Slot (OP)
Full Member
***
Offline Offline

Activity: 164
Merit: 100


Indie Developer


View Profile WWW
July 04, 2014, 02:20:19 AM
 #1

I've seen that it's possible to delete priv keys from wallet.dat with pywallet but I also would like to be able to clear local balance transfers between labels that bitcoind handles. Has anyone successfully did this?

The bitcoin wiki reveiles that: The data, index and log files are used by Oracle Berkeley DB, the embedded key/value data store that Bitcoin uses.

I'm trying to install the Berkley Database now but wondering if there actually anyone that managed to edit things freely in the wallet.dat file.

Thanks!

2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1073



View Profile
July 04, 2014, 02:44:59 AM
 #2

Yeah, just install the correct version of BerkeleyDB utilities. Then do a backup, modify/delete the unnecessary lines from the backup file (which is a text file) and restore back.

Please remember to create DB_CONFIG file with "set_lg_dir database" in the appropriate directory.

Detail were discussed several time on this site, at least a year ago.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 04, 2014, 03:17:17 AM
 #3

Depending on what you are looking to do pywallet may be useful.
Satosh¡ Slot (OP)
Full Member
***
Offline Offline

Activity: 164
Merit: 100


Indie Developer


View Profile WWW
July 04, 2014, 03:51:37 AM
 #4

Yeah, just install the correct version of BerkeleyDB utilities. Then do a backup, modify/delete the unnecessary lines from the backup file (which is a text file) and restore back.

Please remember to create DB_CONFIG file with "set_lg_dir database" in the appropriate directory.

Detail were discussed several time on this site, at least a year ago.

Thanks, but I'm stuck at this, I manage to open wallet.dat and print it out in a format that appears to be too hard to see what I should delete. I don't fully understand the system so I don't even know how I open the database correctly and dump/import correctly.

I only see giberish like  ‰¼E     W•r   in the text file that the backup creates.

EDIT: I can can do a proper text filel with db_dump, but I can still not see table names or anything like that.

Satosh¡ Slot (OP)
Full Member
***
Offline Offline

Activity: 164
Merit: 100


Indie Developer


View Profile WWW
July 04, 2014, 03:58:44 AM
 #5

I also don't understand how to be able to make sql queries to the database as I don't see any tables after loading wallet.dat. It just opens "main" db which I assume means that it didn't really open up wallet.dat at all.

2112
Legendary
*
Offline Offline

Activity: 2128
Merit: 1073



View Profile
July 04, 2014, 07:09:11 AM
 #6

I also don't understand how to be able to make sql queries to the database as I don't see any tables after loading wallet.dat. It just opens "main" db which I assume means that it didn't really open up wallet.dat at all.
Ah, sorry. You'll need to hit the textbooks about databases. BerkeleyDB is a form of NonSQL database called key-value-store. If you are at that stage where "database" has to support "sql queries" then you are at least semester away from understanding what's inside. Older editions of C.J.Date's book have most of the relevant material about "non-relational databases".

Again, sorry.

Please comment, critique, criticize or ridicule BIP 2112: https://bitcointalk.org/index.php?topic=54382.0
Long-term mining prognosis: https://bitcointalk.org/index.php?topic=91101.0
Satosh¡ Slot (OP)
Full Member
***
Offline Offline

Activity: 164
Merit: 100


Indie Developer


View Profile WWW
July 04, 2014, 06:30:21 PM
 #7

I also don't understand how to be able to make sql queries to the database as I don't see any tables after loading wallet.dat. It just opens "main" db which I assume means that it didn't really open up wallet.dat at all.
Ah, sorry. You'll need to hit the textbooks about databases. BerkeleyDB is a form of NonSQL database called key-value-store. If you are at that stage where "database" has to support "sql queries" then you are at least semester away from understanding what's inside. Older editions of C.J.Date's book have most of the relevant material about "non-relational databases".

Again, sorry.


Sure but I opened the database with dbsql that came with the Berkeley installation and I googled people using sql queries with that one. There's even a command to list tables but it returned nohing. I'll go RTFM if there's not some easy tools that makes it easy. Thanks!

virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 508


LOTEO


View Profile
July 05, 2014, 03:13:07 PM
 #8

I also don't understand how to be able to make sql queries to the database as I don't see any tables after loading wallet.dat. It just opens "main" db which I assume means that it didn't really open up wallet.dat at all.
Ah, sorry. You'll need to hit the textbooks about databases. BerkeleyDB is a form of NonSQL database called key-value-store. If you are at that stage where "database" has to support "sql queries" then you are at least semester away from understanding what's inside. Older editions of C.J.Date's book have most of the relevant material about "non-relational databases".

Again, sorry.


Sure but I opened the database with dbsql that came with the Berkeley installation and I googled people using sql queries with that one. There's even a command to list tables but it returned nohing. I'll go RTFM if there's not some easy tools that makes it easy. Thanks!

If it's NoSQL it's a little different from regular SQL.  NoSQL has another data storage model.  It varies based on database type. For example, key-value stores function similarly to SQL databases, but have only two columns ("key" and "value"), with more complex information sometimes stored within the "value" columns. Document databases do away with the table-and-row model altogether, storing all relevant data together in single "document" in JSON, XML, or another format, which can nest values hierarchically.

...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
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!