Using Namecoin as a proof of existance

Other projects
FKlama
Posts: 4
Joined: Wed Jul 29, 2015 12:02 pm
os: linux

Using Namecoin as a proof of existance

Post by FKlama » Wed Jul 29, 2015 12:16 pm

I am working on the e-assesment team of a German university, and we are thinking about using Namecoin to publish SHA256 hashes over archives of finished exams, to be able to prove they where unaltered since the day they where created, and prove the day they where created.

I am a bit unsure what namespace to use for this though.
I would think I should use 'poe/' for this, but I am a bit unsure if this will just work, since it is labeled "proposed".

Any advice is appreciated.

bossnmc
Posts: 3
Joined: Wed Jul 29, 2015 1:25 pm

Re: Using Namecoin as a proof of existance

Post by bossnmc » Wed Jul 29, 2015 1:29 pm

can you explain a little more on what you are trying to do ?
not enough detail for me to figure out what you need advice on

FKlama
Posts: 4
Joined: Wed Jul 29, 2015 12:02 pm
os: linux

Re: Using Namecoin as a proof of existance

Post by FKlama » Wed Jul 29, 2015 1:58 pm

After the students take the computerized test, the ansers they gave are packed (.tar.gz) and a SHA256 Hash of this archive is generated.
The idea is that we publish the SHA256 Hash in such a way that we can prove that the archive was generated the day of the exam. While the hash itself confirms it wasn't changed, I am thinking of publishing the hash using Namecoin, as an additional proof that the archive was generated on the day of the exam.

domob
Posts: 1116
Joined: Mon Jun 24, 2013 11:27 am
Contact:

Re: Using Namecoin as a proof of existance

Post by domob » Wed Jul 29, 2015 3:04 pm

See https://www.domob.eu/blog/2015/0225-NameStamp.php. In short, I think you should not worry too much about the namespace. However, I suggest you use only a few names instead of a new name for each time-stamping operation. You can put the hash into the name's value and keep reusing them.
BTC: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/

phelix
Posts: 1631
Joined: Thu Aug 18, 2011 6:59 am

Re: Using Namecoin as a proof of existance

Post by phelix » Wed Jul 29, 2015 3:22 pm

Note names expire every half year or so (36000 blocks) and you might or might not have to update the name depending on your use case.
nx.bit - some namecoin stats
nf.bit - shortcut to this forum

FKlama
Posts: 4
Joined: Wed Jul 29, 2015 12:02 pm
os: linux

Re: Using Namecoin as a proof of existance

Post by FKlama » Wed Jul 29, 2015 3:50 pm

I assume when using only a few names, I would change the value with each update.
How would I go about recovering the hash in this case? The newest one could easily be retrived using 'name_show', but how could I recover older versions?
I know they exist in the blockchain, but how would I go about recovering one of the numerous older values behind the name I would use?

domob
Posts: 1116
Joined: Mon Jun 24, 2013 11:27 am
Contact:

Re: Using Namecoin as a proof of existance

Post by domob » Wed Jul 29, 2015 7:20 pm

FKlama wrote:I assume when using only a few names, I would change the value with each update.
How would I go about recovering the hash in this case? The newest one could easily be retrived using 'name_show', but how could I recover older versions?
I know they exist in the blockchain, but how would I go about recovering one of the numerous older values behind the name I would use?
You can use "name_history". If you run Namecoin Core, you have to set "namehistory=1" in the config file or use "-namehistory" as command-line option.

Somewhat alternatively, you can also record the txid somewhere (e. g., together with where you store the files). Then looking the transaction up with either a block explorer (unsafe) or "getrawtransaction" also shows the hash.
BTC: 1domobKsPZ5cWk2kXssD8p8ES1qffGUCm | NMC: NCdomobcmcmVdxC5yxMitojQ4tvAtv99pY
BM-GtQnWM3vcdorfqpKXsmfHQ4rVYPG5pKS
Use your Namecoin identity as OpenID: https://nameid.org/

cassini
Posts: 332
Joined: Sun May 26, 2013 6:36 pm

Re: Using Namecoin as a proof of existence

Post by cassini » Wed Jul 29, 2015 11:09 pm

Before we dig deeper into the details of whether the poe/ namespace is the most suitable solution, or if domob's NameStamp system would be more efficient for this use case, let me first ask these two questions @FKlama:

(1) Are you already running a Namecoin client, and if so, which one?
(2) Have you got some experience with name_new, name_firstupdate and name_update operations?

FKlama
Posts: 4
Joined: Wed Jul 29, 2015 12:02 pm
os: linux

Re: Using Namecoin as a proof of existance

Post by FKlama » Thu Jul 30, 2015 11:47 am

1) Yes, I am running namecoind
2) A bit, I registered a name for testing and updated it once to confirm that I can see the old data with "name_history"

I now have a much better understanding of how this could work for my use case. I still have a few more questions though:
Will 'gettransaction' and 'getrawtransaction' work after a name has expired?
Will 'name_history' work after a name has expired?

This would be quite important if we would need to prove the integrity of an archive a few years after it is generated. Also is there a more elegant way than

Code: Select all

namecoind getrawtransaction <txid> | perl -pe 's/([0-9a-f]{2})/chr hex $1/gie'
to display the value that was set in the transaction?

I also noticed a discrepancy when experimenting with namecoin-qt privately, where I was charged 20mNMC for a name_new (d/), while when using namecoind I was charged 10mNMC for name_new (poe/).

cassini
Posts: 332
Joined: Sun May 26, 2013 6:36 pm

Re: Using Namecoin as a proof of existance

Post by cassini » Fri Jul 31, 2015 1:20 am

FKlama wrote:Will 'gettransaction' and 'getrawtransaction' work after a name has expired?
If the transaction belongs to the current wallet.dat file, then yes.
gettransaction and getrawtransaction cannot retrieve data from transactions generated by other wallet files. (However, the new Namecoin Core client can be run with the -txindex argument. It enables the client to look at any transaction in the blockchain, no matter who created the transaction.)
FKlama wrote:Will 'name_history' work after a name has expired?
Yes, name_history displays all the expired and unexpired transactions of a name.
FKlama wrote:Also is there a more elegant way than

Code: Select all

namecoind getrawtransaction <txid> | perl -pe 's/([0-9a-f]{2})/chr hex $1/gie'
to display the value that was set in the transaction?
I recommend using gettransaction first which gives you a properly formatted JSON. Then, in a second step, extract the name from this JSON record, and use it for name_history. Software testing and maintenance will be easier this way.
FKlama wrote:I also noticed a discrepancy when experimenting with namecoin-qt privately, where I was charged 20mNMC for a name_new (d/), while when using namecoind I was charged 10mNMC for name_new (poe/).
I can't remember the details of the fees discussion in those days, but it was something like this:
The average Namecoin-Qt user hasn't got the time or experience to deal with pending transactions. Therefore let's set the standard fee to 20 mNMC to make absolutely sure the miners accept it a.s.a.p.
The average namecoind user is experienced enough (or has the time to ask for advice) in case of pending transactions. 10 mNMC is sufficient in 99,99 % of all the cases, but there is still a small risk the miners refuse the transaction for a long period of time.
Furthermore, there is a somewhat complex formula in the code of all client versions that can force the client to increase this fee. Transaction length, "coin dust" (using a highly fragmented wallet for creating this transaction) and a low "coin age" can trigger a temporary fee increase.

Post Reply