Pages:
Author

Topic: How to do document timestamping with the block chain? (Read 4452 times)

legendary
Activity: 1708
Merit: 1020
Merged mining is done by putting the child chain in the coinbase field.
Ah, thanks. I can't find much documentation about the coinbase field, but the Wiki mentions "The data in "coinbase" can be anything; it isn't used.", which explains enough for me.

Merged chains can't get something for nothing.  If there fees are low they why will miners mine them?  Ultimately each miner will decide which chains to mine.  No current chain with the exception of namecoin has any significant merge mining.

I've been thinking about this, and I haven't figured out yet how this is going to work. In fact, I don't think I understand the mining economics of a future Bitcoin-system that is dominated by transaction fees instead of coin generation. What would prevent a "race to the bottom", where miners ask lower and lower fees, to out-compete competitors?

The few miners who happen to have the most efficient computers and the lowest electricity prices will be able to out-compete all others. Once others leave the game, the difficulty decreases, but the ratio between the remaining miners doesn't change. The few successful ones can continue lowering the transaction fee, so that the game remains unprofitable for the other ones. In the end, there is a real danger of a 51% attack.

I think that, currently, the only thing that keeps difficulty high is the high value of the generated bitcoins per block. With the generated coin value dropping to zero, I think difficulty will also drop to zero, and the system will fail.

Luckily, it will take several decades before this happens, and most in-between lowerings of the amount of generated bitcoins will probably be over-compensated by the increase in value due to increased usage.

That's an awful lot of assumptions between now and the system failing in a few decades.

but sharp assumptions.

the effect you are talking about is discussed as "tragedy of the commons" for example here: https://bitcointalksearch.org/topic/bitcoin-tragedy-of-the-commons-67900 

and here: http://bitcoin.stackexchange.com/questions/3111/will-bitcoin-suffer-from-a-mining-tragedy-of-the-commons-when-mining-fees-drop-t/3129#3129

Quote
In the mean time, my Bitcoin-based implementation is already 90% finished, so from this point, it seems simpler to just continue using Bitcoin directly, instead of indirectly through Namecoin.
oh noes

but with namecoin there is not much to be done about this anyway - it works just like that.

name_new / name_firstupdate stamp/myhashh789dhh7  Grin

kjj
legendary
Activity: 1302
Merit: 1026
Merged mining is done by putting the child chain in the coinbase field.
Ah, thanks. I can't find much documentation about the coinbase field, but the Wiki mentions "The data in "coinbase" can be anything; it isn't used.", which explains enough for me.

Merged chains can't get something for nothing.  If there fees are low they why will miners mine them?  Ultimately each miner will decide which chains to mine.  No current chain with the exception of namecoin has any significant merge mining.

I've been thinking about this, and I haven't figured out yet how this is going to work. In fact, I don't think I understand the mining economics of a future Bitcoin-system that is dominated by transaction fees instead of coin generation. What would prevent a "race to the bottom", where miners ask lower and lower fees, to out-compete competitors?

The few miners who happen to have the most efficient computers and the lowest electricity prices will be able to out-compete all others. Once others leave the game, the difficulty decreases, but the ratio between the remaining miners doesn't change. The few successful ones can continue lowering the transaction fee, so that the game remains unprofitable for the other ones. In the end, there is a real danger of a 51% attack.

I think that, currently, the only thing that keeps difficulty high is the high value of the generated bitcoins per block. With the generated coin value dropping to zero, I think difficulty will also drop to zero, and the system will fail.

Luckily, it will take several decades before this happens, and most in-between lowerings of the amount of generated bitcoins will probably be over-compensated by the increase in value due to increased usage.

That's an awful lot of assumptions between now and the system failing in a few decades.
cjp
full member
Activity: 210
Merit: 124
Merged mining is done by putting the child chain in the coinbase field.
Ah, thanks. I can't find much documentation about the coinbase field, but the Wiki mentions "The data in "coinbase" can be anything; it isn't used.", which explains enough for me.

Merged chains can't get something for nothing.  If there fees are low they why will miners mine them?  Ultimately each miner will decide which chains to mine.  No current chain with the exception of namecoin has any significant merge mining.

I've been thinking about this, and I haven't figured out yet how this is going to work. In fact, I don't think I understand the mining economics of a future Bitcoin-system that is dominated by transaction fees instead of coin generation. What would prevent a "race to the bottom", where miners ask lower and lower fees, to out-compete competitors?

The few miners who happen to have the most efficient computers and the lowest electricity prices will be able to out-compete all others. Once others leave the game, the difficulty decreases, but the ratio between the remaining miners doesn't change. The few successful ones can continue lowering the transaction fee, so that the game remains unprofitable for the other ones. In the end, there is a real danger of a 51% attack.

I think that, currently, the only thing that keeps difficulty high is the high value of the generated bitcoins per block. With the generated coin value dropping to zero, I think difficulty will also drop to zero, and the system will fail.

Luckily, it will take several decades before this happens, and most in-between lowerings of the amount of generated bitcoins will probably be over-compensated by the increase in value due to increased usage.
donator
Activity: 1218
Merit: 1079
Gerald Davis

Thanks, that is a good explanation.

An interesting thing to see is that merged mining (as described on that page) also works by inserting a hash value into a Bitcoin block. Someone suggests this is done with a 0 BTC transaction (to an address that encodes the hash??). Since this is done by the miners themselves, I can imagine they have more freedom to use non-standard transactions for this.

The comments on that page make me a bit worried about the future of Bitcoin, since competing crypto-currencies that do merged mining with Bitcoin can get the same block chain security, while offering much lower transaction fees than Bitcoin. Effectively, they don't pay for what they're using, which will destroy the system for all of us. I hope somebody knows a solution.

In the mean time, my Bitcoin-based implementation is already 90% finished, so from this point, it seems simpler to just continue using Bitcoin directly, instead of indirectly through Namecoin.


Merged mining is done by putting the child chain in the coinbase field.

Merged chains can't get something for nothing.  If there fees are low they why will miners mine them?  Ultimately each miner will decide which chains to mine.  No current chain with the exception of namecoin has any significant merge mining.
cjp
full member
Activity: 210
Merit: 124

Thanks, that is a good explanation.

An interesting thing to see is that merged mining (as described on that page) also works by inserting a hash value into a Bitcoin block. Someone suggests this is done with a 0 BTC transaction (to an address that encodes the hash??). Since this is done by the miners themselves, I can imagine they have more freedom to use non-standard transactions for this.

The comments on that page make me a bit worried about the future of Bitcoin, since competing crypto-currencies that do merged mining with Bitcoin can get the same block chain security, while offering much lower transaction fees than Bitcoin. Effectively, they don't pay for what they're using, which will destroy the system for all of us. I hope somebody knows a solution.

In the mean time, my Bitcoin-based implementation is already 90% finished, so from this point, it seems simpler to just continue using Bitcoin directly, instead of indirectly through Namecoin.
legendary
Activity: 1708
Merit: 1020
I sure agree to your first point but imho merged mining resolves the second. gold miners also make use of secondary ores.

I want to understand how that "merged mining" works. Can you please explain it, or provide a good link?

To my understanding, mining for block chain X works as follows:
Code:
nonce = 0
while True:
    template = X.getLatestBlockTemplate() #transactions and/or parent block can be updated
    block = makeBlockWithNonce(template, nonce)
    hash = calculateHeaderHash(block)
    if(X.meetsDifficulty(hash))
        X.publishBlock(block)
    nonce++
I have no idea how mining for two block chains X and Y can be merged.
[...]

the namecoin block hash is included in the bitcoin block. namecoin accepts a bitcoin block hash at namecoin difficulty level.

http://bitcoin.stackexchange.com/questions/273/how-does-merged-mining-work
http://dot-bit.org/Merged_Mining

cjp
full member
Activity: 210
Merit: 124
I sure agree to your first point but imho merged mining resolves the second. gold miners also make use of secondary ores.

I want to understand how that "merged mining" works. Can you please explain it, or provide a good link?

To my understanding, mining for block chain X works as follows:
Code:
nonce = 0
while True:
    template = X.getLatestBlockTemplate() #transactions and/or parent block can be updated
    block = makeBlockWithNonce(template, nonce)
    hash = calculateHeaderHash(block)
    if(X.meetsDifficulty(hash))
        X.publishBlock(block)
    nonce++
I have no idea how mining for two block chains X and Y can be merged.

BTW, I created a certificate:
http://timestamp.ultimatestunts.nl/certificateExample.pdf

Are there any errors in this? I am particularly interested in:
  • English / legalese errors
  • Errors in my description of Bitcoin
  • Hacker challenge: Errors in my verification code (can you create false positives / false negatives?)
legendary
Activity: 1708
Merit: 1020
have you considered namecoin for your purposes? it actually is a generic name/value pair accounting system.

you can register a fixed name of ~255 bytes and a value of 1023 bytes. not sure if the value is locked in the chain forever but I think at least the name is.

Yes, but I don't believe in the concept of using separate block chains for separate purposes:
  • I think it is essential to have a monetary reward for block chain miners, to keep the difficulty high and
    to keep the block chain hard-to-counterfeit. So, it is not only "Bitcoin needs the block chain", but also "the block chain needs Bitcoin".
  • Because of the inherent networking effect of payment methods, I think it is very important to keep everybody committed to the same crypto-currency. Either everybody should switch to Namecoin, or we should all stick to Bitcoin. Since Bitcoin is currently more popular, I'll keep using that.
  • The method I use poses only a minimal overhead to the Bitcoin network. Instead of saying "every purpose should have its own block chain", I propose "every purpose should have its own Merkle tree, rooted in the Bitcoin Merkle tree". Only if the Bitcoin currency rules prove to be broken, there is a justification for creating a new block chain with a new currency.

I sure agree to your first point but imho merged mining resolves the second. gold miners also make use of secondary ores.
cjp
full member
Activity: 210
Merit: 124
have you considered namecoin for your purposes? it actually is a generic name/value pair accounting system.

you can register a fixed name of ~255 bytes and a value of 1023 bytes. not sure if the value is locked in the chain forever but I think at least the name is.

Yes, but I don't believe in the concept of using separate block chains for separate purposes:
  • I think it is essential to have a monetary reward for block chain miners, to keep the difficulty high and
    to keep the block chain hard-to-counterfeit. So, it is not only "Bitcoin needs the block chain", but also "the block chain needs Bitcoin".
  • Because of the inherent networking effect of payment methods, I think it is very important to keep everybody committed to the same crypto-currency. Either everybody should switch to Namecoin, or we should all stick to Bitcoin. Since Bitcoin is currently more popular, I'll keep using that.
  • The method I use poses only a minimal overhead to the Bitcoin network. Instead of saying "every purpose should have its own block chain", I propose "every purpose should have its own Merkle tree, rooted in the Bitcoin Merkle tree". Only if the Bitcoin currency rules prove to be broken, there is a justification for creating a new block chain with a new currency.
legendary
Activity: 1708
Merit: 1020
have you considered namecoin for your purposes? it actually is a generic name/value pair accounting system.

you can register a fixed name of ~255 bytes and a value of 1023 bytes. not sure if the value is locked in the chain forever but I think at least the name is.

cjp
full member
Activity: 210
Merit: 124
well you mention somewhere that you'll be timestamping twice a day. that means either you'll timestamp two documents or two collective documents with a list of timestamped documents. if the later is the case, the list of timestamped docs is the master document. did my clarification help?

I'll timestamp twice per day, and each timestamp can apply to multiple documents. So, in that sense, my concept follows your second option. However, there is no "list of timestamped documents": instead of a list, I use a Merkle tree structure. I don't know whether this makes a big difference for you. The similarity with your second option is that, yes, you need that Merkle tree structure to do the verification. That's why it(*) will be included in the certificate document. The difference is that you don't need the entire Merkle tree to verify a single document: you only need the branch that leads to the document you're interested in.

Are you familiar with Merkle trees?

(*) actually, only the relevant branch of the Merkle tree will be included in the certificate. Each timestamped document will have its own certificate, even if there are multiple documents to be timestamped at the same moment.
sr. member
Activity: 462
Merit: 250
well you mention somewhere that you'll be timestamping twice a day. that means either you'll timestamp two documents or two collective documents with a list of timestamped documents. if the later is the case, the list of timestamped docs is the master document. did my clarification help?
cjp
full member
Activity: 210
Merit: 124
I don't understand what you mean with a "master document". For me, the only "master document" is the chain of Bitcoin block headers, and these are verified in a quite unique, decentralized way, which I'm sure you're all familiar with.

Each block header contains (IIRC) a timestamp, which is verified by future miners, and a hash value, which forms the root of a Merkle tree. For normal Bitcoin usage, the "leaves" of the Merkle tree are Bitcoin transactions, but for my timestamping concept I will create a special type of transaction which contains a hash value, and this way, I am able to extend the Merkle tree with my own Merkle sub-tree. The "leaves" of my own sub-tree are the documents that need to be timestamped.

The block headers, together with the part of the Merkle tree that leads to a leave, are a timestamp proof for that leave. The block headers are distributed among all Bitcoin users. For Bitcoin transactions, the Merkle tree and the transactions themselves are also distributed among all Bitcoin users, since they are part of the block data, but they may be "pruned" in the future as soon as the transaction outputs are spent. The "Merkle sub-tree" of my timestamping concept is not distributed among all Bitcoin users, and the same is true for the timestamped documents themselves. The person who has an interest in timestamping a document needs to take care of keeping a copy of the document and a timestamp certificate that contains the missing information. Or he can choose to publish both of them in any way he likes.

In my timestamping concept, you can provide timestamping proof if you have the following:
  • The original document
  • The Bitcoin block headers (get them from any Bitcoin user and verify them)
  • The timestamp certificate, generated by my service (for contents see earlier post)

The certificate will be machine-readable, and you can use an open source and publicly reviewed script to see whether the certificate is valid. The script needs the above items as input.
sr. member
Activity: 462
Merit: 250
In order for this to work, ... If you hash a whole bunch of documents together, than all of those documents will need to be available to the third party.  This seems like it would be a problem.
The "master document" need not actually be all the day's collected documents - just a list of their hashes.  i.e. on day X at time Y in block B, a transaction occurred to a private key equal to the hash of master document Z, which therefore existed at that time.  In document Z, presented here Your Honours, we can see that there is the hash of "bob's_contract_of_employment.doc" exactly as shown here.
But how do you have a master document without having to trust anyone? What happens if the person with the master document disappears? IMO, one great part of bitcoin is the complete lack of need to trust a centralized party, but with a system with a "master document" you have created a centralized party.

the master document will have to be published. period

everybody will be able to see the content of it (should be anyway only the list of document IDs and their hashes) and the hash of the document itself would be in the blockchain.
this way anyone could verify if the document of his interest is in any of the master documents, if yes, which one and then test/compare the hashes and verify in blockchain.

edit: this approach will be used for official eu publications. they will sign 1 document containing list of hashes of all files published that day and anybody can verify that a pdf comes from the publication office by checking the hash of pdf, checking if the hash matches the info in the list which was signed and then verify signature (certificate used, if it was not revoked, etc).
the bitcoin/blockchain timestamping is kind of different, has no certicate issuer nor not known yet how the master document (daily list) would be published. but it should be public and tamper proof
hero member
Activity: 742
Merit: 500
In order for this to work, ... If you hash a whole bunch of documents together, than all of those documents will need to be available to the third party.  This seems like it would be a problem.
The "master document" need not actually be all the day's collected documents - just a list of their hashes.  i.e. on day X at time Y in block B, a transaction occurred to a private key equal to the hash of master document Z, which therefore existed at that time.  In document Z, presented here Your Honours, we can see that there is the hash of "bob's_contract_of_employment.doc" exactly as shown here.
But how do you have a master document without having to trust anyone? What happens if the person with the master document disappears? IMO, one great part of bitcoin is the complete lack of need to trust a centralized party, but with a system with a "master document" you have created a centralized party.
sr. member
Activity: 440
Merit: 250
In order for this to work, ... If you hash a whole bunch of documents together, than all of those documents will need to be available to the third party.  This seems like it would be a problem.
The "master document" need not actually be all the day's collected documents - just a list of their hashes.  i.e. on day X at time Y in block B, a transaction occurred to a private key equal to the hash of master document Z, which therefore existed at that time.  In document Z, presented here Your Honours, we can see that there is the hash of "bob's_contract_of_employment.doc" exactly as shown here.
legendary
Activity: 1246
Merit: 1016
Strength in numbers
In order for this to work, the timestamp has to be easy to verify by a third party.  Keep that in mind when designing your system.  It can't be 100% trusted if it relies on any more than the document and the blockchain IMO.  If you hash a whole bunch of documents together, than all of those documents will need to be available to the third party.  This seems like it would be a problem.

Right, I was thinking it would be fine because he'd have a 'master document' with the days stamped docs, but people won't want to pass around the master so they'll go to his site I suppose, but that sucks because now you need him. You don't have to trust him, but you need him, or at least that doc. Still it could be useful, you could push torrents up every day with the day's stamped docs. Doesn't seem like it would scale well at all though.
hero member
Activity: 742
Merit: 500
In order for this to work, the timestamp has to be easy to verify by a third party.  Keep that in mind when designing your system.  It can't be 100% trusted if it relies on any more than the document and the blockchain IMO.  If you hash a whole bunch of documents together, than all of those documents will need to be available to the third party.  This seems like it would be a problem.
cjp
full member
Activity: 210
Merit: 124
Someone correct me if I'm wrong, but pruning is just the act of a miner forgetting something they don't need to know anymore. The tx will still have happened and still be in the chain and any service doing lookups of hashes of documents for the purpose of time stamping will be smart enough to not prune. Or maybe you can mark it in some way that lets timestamp checking services forget everything else and remember only the non-financial tx.

If people are worried about the size of the chain, maybe a way to do it is for a company to accumulate documents to be stamped, hash them all together and just include 1 hash per block/hour/day.

I think you are correct, and that is exactly what I am planning to do:
I will create "timestamp certificates" that contain:
  • Some explanation of the methods used (only part that is not machine-readable)
  • Version number of the timestamping method
  • The Bitcoin block index
  • Maybe the entire block header, if it's not too large
  • The block timestamp
  • The block Merkle tree root
  • The part of the block Merkle tree that is needed for the timestamp transaction
  • The timestamp transaction
  • The timestamp Merkle tree root, as extracted from the transaction
  • The part of the timestamp Merkle tree that is needed for this particular certificate
  • A short message, together with the secure hash of a document

I am planning to create max. 2 timestamp transactions per 24 hour, so that every document will be timestamped within 24 hours. And pruning is not a problem, since the certificate contains a local copy of the relevant parts of the block.

On the methods of encoding a hash value into a transaction: for simplicity, I'll first use the "Bitcoin messaging service" method, and later, as soon as I switch to Bitcoin 0.6, I'll use the more efficient method of using the hash as a private key.
legendary
Activity: 1246
Merit: 1016
Strength in numbers
Someone correct me if I'm wrong, but pruning is just the act of a miner forgetting something they don't need to know anymore. The tx will still have happened and still be in the chain and any service doing lookups of hashes of documents for the purpose of time stamping will be smart enough to not prune. Or maybe you can mark it in some way that lets timestamp checking services forget everything else and remember only the non-financial tx.

If people are worried about the size of the chain, maybe a way to do it is for a company to accumulate documents to be stamped, hash them all together and just include 1 hash per block/hour/day.
Pages:
Jump to: