Skip to main content

Merkel ist doch eine prima Königin. Hält die Klappe, trägt huldvoll scheussliche Klamotten und mischt sich nicht in die Politik ein.

Leute, jetzt bloß nicht zulassen, dass das jetzt alles am de hängen bleibt und wieder im Hintergrund bleibt! o_0

On use of cars: "I think we will look back on this time and say, ‘Wasn’t it odd that we drove ourselves around?’"

Wenn ich ansehe habe ich Angst vor der alternativen Realität, in der noch Nachrichten macht o_0

Programmer: "We can safely assume that interest rates are always a positive number."
Along comes Europe:

Awwww.... A good reason to earn the right to upvote comments:

My new baseline for connection quality: Does it let me ssh+screen+vim?
Suffice to say mine doesn't meet this criterion :(

WHO THE FUCK PUBLISHES A DATASET WITH '(', ')' and '#' in the filenames!?!
Faith in humanity lost... :(

"Capitalize all words in titles of publications and documents, except a, an, the, at, by, for, in, of, on, to, up, and, as, but, it, or, and nor."
Well, that's a handy rule :)

Biking madness in Grenoble

Biking madness in Grenoble

Just found three or four places like this one while going to Grenoble Gare. You follow the bicycle lane, and suddenly you are in a one way street. And no, not one that's marked bidirectional for bikes... o0

Via fefe: Eine Erinnerung, warum wir in Deutschland auch weiterhin einen Widerstandsparagrafen brauchen.

A Quick Note on Twister's Blocks

6 min read

This is just a quick note about what the blockchain does and does not store.


I didn't write this software, and I am mostly trying to make sense of it myself at the moment. So if you find things that are unclear, incomplete or plain wrong, please tell me!

The "what is not in the blockchain?" part is easy: anything that does not relate to user names, public keys, the spam messages or the blockchain itself lives outside the blockchain. Profiles and twists are stored in a Distributed Hash Table (DHT) and the twists also in a torrent swarm. This is because storing all twists in the chain, although possible, would not scale. A block chain is relatively slow, and more importantly, all nodes of the network would have to download and store all twists ever made.

So what does the chain store, concretely? You can find out by running some simple commands for your local twister daemon:

Let's get a random block from the chain:

$ ./twisterd getblockhash  71772

$ ./twisterd getblock  70b7f1bb37eb72d587f45457c5c0c0bdadd206f0115f66787d8565761688bd1d
    "hash" : "70b7f1bb37eb72d587f45457c5c0c0bdadd206f0115f66787d8565761688bd1d",
    "confirmations" : 38,
    "size" : 361,
    "height" : 71772,
    "version" : 2,
    "merkleroot" : "ba8dd4de438b296fe16f619f16a988700f1161fbba3fefadef7df14964823c7b",
    "tx" : [
    "spamMessage" : "Promoted posts are needed to run the network infrastructure. If you want to help, start generating blocks and advertise. [en]",
    "spamUser" : "brunus",
    "userhashes" : [
    "usernames" : [
    "time" : 1422554853,
    "nonce" : 4700834,
    "bits" : "1d429ed8",
    "difficulty" : 0.01501017,
    "previousblockhash" : "6d36ace676ce6a8e600f31fa743eef7e96110c3713d9736f138cd864a9fa7c88",
    "nextblockhash" : "8da5a51cf66ee39e0fb98dd5b137a19ec143d80e085083317c96e4ff36e8d149"

This is a human-readable representation of a block as it is stored in the blockchain. The non-readable version is this:

$ ./twisterd getblock  70b7f1bb37eb72d587f45457c5c0c0bdadd206f0115f66787d8565761688bd1d false


Let's stick with the readable version... :)

Most of what you see here are things that take care of the blockchain itself. For example:

  • blockhash identifies this block
  • previousblockhash links it to its predecessor (hence the name "blockchain"
  • difficulty controls how many values for nonce need to be tried to generate a block. It gets adjusted automatically as a function of the timestamps in the chain.

While this is all very fascinating, it is nothing specific to the Twister blockchain. In fact, the only thing in which Twister significantly differs from the bitcoin chain is what the transactions (or short: tx) contain and what the miner gets for the mining.

Now, the transactions in Twister don't say "Alice just sent Bob 0.001 BTC" as they do for Bitcoin. Rather they tell the Twister daemon who registered and what public key they are using. So in block 71772 the user kwofu registered and that got recorded in the blockchain.

$ ./twisterd getrawtransaction kwofu 1

    "hex" : "010000000006056b776f6675222103fccd1d6050f2abb9b8ece690672720600afccd553dfeb0dd23587d02601928a417033e00",
    "txid" : "6756f780590a51b6857104268c58c331b432b3d17290dbabd496c7f95c1033b0",
    "version" : 1,
    "mess   age" : "",
    "username" : "kwofu",
    "pubKey" : [
    "nonce" : 4064023,
    "blockhash" : "70b7f1bb37eb72d587f45457c5c0c0bdadd206f0115f66787d8565761688bd1d",
    "height" : 71772,
    "confirmations" : 44,
    "time" : 1422554853,
    "blocktime" : 1422554853

The hex field contains all the information we see here, just more in a more compact encoding. The txid uniquely identifies this particular transaction. height tells us which block this transaction is a part of. username and pubkey are the part that we are actually interested in. Having the username and public key linked together by putting them into one transaction allows us to check if a particular twist from kwofu is actually signed with kwofu's key. This is how Twister checks that nobody can pose as another user.

The mining part is fairly simple: a Bitcoin miner will get 1 BTC for successfully mining a block. A Twister miner gets to put their name and message into the block itself. Since these messages get stored on every daemon, they can be shown as advertisement to every user. The idea is that every server and every client application will at least show some of them so that mining will actually be an attractive advertising option. Or maybe some other solution will be found to the question of "Who keeps the Twister network running?" Who knows. Anyway, spam messages can either be posted by @nobody in which case the spam message will just be entered into the block by the miner and that's it. Or it can be posted in the name of an existing account. For the above block, that was @brunus.

    "txid" : "0000000000000000000000000000000000000000000000000000000000000000",
    "version" : 1,
    "message" : "Promoted posts are needed to run the network infrastructure. If you want to help, start generating blocks and advertise. [en]",
    "username" : "brunus",
    "pubKey" : [
    "nonce" : 0,
    "blockhash" : "70b7f1bb37eb72d587f45457c5c0c0bdadd206f0115f66787d8565761688bd1d",
    "height" : 71772,
    "confirmations" : 54,
    "time" : 1422554853,
    "blocktime" : 1422554853

Although I am not quite sure why that txid is always 0 for the spam transactions...

Anyway, hope this was interesting to someone else than me :P