Bitcoin Forum
May 26, 2024, 03:29:58 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
81  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: August 14, 2013, 01:47:19 PM
I run
Code:
python -m Abe.abe --config abe-my.conf --commit-bytes 100000 --no-serve
but 2 or 3 times I had to restart the server, so now in the block table, I check on block_id and there are some missing blocks.

block_id is not the same as block number (a.k.a. block_height).  The gaps in block_id are not a problem.
82  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: August 12, 2013, 05:47:02 PM
I really know nothing about git except how to use it to grab a copy of some code from Github. Running that git command in either my bitcoin-abe directory or its parent isn't showing anything, so I must have moved things around enough that git became confused. I can see in my command history where I fetched Abe using "git clone," so I know that's how I originally got it.

Please pull the latest and see if it gets you past the error.  I would have pushed it earlier but did not have my github keys handy.

Thanks.
83  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: August 12, 2013, 02:19:59 AM
After having Abe running for weeks with no issues at all, I suddenly ran into this:

Code:
Failed to catch up {'blkfile_offset': 0, 'blkfile_number': 1, 'chain_id': Decimal('1'), 'loader': u'rpc', 'dirname': u'/home/xxxxxxx/.bitcoin', 'id': 295286L}
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 2592, in catch_up
    if not store.catch_up_rpc(dircfg):
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 2765, in catch_up_rpc
    store.import_block(block, chain_ids = chain_ids)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 1731, in import_block
    tx['tx_id'] = store.import_and_commit_tx(tx, pos == 0)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 2220, in import_and_commit_tx
    tx_id = store.import_tx(tx, is_coinbase)
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 2154, in import_tx
    pubkey_id = store.script_to_pubkey_id(txout['scriptPubKey'])
  File "/usr/local/lib/python2.7/dist-packages/Abe/DataStore.py", line 2532, in script_to_pubkey_id
    for opcode, data, i in deserialize.script_GetOp(script):
  File "/usr/local/lib/python2.7/dist-packages/Abe/deserialize.py", line 236, in script_GetOp
    opcode |= ord(bytes[i])
IndexError: string index out of range

Any ideas? It's using MySQL as the back.

I suspect this comes from new script types.  I have a possible fix here in diff format.  I'll push it to master soon.

I am curious what transaction triggered the error.  I'll ask more about that if the fix doesn't work. Smiley

Thanks for the report.  Please mention the git revision (git rev-parse HEAD) and any local code changes.
84  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: August 08, 2013, 07:59:26 PM
Firstbits is still down on blockchain.info.  Is there a live example of ABE with firstbits lookup?
I don't know of any offhand.
85  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: August 08, 2013, 04:52:17 PM
Looks good, can't wait for a more complete API, are you going to match block explorer's urls Grin

Well, I do not spend much time on new features these days, but if you have a particular function in mind, I'll at least comment on how best to do it.  Several Block Explorer API functions already work more or less compatibly.
86  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: August 07, 2013, 09:30:59 PM
John so your telling me to delete the whole db? Is there any other way to do this

Sorry for the long delay, but I am just busy with other things.  Try pulling the latest, then run:

Code:
python -m Abe.admin --config abe.conf delete-chain-blocks MegaCoin

replacing abe.conf as appropriate, and show me the output.  If it says that it deleted "from block", run Abe with --rescan to reload the chain.  That ought to wipe just the block headers from just that chain, but it may be slow due to a MySQL issue.  I suggest first trying it on a copy of the live database.

Also, try to configure your system so that only process loads chain data at a time.
87  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 31, 2013, 05:16:11 PM
Hello John again lol could you please look at this I'm going crazy on how to fix it mega
http://blockexplorer.coinworld.us/

Do you mean errors like this starting at MegaCoin block 41798?  It puzzles me.  From what I can piece together (without direct access to your database) this block could not figure out its block_value_in and/or block_value_out, yet it knows its parent block.  This is not supposed to happen.  Maybe one of the transactions failed to load because of bugs affecting parallel loading.

You might try deleting the block and its descendants and rescanning the chain.  Perhaps I can write an tool to help with this, but I have another priority at the moment.
88  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 24, 2013, 05:49:17 PM
Thanks John, that fixed my issue. Now I just need to figure out why Megacoin & Bytecoin aren't updating. They both use the new 0.8 /blocks/ format.

When I manually run it and it hits Megacoin I get

Code:
Opened /home/diatonic/.megacoin/blocks/blk00000.dat
Exception at 15709119118651544644
[...]
OverflowError: Python int too large to convert to C long

This is typical of ppcoin-derived currencies.  Have you tried the "ppcoin" branch?  See: https://github.com/jtobey/bitcoin-abe/issues/4

With Bytecoin it appears to add the new blocks but it's not showing them.

This can result from a block being skipped or incorrectly loaded.  Have you tried rescanning the blockfiles?  Use --rescan or, if you have many coins in one database, you can rescan just the one by setting blkfile_number=1, blkfile_offset=0 in the appropriate row in the datadir table.
89  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 24, 2013, 05:43:46 PM
nice one, but I heard it's not working for some new coins, such as Diamond (DMD).
Yes, several new coins trace their ancestry to PPCoin and need the "ppcoin" branch in Git.  See: https://github.com/jtobey/bitcoin-abe/issues/19

Another one, CopperLark, has its own format, which the "copperlark" branch handles.

Ideally, Abe would automatically detect among known variants and handle them without code changes.
90  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 24, 2013, 04:21:50 PM
Abe is really terrific! I used it to create a transaction network and play around with that.

Good to hear!

However, on my machine I left it running (writing to a SQLite database) for I think about two weeks and only got about 18 months into the blockchain (2.4 million transactions). The readme says it typically takes several days to get through the chain--is there something I'm probably doing wrong?

I don't use SQLite for the full block chain, so I don't really know.  One user, K1773R, reported a fast load with the database file in tmpfs (RAM).  (https://bitcointalk.org/index.php?topic=22785.msg2639709#msg2639709)  I think K1773R uses SQLite.  If your system has enough memory, you could try that.  Abe takes a lot of space, though.  I estimate 4-5 times the size of all block files combined.  (~/.bitcoin/blocks/blk00???.dat in Unix)  You can reduce this somewhat by setting keep-scriptsig=false or by using the no-statistics branch and default-trim-depth.  See the comments in abe.conf for what those options entail.

K1773R mentioned possibly distributing the SQLite file via torrent: https://github.com/jtobey/bitcoin-abe/issues/15
91  Other / Beginners & Help / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 24, 2013, 04:24:50 AM
Is there any more information you need? Is there someway I can tell abe to connect to bitcoind with RPC over a specific port?

Sorry for the delayed reply.  Please post the last few lines of output before "catch_up_rpc: abort" or "Exception: RPC load failed."  Have you run Bitcoin with -reindex since adding txindex to bitcoin.conf?

RPC is slower for the initial load, I think over twice as slow as blockfiles.  Once caught up, it usually inserts blocks faster than the blockfile method, since RPC has already loaded most transactions by the time the block comes (assuming that you arrange for it to catch up frequently).

Abe normally does not "read the blockfiles over and over again": it stores the current position in the database.
92  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 24, 2013, 03:54:06 AM
Hey John, I scanned a coin in with the wrong address version, and now addresses appear incorrectly. I would reload te whole database, but there are 36 coins and it would take over 24 hours. Is there a way to drop a single chain and reload it?

If you have not enabled firstbits, use SQL to update chain.chain_address_version with the correct value.  That should magically fix all the addresses.  To find the correct value, you could start loading the chain in a new database, identically configured except for that address version.  Then:

SQL> SELECT chain_name, chain_address_version FROM chain;

SQL> UPDATE chain SET chain_address_version='value' WHERE chain_name='chain';

This may require conversion to and from a printable format such as hex, if you use binary_type=binary, which is now the default.  In MySQL, replace chain_address_version with HEX(chain_address_version) in the select statement, and replace 'value' with UNHEX('hex value') in the update.

Ideally, we would have a command-line and web interface to manage chains.
93  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 23, 2013, 10:04:51 PM
I don't think this is true or needed.  Some addresses have no firstbits base representation, because an address differing only by case appeared earlier.
The chance of two addresses only differing by case is something like 1 in 34^34 (or 34^27 if you're looking at the shortest possible Bitcoin address), is it not?  If so, I'd say we can safely assume no two addresses have been, or will ever have, the same address differing only by case.  Even 24^27 is such an impossibly high number as to conclude it will not happen within the life of the earth.

Nevertheless, if I recall correctly, examples do exist, presumably where one address is not generated in the usual way (and coins sent to it are therefore dead).
94  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 23, 2013, 09:26:55 PM
I edited my last reply to ensure that "collision" includes collision with longer substrings.  For example, 1SgtspiQ... has a substring 1Sgtspi which collides not with 1SgTspiK's base representation, but with a firstbits address derived from it.  So the base representation of 1SgtspiQ... must include the Q.
95  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 23, 2013, 09:00:16 PM
Thank you, and sorry for the delay!

Firstbits Definition (Draft)

Firstbits Base Representation
All Bitcoin addresses that appear in the block chain using a well defined set of recognized transaction output formats have a unique firstbits base representation.

I don't think this is true or needed.  Some addresses have no firstbits base representation, because an address differing only by case appeared earlier.

The firstbits base representation of a bitcoin address is the shortest non-empty substring starting with the first character of the Bitcoin address and converted to lower-case, which does not collide with the firstbits base representation of another address appearing in a transaction output earlier in the block chain.

This is good but could be clearer.  How about:
Quote
The firstbits base representation of a Bitcoin address is the shortest non-empty, initial substring of the address, converted to lower case, which is not the firstbits base representation a firstbits address of another address appearing earlier in the block chain.
(Appearance implies "in a transaction output" as specified below.)

Thus, a firstbits base representation is always in lower-case.

The order of appearance for addresses in transaction outputs in the same block follows the order of transaction outputs in the raw block data.

Firstbits Addresses
A Bitcoin address can several valid firstbits addresses. A firstbits address can be derived from a firstbits base representation by appending additional characters from the Bitcoin address up to and including the last character of the Bitcoin address. A firstbits address can have any combination of upper and lower case.

Example 1
Bitcoin address:               1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
Firstbits base representation: 1
Firstbits address examples:    1, 1a, 1A, 1a1z, 1A1z, 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa


Example 2
Bitcoin address:               1SgTspiKe5HHkjdSeD72q9WsiJhRiaxf9
Firstbits base representation: 1sgtsp
Firstbits address examples:    1sgtsp, 1SgTsp, 1SgTspiKe5HHkjdSeD72q9WsiJhRiaxf9


Recognized Transaction Output Formats
An address is said to appear in a block when it appears in one of the block's transactions' pubkey, pubkey hash, or script hash outputs.

Pubkey Output
A pubkey output is a transaction output with a script of the form:
Code:
<pubKey> OP_CHECKSIG
An address is said to appear in a pubkey output when its version byte is 0 and its key hash equals the 160-bit hash of the output script's push operand (pubKey).

Pubkey Hash Output
A pubkey hash output is a transaction output with a script of the form:
Code:
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
An address is said to appear in a pubkey hash output when its version byte is 0 and its 160-bit key hash equals the output script's push operand (pubKeyHash).

Script Hash Output
A script hash output is a transaction output with a script of the form:
Code:
OP_HASH160 <scriptHash> OP_EQUAL
An address is said to appear in a script hash output when its version byte is 5 and its 160-bit key hash equals the output script's push operand (scriptHash).

In particular, output scripts not matching the above three cases can not affect whether an address appears in a block, nor can input scripts.  For example, a script containing OP_DROP or OP_NOP can not match the cases, but the push operand in a pubkey output may have any length.

It is actually more complex to regard all transactions in a block in a holistic way rather than just handling them one at a time.

However, here is the definition we got so far for transactions in the same block (which is actually used today):
Quote
The order of appearance for addresses in transaction outputs in the same block follows the order of transaction outputs in the raw block data.
If you make a less complex description that unambiguously describes your way of handling collisions I'll agree with you.

I don't have a strong preference.  Abe does use enough characters to distinguish from addresses later in the block.  I think the code was simpler before I did this.  I don't think conceptually either way is more complex; you choose between defining "order of appearance" and "same or earlier block".  I strongly suggest finding an example and checking blockchain.info's treatment of same-block collisions, since that site obviously has a lot of work put into it and may be unwilling to change.  And let's try to include piuk.
96  Bitcoin / Project Development / Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff on: July 21, 2013, 11:34:07 PM
Hello John w/b just need to ask you where would I get the api for the explorer
http://blockexplorer.coinworld.us/

http://blockexplorer.coinworld.us/chain/AlphaCoin/q
etc. replacing AlphaCoin with coin name.
97  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 19, 2013, 08:21:23 PM
SgtSpike, can you share the precise definition of a firstbits address?

Jan, given SgtSpike's and my openness to change, would you care to work on a precise definition?
98  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 19, 2013, 06:42:40 PM
Touche on the about page.  Cheesy  I know we specifically didn't mention it there because we didn't want to go into too much detail, but it sounds like we should have anyway.

That's okay, perhaps we'll get it done here now... Smiley

Yes, you are correct about making that change for addresses in the same block - the distinction would only invalidate some firstbits, it wouldn't actually change any of them from pointing at one address to pointing at another.  I wouldn't have a problem with making this change then.

Regarding the OP_NOP transactions, I read that some people used them to donate transaction fees to a certain pool.  It's a bit beyond my level of comprehension as to how exactly that works, but essentially, only Eligus could take the fee for these transaction:  https://bitcointalk.org/index.php?topic=11481.0

Thanks for digging that up.  It looks as if the transactions are indeed generated by end users (of a modified client) who do see the affected addresses.  I don't have a full database handy, but I am curious how many OP_NOPs are in the chain and whether they still occur.  If it's a tiny percentage and none recently, I'm less concerned.  But here, a firstbits assigned in an OP_NOP output would indeed be reassigned to another address, so I suggest we consider it carefully.

I suppose I would still lean towards what the Bitcoin protocol accepts, not what various clients do and do not accept and can and cannot generate.  If the protocol allows it to be placed in the blockchain, then it should be given a firstbits.  OP_NOP transactions are not normal, and cannot be generated with the default client, but they are still valid Bitcoin transactions.  I don't see any reason to disclude any valid scripts that anyone wants to run from being included in firstbits calculations.

You certainly know a great deal more about the inner workings of Bitcoin than I do.  I'd just like to see why you don't want these non-normal transactions to be included.  You mentioned having to modify your code slightly to be able to handle these special transactions - are you concerned about having to continue to modify your code in order to deal with new combinations of operations?

Yes, and I fear that "what the protocol accepts" and what future users will consider an "appearance of an address" may be computationally infeasible for an unvarying standard such as firstbits should be.  For example, each normal address (starting with 1) has a unique corresponding, standard 1-of-1 P2SH output script and address starting with 3.  If you know the 1-address, you can find the 3-address, but not vice versa, at least until the output is spent.  Does the spending of such an output constitute appearance of the 1-address?  Some might say yes, others no.  The firstbits standard must give an answer for every possible case like that that may appear in the future.

Firstbits must be derived only from the blockchain, obviously.  "Bitcoin addresses" never occur directly in the blockchain; rather, they are extracted by matching scripts against templates and associating script types with well-known "version bytes".  If your address were spelled out in the block whenever it sent or received coins, we could trivially define first appearance.  Since that is not the case, it is up to us to cope with the complexity.

It is still an open question to me, whether to ignore non-functional trailing script fragments such as Eligius's OP_NOP.  The whole class of them would have to be easily identified, or if a special case for the single OP_NOP would yield better backward compatibility, I would consider just that.  I do not have time right now to find out the answers, but if someone more interested than I comes up with the data, I will comment on it.  Smiley
99  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 19, 2013, 05:29:19 PM
Hello again John!

Firstbits.com had always differentiated by order of appearance in the raw block data, and given the first appearance the shorter firstbits.  I'm not sure who stated otherwise, but for firstbits.com, that's always been the case.

Perhaps I read it here:

- We compare your address to all addresses appearing in the same block or before yours in the block chain.
- We return as many characters as needed to differentiate your address from the others.

I am not sure what standard blockchain.info follows on that front, but I assumed it followed the same.  We should find out.  Regardless, giving enough firstbits to distinguish both addresses in the same block is certainly cleaner.

Cleaner, I suppose, although I, too, originally based it on order within the block.  If it is possible (is it?) for an earlier tx to spend the output of a later tx in the same block, we would have to be careful about whether the earlier one's input script triggers "appearance" of the address in case a competing address appears in a third transaction between those two.  The rule about "all addresses appearing in the same block" avoids that issue, while unfortunately making some address prefixes ineligible ever to become firstbits.

I didn't want to change it for fear it could screw up someone relying on the original implementation.  The likelihood of someone using one of those addresses is slim, but the possibility still exists.  Now would be a good time to change it, if we are also nailing down other portions of the specification.

Thanks for the willingness to clean up.  I think in this case, the change would never result in a firstbits becoming the firstbits of another address.  Rather, some (rare) firstbits would become non-firstbits, ineligible due to appearing first in two or more addresses within a block.

Yes, let's indeed finish the standard.  I suppose I dropped out of that original discussion because I am not familiar enough with the different OP functions of Bitcoin and what they mean/do.  Is there some reading I can do somewhere that explains more about these?

The wiki describes the original two standard transactions: https://en.bitcoin.it/wiki/Script#Scripts.  P2SH is in BIP 16: https://en.bitcoin.it/wiki/BIP_0016.  The authoritative reference is the IsStandard and Solver functions in src/script.cpp.

I suppose I would say that as long as a transaction is valid and included in the blockchain, there is no reason it shouldn't also be included in firstbits.  Will the average person know what a transaction with OP_NOP means, or how to know if a transaction has it or not?

For example, transaction 5492a05f1edfbd29c525a3dbf45f654d0fc45a805ccd620d0a4dff47de63f90b has an OP_NOP appended to one of the addresses.  Blockexplorer decodes the address correctly, but blockchain.info doesn't seem to have a handle on it:
http://blockexplorer.com/tx/5492a05f1edfbd29c525a3dbf45f654d0fc45a805ccd620d0a4dff47de63f90b
https://blockchain.info/tx/5492a05f1edfbd29c525a3dbf45f654d0fc45a805ccd620d0a4dff47de63f90b

So you are arguing that these OP_NOP transactions should be discluded, despite the fact that they are included in the blockchain?

I am not disagreeing with you, I just want to understand more about what the disclusions are and how easy it will be for the average person to understand why a particular address doesn't have firstbits.

Yes.  In fact, here is a case where Abe does the other thing, and the standard that I propose will require a change.

I assume that the reference client does not generate these OP_NOP transactions, nor does any client designed with interoperability in mind.  The last time I checked, there were only a handful of them.  I can only speculate why someone went to the trouble of making them.  I remember first seeing them in Abe, checking BlockExplorer, and adding a tiny change to make Abe handle them compatibly.  The problem is, if we allow OP_NOP at the end, where do we draw the line?  Do we allow multiple OP_NOPs or other operations?  I guess we could just as easily define the script types by how scripts start, and if firstbits.com has always done this, that might convince me.  I consider a full, exact match cleaner.  In practice, I think anything after the standard portion gets ignored, unless it would make the script or block too big.  I haven't checked whether IsStandard allows trailing junk, but I have the impression that developers mostly frown on it.

Thanks for your comments.
100  Bitcoin / Bitcoin Discussion / Re: FirstBits.com - remember and share Bitcoin addresses on: July 19, 2013, 03:40:03 PM
I wasn't even aware that Abe even performed firstbits resolution.

Let me refresh your memory. Smiley  https://bitcointalk.org/index.php?topic=16217.msg957933#msg957933

The definition is mostly displayed in layman's terms here: http://firstbits.net/about.php
Also there's the basic SQL statement used here:  http://firstbits.net/logic.html

Thank you, but this is not a precise specification.

Whatever address appears first in the blockchain claims the Firstbits for every previously unused combination up to the full address.  For example, 1SgTspiKe5HHkjdSeD72q9WsiJhRiaxf9 doesn't have the firstbits 1s, 1sg, 1sgt, or 1sgts because other addresses used prior to this one already started with those combinations, but it DOES have the firstbits 1sgtsp, 1sgtspi, 1sgtspik, 1sgtspike, 1sgtspike5, etc, all the way up to 1SgTspiKe5HHkjdSeD72q9WsiJhRiaxf.

If two addresses with the same firstbits appear in the same block, then the addresses are given firstbits in the order they are seen in the raw block data (i.e., the first one would be given 1sgtspike, and the second would be given 1sgtspikeX, where X is the next character in the address).

IIRC, this contradicts information given earlier, that neither address would get 1sgtspike: both new firstbits would contain enough characters to distinguish them from each other, regardless of their ordering within the block.

This is always how firstbits have been resolved.  If Abe resolves firstbits in a different manner than the above, then it should not be calling them firstbits.

True, but if so, it is not for lack of trying.  Rather than rename the function in Abe, why don't we finish the standard and bring ourselves into agreement.  Here is where we left off: https://bitcointalk.org/index.php?topic=16217.msg960077#msg960077
Pages: « 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!