9

Just one question. Where and how is the TIMESTAMP of a transaction generated?

Is it reliable to develop a transactions notification system?

Thank you! (I mean the time node below)

{ "hash":"44ffca26a089ccc806a7861e715d237d9f63b373085492f2ee82901171e8d661", "ver":1, "vin_sz":1, "vout_sz":2, "size":257, "relayed_by":"127.0.0.1", "tx_index":31066681,"result":0, "time":1351624745,"block_height":205754, "inputs":[ { "prev_out":{ "type":0, "addr":"1PAPY4UN1NtFwRibWRuFT1CkgK3NvnMpoC",
"value":879000000, "tx_index":31055718, "n":1 } } ], "out":[ { "addr":"1ELop4RiQtsVnqPJZHqErCvmJZPHsVn2YT", "value":5000000, "type":0 } ,{ "addr":"1PAPY4UN1NtFwRibWRuFT1CkgK3NvnMpoC",
"value":874000000, "type":0 } ] },

2 Answers 2

9

The timestamp is not a part of the standard transaction as per Bitcoin Protocol Specification. It is most likely generated by the standard client during the api call. The standard client might use its internal time (that might differ from the machine time), which is vulnerable to timejacking. I might be wrong, however.

As long as your client is running properly, it should be okay to use its timestamps for various notifications. They might represent the time the client received the transaction however, which may differ from the time the transaction was broadcast the first time.

1
  • 1
    This is a good question. When a block arrives with that transaction the timestamp would probably be different from the timestamp that the local node gave it. I haven't looked at what the bitcoin.org client does, so I don't know if it changes the timestamp to that from the mined block. If it does, then the value for time from the API call response can vary between when the transaction is first seen and when it has confirmed. Nov 1, 2012 at 14:24
2

"Is it reliable to develop a transactions notification system?"

this is already existing, you could be interested in looking at :

https://github.com/MORA99/BitPing.Net

afaik you dont really need the timestamp to do that, but just use a block explorer like abe : http://github.com/jtobey/bitcoin-abe

and your application will be notified of any new transaction

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.