Bitcoin Forum
May 11, 2024, 02:24:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Format of keys and values in bitcore [CLOSED]  (Read 1340 times)
Shawshank (OP)
Legendary
*
Offline Offline

Activity: 1623
Merit: 1608



View Profile
July 10, 2014, 09:51:44 PM
Last edit: July 11, 2014, 09:35:17 AM by Shawshank
 #1

I am trying to understand the format of keys and values in the bitcore LevelDB database.

I have extracted this record:

{"key":"txa2-1XPTgDRhN8RFnzniWCddobD9iKZatrvH4-9998728386554-faa2cb087a2b0c5e2c898f713ebd77762afb7088a2bd0c720615a6b2efc54eb1-1",
"value":"1000000:1:1:42f4500dec4c6f8cd41337767bdf7e2caa48c153ae2114334a645ac927d03766:289:1273862997"}

For the "key" name:
What does the number 9998728386554 mean?
What does the last number 1 at the end mean?

For the "value" name:
What does the pair :1:1: mean?
What does the number 289 mean?

EDIT: More precisely, the LevelDB database is created by insight-api, which uses bitcore.

Lightning Address: shawshank@getalby.com
1715394286
Hero Member
*
Offline Offline

Posts: 1715394286

View Profile Personal Message (Offline)

Ignore
1715394286
Reply with quote  #2

1715394286
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715394286
Hero Member
*
Offline Offline

Posts: 1715394286

View Profile Personal Message (Offline)

Ignore
1715394286
Reply with quote  #2

1715394286
Report to moderator
1715394286
Hero Member
*
Offline Offline

Posts: 1715394286

View Profile Personal Message (Offline)

Ignore
1715394286
Reply with quote  #2

1715394286
Report to moderator
Shawshank (OP)
Legendary
*
Offline Offline

Activity: 1623
Merit: 1608



View Profile
July 11, 2014, 09:34:42 AM
 #2

I managed to get the answer after reviewing the source code. For the record (pun intended)  Smiley

Quote from: Shawshank
For the "key" name:
What does the number 9998728386554 mean?

1e13-Unix timestamp, i.e. reverse timestamp, to be able to order it backwards quickly.

Quote from: Shawshank
What does the last number 1 at the end mean?

vout order in the transaction

Quote from: Shawshank
For the "value" name:
What does the pair :1:1: mean?
What does the number 289 mean?

This info is relevant for version of insight older than v0.2. For version 0.2 and older spents are obtained with  txs-.

Lightning Address: shawshank@getalby.com
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!