Bitcoin Forum
May 25, 2024, 07:51:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Extracting currency names from wallets or using RPC  (Read 763 times)
ZeWaren (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10

There be komodo dragons


View Profile WWW
May 22, 2014, 09:03:30 AM
 #1

Hi all,

I've written a simple script to extract the amount of coins in all my cryptocurrency wallets.

My problem now is that amounts alone won't help me much. What I need would be to match them with their currency name.

Does anyone know, given a wallet data directory and a cryptocoin binary (*-qt.exe), how to extract the associated currency unit (BTC, LTC, DOGE, DRK, etc.)?

I didn't see this information anywhere in the RPC endpoints, and I don't think the wallet database files are self-aware enough to tell me.

Thanks for any help,

Ceci n'est pas une signature.
Benson Samuel
Legendary
*
Offline Offline

Activity: 1890
Merit: 1000


Landscaping Bitcoin for India!


View Profile WWW
May 22, 2014, 09:52:34 AM
 #2

Hi all,

I've written a simple script to extract the amount of coins in all my cryptocurrency wallets.

My problem now is that amounts alone won't help me much. What I need would be to match them with their currency name.

Does anyone know, given a wallet data directory and a cryptocoin binary (*-qt.exe), how to extract the associated currency unit (BTC, LTC, DOGE, DRK, etc.)?

I didn't see this information anywhere in the RPC endpoints, and I don't think the wallet database files are self-aware enough to tell me.

Thanks for any help,

Two quick ways that I could think of are:
- Maintain a manual input field to allow the user to enter the coin name.
- Maintain a list of addresses of each coin and validate each one till you get a match.

ZeWaren (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10

There be komodo dragons


View Profile WWW
May 22, 2014, 11:40:22 AM
 #3

Two quick ways that I could think of are:
- Maintain a manual input field to allow the user to enter the coin name.
- Maintain a list of addresses of each coin and validate each one till you get a match.
The idea here is that you should not have to enter any information. The goal of the script is to give you a list of your wallet amounts completely automatically.

Ceci n'est pas une signature.
Benson Samuel
Legendary
*
Offline Offline

Activity: 1890
Merit: 1000


Landscaping Bitcoin for India!


View Profile WWW
May 22, 2014, 12:18:26 PM
 #4

Two quick ways that I could think of are:
- Maintain a manual input field to allow the user to enter the coin name.
- Maintain a list of addresses of each coin and validate each one till you get a match.
The idea here is that you should not have to enter any information. The goal of the script is to give you a list of your wallet amounts completely automatically.

Extract the daemon name?

ZeWaren (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10

There be komodo dragons


View Profile WWW
May 22, 2014, 01:13:17 PM
 #5

Extract the daemon name?
Won't give the currency unit (BTC, LTC, DOGE, etc).

Ceci n'est pas une signature.
cr1776
Legendary
*
Offline Offline

Activity: 4046
Merit: 1303


View Profile
May 22, 2014, 02:05:35 PM
 #6

Extract the daemon name?
Won't give the currency unit (BTC, LTC, DOGE, etc).

Why?

bitcoind
litecoind
dogecoind
etc

all shows the name based on the name of the daemon you are querying (or bitcoin-qt etc).  Or if you know the wallet data directory, it will include something unique that most likely includes the name.

fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
May 22, 2014, 02:08:02 PM
 #7

Seemingly everyone here has forgotten about the version byte used in addresses!

Create a new address over RPC, decode the base58 into hex, and the first byte will indicate what network you are on. https://en.bitcoin.it/wiki/List_of_address_prefixes If the item isn't on this list, just follow this procedure with your whatevercoin, and you'll get the address byte.

Bitwasp Developer.
ZeWaren (OP)
Member
**
Offline Offline

Activity: 84
Merit: 10

There be komodo dragons


View Profile WWW
May 22, 2014, 03:22:35 PM
 #8

Seemingly everyone here has forgotten about the version byte used in addresses!

Create a new address over RPC, decode the base58 into hex, and the first byte will indicate what network you are on. https://en.bitcoin.it/wiki/List_of_address_prefixes If the item isn't on this list, just follow this procedure with your whatevercoin, and you'll get the address byte.
Clever.

I think I missed an important information: I'd like the process to be done automatically in a script.

The ideal think would be that if I add a new coin wallet in my wallet directory, the script would be able to extract the wallet amount and its unit.

For example, if I create a Darkcoin wallet there and mine some coins, I would get from the script something like: "234.56 QRK".

Ceci n'est pas une signature.
Benson Samuel
Legendary
*
Offline Offline

Activity: 1890
Merit: 1000


Landscaping Bitcoin for India!


View Profile WWW
May 22, 2014, 07:18:29 PM
 #9

Seemingly everyone here has forgotten about the version byte used in addresses!

Create a new address over RPC, decode the base58 into hex, and the first byte will indicate what network you are on. https://en.bitcoin.it/wiki/List_of_address_prefixes If the item isn't on this list, just follow this procedure with your whatevercoin, and you'll get the address byte.

+1

If your hacking this on PHP, PHPCoinaddress is a good direction to go towards.
https://bitcointalk.org/index.php?topic=200042.0

But if you are looking at extracting this info from a daemon, can't see how that can be done without customizing the daemon itself.

beachparty
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
May 22, 2014, 08:23:49 PM
 #10

As someone said here use something to parse daemon name - remove coind and here u go Cheesy
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!