Giving some Fucks

Thanks to sites like Coingen, creating your own altcoin is a pretty simple process to initiate.

As the owner of the domain fuckcoin.com, I was happy to see somebody create just that, Fuckcoins. My lifelong dream of a domain name actually paying off aside, I also think that literally "giving fucks" is hilarious and I was excited to contribute to the amusing project.

My goal was simple, put up something quick and useful on fuckcoin.com. I thought that I could potentially find some bitcoin related open source projects and apply them to Fuckcoin. Considering the codebase for these altcoins is similar to that of bitcoind, I had hoped this would be an easy conversion.

Some quick searching found two open source projects:

Both projects have solid walkthroughs for installation and, overall, seem quite polished.

Coinpunk

Right off the bat, there was a clear sign that this wasn't going to be easy. Coinpunk runs off of a modified bitcoind codebase which allows for adding watch-only addresses. This feature isn't just a nicety, it allows for proper security architecture with hot, cold and, most importantly, read-only wallets.

I managed to find some people who recently ported the necessary patch to Dogecoin but I haven't had any luck porting this patch to fuckcoind.

I decided that a wallet would have to wait, maybe there was an easier system to setup.

Insight

This seemed like it was going to be a lot more likely to be successful. All I needed to do was have it run through the blocks of fuckcoind and hold a database of them for easy lookup.

My attempt was quickly thwarted here as well. Insight starts at block 0 and then validates the entire chain as it imports. Naturally though the Genesis Block for fuckcoin is different than that of bitcoin. Getting past this step required some researching of Insight, bitcore (the engine powering Insight) and a comparison of the bitcoin and fuckcoin genesis blocks.

The Bitcoin Genesis Block

{
    "hash" : "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "size" : 285,
    "height" : 0,
    "version" : 1,
    "merkleroot" : "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
    "time" : 1231006505,
    "nonce" : 2083236893,
    "bits" : "1d00ffff",
    "difficulty" : 1.00000000,
    "tx" : [
        "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
    ],
    "nextblockhash" : "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048"
}

The Fuckcoin Genesis Block

{
    "hash" : "32f3a2c560499f2600108f5b10dadcfd0c000aa1d6fef25b26d0871d72e607a9",
    "confirmations" : 37314,
    "size" : 260,
    "height" : 0,
    "version" : 1,
    "merkleroot" : "537b5010fe44a2dd680dd345f9554d4f9e99154b34ef03e1303698d5d9ed2cdb",
    "tx" : [
        "537b5010fe44a2dd680dd345f9554d4f9e99154b34ef03e1303698d5d9ed2cdb"
    ],
    "time" : 1389920669,
    "nonce" : 850900,
    "bits" : "1e0fffff",
    "difficulty" : 0.00024414,
    "nextblockhash" : "8eb49cba1178968088196687155332c60a4f7cb60d0386df9f40fb13d77b0a38"
}

This is the section of code in bitcore that needs to be tackled for an altcoin:

https://github.com/bitpay/bitcore/blob/879b9b4cefd5c67f009780fd5643867bf985660c/networks.js

exports.livenet = {  
  name: 'livenet',
  addressVersion: 0x00,
  magic: hex('f9beb4d9'),
  genesisBlock: {
    height: 0,
    nonce: 2083236893,
    version: 1,
    hash: hex('6FE28C0AB6F1B372C1A6A246AE63F74F931E8365E15A089C68D6190000000000'),
    prev_hash: new Buffer(32).fill(0),
    timestamp: 1231006505,
    merkle_root: hex('3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A'),
    bits: 486604799
  },
  genesisBlockTx: {
    outs: [{
      v: hex('00F2052A01000000'), // 50 BTC
      s: new Put()
        .word8(65) // 65 bytes of data follow
        .put(hex('04678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5F'))
        .word8(0xAC) // OP_CHECKSIG
        .buffer()
    }],
    lock_time: 0,
    version: 1,
    hash: hex('3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A'),
    ins: [{
      q: 0xFFFFFFFF,
      o: hex("0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF"),
      s: new Put()
        .put(hex('04FFFF001D010445'))
        .put(new Buffer('The Times 03/Jan/2009 Chancellor on brink of ' +
                        'second bailout for banks', 'ascii'))
        .buffer()
    }]
  },
  proofOfWorkLimit: hex("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
  checkpoints: [], // need to put checkpoint blocks here
  addressPubkey: 0,
  addressScript: 5,
  keySecret: 128,
};

Here are the (incorrect) settings I have currently for the fuckcoin genesis block:

exports.livenet = {  
  name: 'livenet',
  addressVersion: 0x00,
  magic: hex('f9beb4d9'),
  genesisBlock: {
    height: 0,
    nonce: 850900,
    version: 1,
    hash: hex('32f3a2c560499f2600108f5b10dadcfd0c000aa1d6fef25b26d0871d72e607a9'),
    prev_hash: new Buffer(32).fill(0),
    timestamp: 1389920669,
    merkle_root: hex('537b5010fe44a2dd680dd345f9554d4f9e99154b34ef03e1303698d5d9ed2cdb')
    bits: 486604799
  },
  genesisBlockTx: {
    outs: [{
      v: hex('00F2052A01000000'), // 50 BTC
      s: new Put()
        .word8(65) // 65 bytes of data follow
        .put(hex('04678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5F'))
        .word8(0xAC) // OP_CHECKSIG
        .buffer()
    }],
    lock_time: 0,
    version: 1,
    hash: hex('537b5010fe44a2dd680dd345f9554d4f9e99154b34ef03e1303698d5d9ed2cdb'),
    ins: [{
      q: 0xFFFFFFFF,
      o: hex("0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF"),
      s: new Put()
        .put(hex('04FFFF001D010445'))
        .put(new Buffer('How Sex Affects Intelligence, and Vice Versa', 'ascii'))
        .buffer()
    }]
  },
  proofOfWorkLimit: hex("00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),
  checkpoints: [], // need to put checkpoint blocks here
  addressPubkey: 0,
  addressScript: 5,
  keySecret: 128,
};

Hopefully a bit more wrestling will get this working though. I will keep editing this article as I get closer.

If anybody has tackles this problem already though, please let me know!

Great article about nothing...

Ya, sorry about that. I wish I could say that fuckcoin.com is now a great service you can use to watch over the fuckin network or a solid secure online wallet for sending fucks to all... but it turns out that this is going to take effort - and that is actually the point of this article.

We have all these altcoins popping up, but they aren't actually all that useful until the supporting infrastructure starts to appear. That infrastructure isn't easy though. Bitcoin has been around for 5 years and solid sites and projects are only really now started to appear. Having altcoins is great and all, but how useful are they in their current incarnations and what can be done to projects, such as insight and coinpunk, to help them cross over into the altcoin space?