JSON & STEEM

Hey all you non-tech-people, today's article is for you. I'm going to explain JSON's role in today's internet and tell you why it matters to STEEM (the currency), STEEM (the blockchain daemon), steemit.com (the community) and you (presumably a holder of STEEM, STEEM Power, or Steem Backed Dollars. So, with no further ado, here's some JSON:
This is the 2,000,000th block of the STEEM blockchain:
{
"id": 5,
"result": {
"previous": "001e847f77b2d0bc1c29caf02b1a98d79aefb7ad",
"timestamp": "2016-06-02T23:58:45",
"witness": "steempty",
"transaction_merkle_root": "3335e6efe04f09aac61ad1fcc241ada1e1e8fc62",
"extensions": [],
"witness_signature": "1f26706cb7da8528a303f55c7e260b8b43ba2aaddb2970d01563f5b1d1dc1d8e0342e4afe22e95277d37b4e7a429df499771f8db064e64aa964a0ba4a17a18fb2b",
"transactions": [{
"ref_block_num": 33918,
"ref_block_prefix": 2329120500,
"expiration": "2016-06-02T23:58:54",
"operations": [
["vote", {
"voter": "proctologic",
"author": "pal",
"permlink": "re-dantheman-re-pal-httpssteemit-comsteempalsniper-whale-vote-bot-strategy-20160602t162811551z",
"weight": 10000
}]
],
"extensions": [],
"signatures": ["1f0ad8680045212314210892e338f14bc4fd34b2573e6217591b036be6222c5d980dbc2d3547429924389330e876ab650a1dd9548284d8a855c96b58c542d0a499"]
}, {
"ref_block_num": 33919,
"ref_block_prefix": 3167793783,
"expiration": "2016-06-02T23:58:57",
"operations": [
["vote", {
"voter": "proctologic",
"author": "oholiab",
"permlink": "re-dantheman-re-streemian-re-re-dantheman-lessons-learned-from-curation-rewards-discussion-20160602t150813-20160602t161538485z",
"weight": 10000
}]
],
"extensions": [],
"signatures": ["1f45456b18a8df371cb1890f15f4e9a7b59b9759d9982d3e96429343c2899fcda668a295bfd6eaa630785ed807aa93485301723870d6f34769bc25a6fbc91d0253"]
}, {
"ref_block_num": 33919,
"ref_block_prefix": 3167793783,
"expiration": "2016-06-02T23:58:57",
"operations": [
["vote", {
"voter": "proctologic",
"author": "abit",
"permlink": "re-dantheman-lessons-learned-from-curation-rewards-discussion-20160602t160856942z",
"weight": 10000
}]
],
"extensions": [],
"signatures": ["1f5fd52ca5c91b118c8ac2f2f6f6df28bc10122baaabbd3f510c37b3201c86a4845419a0d6a17cf267c73d939f1fa7230c7f9f85e60b784e54cf041091d0cbb41f"]
}]
}
}
It contains all the information that's needed to use STEEM's 2,000,000th block. Posts, upvotes, everything. Now, the reverse is true for writes onto the steem blockchain. Every time you click upvote, your upvote is written into one of the blocks in the STEEM blockchain. This works by having your browser send JSON to the blockchain over something called a websocket, which allows your browser to interact with the servers running the STEEM blockchain in real-time.
One of the cool things about that block of JSON that is the 2,000,000th block is that it will ALWAYS make sense to this:
type Block struct {
ID int `json:"id"`
Result struct {
Extensions []interface{} `json:"extensions"`
Previous string `json:"previous"`
Timestamp string `json:"timestamp"`
TransactionMerkleRoot string `json:"transaction_merkle_root"`
Transactions []struct {
Expiration string `json:"expiration"`
Extensions []interface{} `json:"extensions"`
Operations [][]interface{} `json:"operations"`
RefBlockNum int `json:"ref_block_num"`
RefBlockPrefix int `json:"ref_block_prefix"`
Signatures []string `json:"signatures"`
} `json:"transactions"`
Witness string `json:"witness"`
WitnessSignature string `json:"witness_signature"`
} `json:"result"`
}
That there is what is called a struct, or structure, is capable of parsing, or "reading and understanding" ANY block of STEEM's blockchain, and that lets us programmers use it actively. Generally if you see me spouting off that we need a "JSON RPC API" or a "SWAGGER REST API," I'm basically just looking to see these things be done once, instead of by each and every developer out there. We do have a pretty big duplication of effort problem going on in the STEEM community. Usually, we call classifiers "keys" and thieir corresponding "value" values. So for example:
username:faddat
mood:bitchy
favoriteprogramminglanguage:go
hatesbutistryingtohateless:react
tags:geek,startrek,alien,crabbytoday,futurist
Now, note "tags". The "value" field is comma-delimited there. Effectively the commas have allowed me to enter multiple values in a single value field, and the structure value1,value2,value3,value4,value5 allows a computer to easily read and understand those values. key:value pairs make are a fundamental part of today's data storage systems. They seem primitive but can create quite sophisticated results. Hey, remember that struct that can read any block's JSON? Well, Here's something else we can do with it:
Now that struct is set up with notation for a graph database. Graph databases analyize the relationships between items. As in: @faddat, what are his relationships to @kloudery, and poof all the connections will become clear. Well it's not exactly that easy, but let's just say that we're going to see some hotness around here :).
Source code: https://github.com/faddat?tab=repositories
Cayley forums post: https://discourse.cayley.io/t/cayley-and-blockchain-question-on-twitter/359/18
Questions: faddat@gmail.com preferably via hangouts
Research Sponsor: @officialfuzzy of #beyondbitcoin
This post IS about the money!
Now, I want to inform people, too-- it surely serves two purposes, but right now the situation is that @officialfuzzy sponsors my research work for the STEEM blockchain (and this is all the work I do). Now, I'd not be in this position if this wasn't what I wanted to do-- it absolutely is. The issue is money to keep the work afloat. Voluntarily, I cost around $3000 per month. My expenses tend to be $1500 per month, and I've got a three month stretch coming up soon where expenses will be ~$3000/mo.
I could take a much-higher paying position
....I just don't want to. And I sure as hell don't want to NEED to.
I like what I'm doing very much right now and I want to get to my goal of ensuring that STEEM can be used as a storage system for any kind of information that can be structured in JSON. Your upvotes and what have you go directly to my expenses. Fuzzy's got a wife and kid, and he can't pay much more than he's paying now. I get that, and so before going elsewhere for money, I'm taking advantage of the money-making opportunities baked into the blockchain I <3.