Chris McCormick - News http://mccormick.cx/news/ Chris McCormick - News en Copyright 2008- Chris McCormick 60 GMT chris@mccormick.cx mccormick.cx/news/ Zero Feature Software entries/zero-feature-software http://mccormick.cx/news/entries/zero-feature-software Let's build software like an axe.

An axe in a block of wood

feature

n.

A prominent or distinctive aspect, quality, or characteristic: a feature of one's personality; a feature of the landscape.

Properties of an axe:

  • Does not have "features".
  • Useful to ordinary people.
  • Does only one thing & does it well.
  • Simple to obtain, use, and maintain.
  • Does not have "upgrades".
  • Works on a platform that nearly everybody has.
  • Is the property of the owner.

For the task of chopping wood the axe is a perfect technology.

An axe is made to do one thing and do it well. It has no features.

An axe is finished. You buy the axe from the store and it chops wood.

The axe design changes only over millenia: slowly and carefully. The axe itself does not change.

An axe does not receive upgrades. Nobody wants "continuous delivery" for their axe. The axe is immutable.

Software axes

Let's build software like an axe.

  • Let's remove all the "features".
  • Let's do one thing and do it well.
  • Let's build things simple enough to secure.
  • Let's finish the software before we release it.
  • Let's release immutable, self-contained artifacts.

By all means, experiment. When it comes time to release let's be disciplined and craft something secure, wholesome, and complete.

Examples of software axes

Hand holding an axe

]]>
/tags/all Mon, 12 Nov 2018 02:36 GMT
Hashcash Auctions for Decentralized Resource Allocation entries/hashcash-auctions-for-decentralized-resource-allocation http://mccormick.cx/news/entries/hashcash-auctions-for-decentralized-resource-allocation Abstract

Hashcash is a mechanism for defending against spam and denial-of-service attacks in email and other decentralized systems. Implementors of systems using hashcash face the issue of how to set the proof-of-work difficulty. A general solution to this problem is given which can be used to predictably allocate resources in decentralized systems where individual nodes each contribute finite resources. Some emergent effects of this solution are explored.

Hashcash client-puzzle token represented as a dollar bill

Hashcash

Nodes in decentralized systems face two closely related issues around the use of their resources. The first problem is that of how to fairly allocate resourcess between connecting clients, and the second problem is that of how to protect themselves against resource depletion attacks. Some systems, like Bittorrent, largely sidestep these issues because the goals of participants (download the data quickly) are aligned. In other systems such as email, nodes are vulnerable to resource depletion attacks like spam and denial-of-service (DoS) attacks.

In 1997 Adam Back proposed an ingenious & practical scheme for countering DoS attacks and spam emails called hashcash. This scheme was famously referenced by, and used with some tweaks, in the software which launched the cryptocurrency revolution: Bitcoin.

As noted in the 2002 Hashcash paper the idea of using a proof-of-work in this way predates Hashcash in the work of Cynthia Dwork & Moni Naor, 1993 and later in the client-puzzles work of Ari Juels & John Brainard, 1999.

Adam Back's implementation is notable because it was based on a modern widely implemented cryptographic hash function, used a cleverly simple leading-zeroes hash collision mechanism which is verifiable with the naked eye, and most importantly of all it came with concise source code which anybody could compile and run ("cypherpunks write code").

The common idea behind these proof-of-work schemes is that you do not allocate resources to the processing or storage of incoming messages unless the sender has proven that they have done a certain amount of computational work. A spammer or DoS attacker is forced to multiply the work required by the number of attacking nodes they are utilising making it more expensive for them to attack. The key to the proof-of-work mechanism is that it is easier for the receiver to verify the proof than it is for the sender to construct the proof, and secondly, that the receiver can specify how much work the sender needs to perform in order to be considered. In Hashcash the construction of proofs-of-work and their more efficient verification is accomplished with a basic building block of cryptographic systems, a computational trapdoor: the hash function. The second key to proof-of-work, that of the receiver specifying the difficulty to require of clients, is not clearly addressed in this body of work. Here we'll describe a general solution to the problem of setting PoW difficulty and explore some emergent effects of the solution on decentralized systems.

Drawing of a pick and shovel

The difficulty of calibrating hashcash difficulty

In Dwork & Naor (1993) they say:

There is a pricing authority who controls the selection of the pricing function and the setting of usage fees.

And later, in the section on the Fiat-Shamir signature scheme:

A reasonable choice is k = 10.

Where k here is equivalent to what we now call the difficulty in cryptocurrency proof-of-work contexts. Basically "here's a reasonable value to use on today's computers". This strategy is not tenable in many decentralized systems because a pricing authority, or "trusted third party" is an inherent security risk (Szabo, 2001).

In Adam Back's 2002 paper there is a section called "Dynamic Throttling":

With interactive hashcash it becomes possible to dynamically adjust the work factor required for the client based on server CPU load.

But it's not clear exactly how much difficulty should be assigned in proportion to the server CPU load.

Futher, on the "Bitcoin" page of hashcash.org:

Hashcash difficulty is static and eroded by Moore's law currently 20 bits.

Again we see a "reasonable value to use on today's computers".

In "How bitcoin uses hashcash":

Hashcash was expected to adjust difficulty every 6 months or year, manually based on observed moore's law estimates. It was proposed that this be measured against a benchmark machine by some vague/undefined human consensus process and broadcast via signed difficulty update headers, and/or long TTL DNS TXT records.

He further points out that Bitcoin's "automatic inflation control" innovation has solved this problem for the cryptocurrency case.

In the 2002 paper again we see the following in the section on mitigation of TCP connection-slot depletion, which concludes with:

Connections will be handed out to users collectively in rough proportion to their CPU resources, and so fairness is CPU resource based (presuming each user is trying to open as many connections as he can) so the result will be biased in favor of clients with fast processors as they can compute more interactive-hashcash challenge-response tokens per second.

The implementation detail of exactly how much difficulty to require per connection slot is again left as an exercise to the reader. Adam Back's original hashcash announcement on the Cypherpunks mailing list makes reference to a fixed difficulty of the first 20 bits of zeroes and as noted in the Wikipedia page on hashcash this becomes a sort of de-facto standard reference value.

Drawing of a flyer with tear-away tabs

Existing solutions

How high to set proof-of-work difficulty is of course not completely vague and unsolved. Bitcoin famously pits miners against each other using a hashcash difficulty that is adjusted every two weeks to a value computed from previously achieved hash difficulties. Referring back to the TCP connection slot depletion example in the 2002 paper, we can think of the Bitcoin miner hashcash use-case to be a slot of size 1 that is only available to be filled every 10 minutes. Hash rates are forced upwards by competition for that single slot between miners who will be rewarded under the incentive model of the Bitcoin system.

There is another mechanism in Bitcoin that we can also borrow from for decentralized systems (absent a fully functional and carefully engineered global store-of-value system called a Blockchain); the fixed block size. In Bitcoin the size of each block storing transaction data, and therefore ultimately the number of transactions, is fixed. This was a point of contention for some time amongst Bitcoin enthusiasts and stakeholders but in the end those supporting a fixed block size had their day and Bitcoin today retains a fixed block size into which transactions from the mempool must be squeezed.

Every Bitcoin transaction is accompanied by a fee paid to the miner who mines the block in which it is included. To decide which transactions should be accepted into the block they are minting miners naturally refer to these fees out of financial self-interest, to ensure they capture the highest aggregate fee possible. When a new block is minted a miner will sort the transactions from those with the highest fee paid to those with the lowest fee paid. Then they will insert into the block the top-N-by-fee transactions that will fit into the fixed block size.

So we have three models to build our solution on: the TCP connection slot example, Bitcoin's automatic inflation control, and Bitcoin's fixed block size.

Consider that in all three of these examples the fundamental resource being allocated is subject to fixed constraint, whether it is TCP slots, Bitcoin issued per 10 minutes, or the transaction-processing capacity of Bitcoin nodes. It is in fact always the case that there are resource limits placed on networked services even if that limit is sometimes so high as to give the illusion of being unlimited. Take for example the original use-case of hashcash, the email inbox: here the limited resource is your own time and attention. There is some practical upper bound on that resource such that you would be fundamentally unable to check your email if you were receiving e.g. 10,000 emails per hour. This is also true of the resources of nodes in any decentralized system.

We can use the fixed block size model in combination with hashcash to balance load and distribute resources efficiently in decentralised systems with automatic difficulty adjustment and without requiring a full cryptocurrency blockchain implementation or trusted central authority.

Drawing of an auctioneer's gavel

Fixed resource hashcash calibration

The "fixed block size" mechanism can be used more generally in decentralized systems to protect nodes from resource depletion and deterministically allocate resources by conducting a "hashcash auction" between clients over the available resources.

The hashcash auction works as follows:

  • Each node specifies the number of clients they can comfortably serve as R, given their resource limits on disk, bandwidth, CPU, etc. This can often be computed based on simple measurement of the resource(s) in question.
  • Nodes issue HMAC'ed tokens ("symmetric key certificates" in the hashcash paper) to clients who request access which include a timestamp so that they can be expired.
  • To use a node's resources, clients must bid for a slot by performing a PoW over these tokens.
  • Nodes publish the upper, lower, and median PoW currently acheived by clients occupying the available resource slots R.
  • Connecting clients are added to the client pool, which is sorted by PoW difficulty-achieved, and only the top R by difficulty are serviced.
  • (Optionally, the lower-bound minimum PoW can be capped, to emulate the same basic DoS protection that hashcash provides.)
  • (Optionally, dependent on use-case, clients are disconnected after some time and required to re-bid for a slot).

In short, you decide how many clients you can service at a time (R), then sort connecting clients by their PoW height, and then deny access to, or disconnect clients who fall outside the top R.

Node awaiting client connections

Note that the server is not required to store any information relating to the the tokens it gives out to prospective clients because it can use the HMAC to verify the tokens it has issued and the time at which they were issued. In this way the issuance of tokens and their expiry becomes very cheap for a service node.

Client bids for a service slot

The natural consequence of a system like this is that clients must compete for available slots to use the node's resources, and a node does not need to specify exactly how much PoW each client must perform. Instead clients arrive at this value through an emergent bottom-up bidding process. The node no longer has to guess at "20 bits" and can instead honestly say "look, here is how hard other clients are working, if you want to access my resources you'll have to do better".

Client 4 out-bids

The clients themselves determine the proof-of-work difficulty setting in an ongoing auction where they must make a higher bid than other clients in order to be allowed access to consume the fixed set of resources, or go elsewhere.

To cope with large numbers of clients and provide a higher level of granularity in the PoW ranking, a simple less-than operator can be used so that clients can bid for intermediate values. For example 0x01fe < 0x01ff so a client bidding with a hash of 0x01fe would beat a client bidding with a hash of 0x01ff.

Properties of this system

What this restricted-resources scheme gives us is a way to measure the sacrifice (Nick Szabo, 2002,2005) that a client is willing to make for the privilege of using a node's resources. As with the human measure of time sacrificed in Szabo's article, it is not an ideal way to measure the importance of incoming client connections, but it is better than existing systems which are essentially a lottery, or in some cases "let the bad guy win". It is not perfect but rather a "proxy measure" which gives a service a deterministic ranking system of roughly those clients who most badly want or need access.

Drawing of an hourglass

At first this system seems unfair - those clients with the most CPU are able to dominate access to resources - but notice that it is much fairer in the worst case where a motivated legitimate client can still get access under DoS or spam attack by working hard to out-compete just a single instance of the attacker. Given enough motivated legitimate users there now also exists a way for them to collectively out-compete a spam or DoS attack. In other words, utilising this scheme has a better failure mode than the free-for-all which normally prevails in networked systems.

Another way of looking at this system is that we have inverted the security aims from "keep out the bad guys" to "keep in the good guys". By giving motivated users a way to express the strength of their need we are able to keep those clients connected who signal the most need to access to the resources. We are able to preference those users who will actually utilise the resource with a higher probability than those users who will waste it, because wasting it is now costly.

A further benefit is that the service utilising this scheme is protected from hard failure. In the worst case failure mode an attacker is only able to deplete resources up to the comfortable hard-limit R specified by the server, meaning the server is never placed under such high load that it entirely crashes and burns, so long as R is specified within serviceable bounds.

In the real world there is always a constraint upon resources, and it is often the case that those wanting to consume a resource must hustle harder to get access. This scheme has an honesty that mirrors the reality of constrained resources rather than pretending that resources are infinite, which is what many historically optimistic decentralized systems do to their detriment. A computer cannot consume more disk space than 100% of disk, and it cannot utilise more CPU time than 100% of CPU time. Modern network services are often deployed without acknowledging these real constraints and with vague hand-waving about "scaling" by adding more machines to accommodate load. That's fine for Silicon Valley backed ventures with money to burn but decentralized systems are often run by volunteers contributing their precious personal resources. Silicon Valley assumptions on volunteer run networks are likely to lead to ruin.

Finally, this scheme has additional emergent benefits in the case where clients have a choice of decentralized service providers. This case is common in decentralized systems where some subset of participants run their own "full nodes" which other clients may then utilize.

Bottom-up load balancing

The further interesting consequence of the hashcash auction scheme arises when we have many service nodes providing the same decentralized service. In the auction-determined proof-of-work difficulty setting, clients now have a clear signal about which nodes are under most heavy use and can freely choose those nodes where the PoW, and hence the resource usage, is lower. Given a choice between node X which requires a very high PoW and node Y which requires a lower PoW, a client will naturally try to connect to node Y first.

Bottom-up load balancing

The result of clients seeking lower-difficulty service nodes is that they spread themselves more evenly across the available servers. This less clustered network graph can lead to a healthier more decentralized system without requiring any kind of central coordination to acheive it. This emergent effect is a sort of bottom-up load balancing system.

Expiry and time preference

Decentralized systems differ in the way in which resources are allocated over time. Sometimes the resource provided by nodes is small and fast, such as UDP packets in Bittorrent's DHT. Other times the resource may be longer lived and more expensive on a per-unit basis, for example disk space storage or a regularly run cron job.

In the situation where resources are long lived and expensive to maintain it makes sense to require clients to periodically re-bid for their access to the resources in question. For example, rather than storing a connecting client's data on disk indefinitely the service node could require that a client re-bids for the disk space once a month or once a year.

A variant on this would be to use a time-based weighting factor on the PoW submitted by connecting clients such that the PoW of more recent connections are weighted higher during bid sorting than older connections. For example if you wanted to preference more recent connections instead of sorting on PoW you could sort on some variant of PoW / (t + 1) where t is the time since connection.

Graph of PoW over t plus 1

In the parlance of economics this introduces a time preference into the system.

Example

Let's close with an example.

Imagine a decentralized social network where users are able to make posts and collect and publish replies to those posts. This can be accomplished in a decentralized way by representing users as key pairs and having every post and every reply signed by its owner's key pair to demonstrate authenticity rather than relying on a centralized trusted third party for authentication. While a user is online they can host their own set of cryptographically signed posts for others to download via a peer-to-peer network, and collect replies to those posts in the same way. However, what happens when the user goes offline, turns off their devices, goes to sleep etc.?

One solution is to have "followers" of the user automatically mirror their posts for other users to download while they are offline. This solution is better than nothing but falls short when a user has few followers or only has followers in the same timezone such that they will all be offline around the same time. Segments of the social network would go dark for periods of time leading to a lack of reliability of access and a form of accidental time-based self-censorship. Some audiences may be satisfied with such a constraint as a tradeoff for a higher degree of privacy and overall censorship resistance, but a mainstream audience is unlikely to accept this lack of reliability.

A more robust solution would be to back this up with a set of volunteer run "full nodes" which users could enlist to mirror data and collect replies in their absence. This architecture immediately begs a number of questions around allocation of the "full node" contributed resources of disk space and bandwidth. How do nodes protect themselves against greedy clients taking all bandwidth and disk space? How do clients protect against spammy replies? How do nodes protect against censorship via resource exhaustion and DoS?

Using the "hashcash auction" we can get a reasonable solution to these problems, bringing higher availability to the system. Those nodes which provide the service of replicating user posts would measure how many clients they are willing and able to serve based on system resources. They can each do this by measuring their disk space for example and allocating a fixed amount of disk per user to a fixed number of users R keeping this constraint within the disk space each has available. Each full node then requires connecting users to bid for a storage slot for the hosting of their posts while offline. Only those clients who are able to demonstrate their need the most strongly will be able to use the offline-replication service of a node. When new nodes are deployed clients will naturally tend towards them as they choose the lower PoW requirement relative to nodes which are serving many existing connections and therefore have higher PoW requirements.

Those users who might run a full node, and others interested in the health of the network, also have a clear signal as to the current load on the whole system and the relative need for more nodes by looking at the PoW they require in aggregate. People who might run a voluneer node are also provided an assurance that there is a fixed cost on the resource they will be donating, making it more likely that people will be willing to run full nodes to support the system. Finally, there is an incentive to running a full node as the user could white-list the cryptographic keys of their own devices and those of their friends and family, meaning that those accounts are always given preference over the accounts of strangers, bringing benefit to both sets of users.

Drawing of Wampum beads

Addenda

  1. In the spirit of "cypherpunks code" I recently published scrypt-hashcash which provides a basis upon which to validate some of these ideas on the web. For example browser based clients could bid for resources by performing a hashcash PoW using this library and submit it via HTTP, WebSocket, or WebRTC connection to the service conducting the resource auction.

  2. It is interesting that Hal Finney touched on a related idea in RPOW enabled BitTorrent and in true cypherpunk tradition offered code implementing his ideas:

Imagine a version of BitTorrent where nodes that have completed their downloading (called "seeders") could earn RPOWs by continuing to upload. And what could they do with those RPOWs? Imagine further that this version of BitTorrent allowed nodes to send RPOWs in order to get higher priority from other nodes which are downloading. Just such an experimental, RPOW-enhanced version of BitTorrent is now available for download.

Read more posts on the subject of cryptography & decentralized systems.

]]>
/tags/all Sat, 27 Oct 2018 07:11 GMT
Schiphol 23: Airport Missions MMOG entries/schipol-23-airport-missions-mmog http://mccormick.cx/news/entries/schipol-23-airport-missions-mmog Schiphol 23 mockup

I had an idea for a video game a while back. It's a multiplayer mission game with rogue-like elements, set in various procedurally generated airports through which you can transit.

Airport ambience by wichiogarcia on freesound.org

Everybody's missions are all mixed up together, so you might have a mission to deliver a package and somebody else's mission is to stop you. You might be trying to transit throuh several airports and other people are trying to catch you. You might be trying to find an item that somebody else has hidden. You might be chaperone to a VIP and the VIP is another player. Missions would last an average of 5 minutes each and feature a count-down timer as in the game Counterstrike.

The visual style would be vector based similar to those isometric maps you sometimes see in airports.

Amsterdam airport map

Brussels airport map

I don't play many video games but I very much enjoyed the pace and aesthetic of the game Rymdkapsel by Martin Jonasson.

Rymdkapsel screenshot

I found it was an easy game to put down and pick up again for short bursts of play.

Probably my favourite video game is Another World by Eric Chahi which features a vector style and is similarly easy to play in small increments.

Another world

]]>
/tags/all Sun, 07 Oct 2018 00:07 GMT
Solderless Prototyping entries/solderless-prototyping http://mccormick.cx/news/entries/solderless-prototyping DSC_2597.JPG

]]>
/tags/all Wed, 03 Oct 2018 13:56 GMT
Too Good to be True entries/too-good-to-be-true http://mccormick.cx/news/entries/too-good-to-be-true DSC_2618.JPG

]]>
/tags/all Thu, 27 Sep 2018 09:07 GMT
Decentralized Identity Linking entries/decentralized-identity-linking http://mccormick.cx/news/entries/decentralized-identity-linking Decentralized identity linking animation

A problem faced by decentralized systems is that of naming things. The problem is best expressed by Zooko's Triangle which conjectured that no single kind of naming system can provide names satisfying all three of the following properties:

  • Human-meaningful: Meaningful and memorable (low-entropy) names are provided to the users.
  • Secure: The amount of damage a malicious entity can inflict on the system should be as low as possible.
  • Decentralized: Names correctly resolve to their respective entities without the use of a central authority or service.

Something as simple as a user handle or nickname becomes a complex issue in a decentralized system. What you ultimately want is something like a decentralized Twitter handle. The handle is a single human-memorable string which points to one and only one user in the system. The first user to register a particular name gets to claim that name. Obviously the case of Twitter handles is not decentralized as it requires the Twitter database as a single point of authority on who owns which name.

As the Wikipedia article points out, and Zooko has acknowledged, the invention of the Blockchain allows for solutions under certain conditions. However the effort required to design, build, and deploy a Blockchain along side your distributed application are quite steep. If you want to use an existing Blockchain implementation then either your users must be invested in it or your app must invest in it and pay for name registrations.

The former situation requires your users to not just install your app but also to acquire some particular Blockchain currency which steepens the barrier to entry for your app. The latter alternative requires your app to fork out for registrations which means the naming system of your decentralized app will fail if you or whichever entity is paying for the names shuts down.

The Keybase Method

In a decentralized system "one user" often means "one or more cryptographic key pairs". The site Keybase offers a good alternative naming system in the situation where "user" means "keypair". The solution is to use existing online identities held at different providers and link them cryptographically to the user's key(s). This means that third parties can verify an identity as follows:

@zooko on Twitter has public key B123h9EAgVdnXWjxUa3N9Amg1nmMeG2u7.

Or to put it more rigorously:

A person who has control of the private key corresponding to public key X also has write access to online service at Y.

A lot of the time when we want a name for something, the latter is what we actually want. We want to know that the existing relationship and trust I have for @zooko on Twitter can be carried over into this new decentralized system I have started using. If I have multiple existing relationships on different services with @zooko on Twitter then I can also verify those and in the decentralized app I can give @zooko the simple name "zooko" (which can often be inferred from usernames on services) and refer to the person with that handle from that point forward.

The way that Keybase does this is to help the user to sign a statement with their signing key saying "I am @name on service X" and then post the text and resulting signature on the service itself and keep a record of where somebody can find the post. If you do this it means you can prove to people that your signing key is associated with some existing internet identity such as your Twitter account. People who want to remain anonymous or pseudonymous with respect to their existing internet identities can simply skip this linking step.

This technique can actually be used to link any internet location that the user has write-access to back to a public key that they have the private key for. You simply sign a statement saying "I have write access to location X." and post it at "location X". Some examples:

  • I have write access to https://mccormick.cx/ -> post signed message as textfile there.
  • I have write access to https://twitter.com/mccrmx -> post signed message as tweet there.
  • I have write access to https://github.com/chr15m -> post signed message as gist there.

Links to the signed post are kept and shared with other users who wish to verify the existing relationship.

A hand drawn lock

The decentralized "Keybase method"

Keybase is a centralized website and system which means that it has convenient integrations and is easy to use, but it relies on their infrastructure and centralized, proprietary software. The good news is it's possible to use the exact same technique that they use in a decentralized system. Doing this gives a user the power to make statements like:

@zooko on Twitter is me (B123h9EAgVdnXWjxUa3N9Amg1nmMeG2u7) on this decentralized service.

And then other people can confidently start using the name "zooko:twitter" in the place of B123h9EAgVdnXWjxUa3N9Amg1nmMeG2u7 in the decentralized system. In fact if the person has signed proof-of-write-access on multiple services and they have the same username on those services we might as well just start calling them "zooko" instead of "zooko:twitter+github". If two zooko's come along then we can just refer to them by their specific service-postfixed names, or some other qualifier, so that we can differentiate when interacting with them - see below for more on solving this "two Johns" problem.

What this means is that "zooko" in the decentralized system becomes a short-hand way of referring to an entity with whom we interact on a constellation of sites. In some ways this is more robust than naming systems on centralized systems (where anybody can "steal" a username by registering it before somebody else) because the alias actually represents the relationship rather than an entry in one specific proprietary database.

So how can we do the same thing in a decentralized system? Quite easily:

For each service the user is on:

  • They sign a statement saying they have write-access to their account at that proprietary service with the signing key that they use on the decentralized service.
  • They then post the signed statement to the proprietary service.
  • When users are connected for the first time each user shares their links to "proof of linked identities" (if any) so that they can verify any existing Internet identities.

No-namers & the contacts list model

What about in the case where somebody does not sign anything to say that they own some existing online aliases? What if your Mum starts using decentralized service X and she does not have a GitHub or Twitter account? What if somebody chooses not to link their existing identities and instead decides to start afresh?

In the real world we don't really get to name ourselves. We can suggest a name to people, but they get to call us whatever they want. This is how nicknames happen and it's a bit of an aberration that in the online world we get to choose one canonical name by which people call us on proprietary services.

What if naming in online systems worked more like the decentralized real world? What if we suggested a name by which somebody could call us, but it was up to them to use it or to choose a different name by which to call us? What if, in this new decentralized service that my Mum has started using, I simply refer to her as "mum"?

If somebody has no existing online identities they can simply suggest a name when two users first connect and trade keypairs. The receiving party can then choose to adopt the suggested handle for that user, or if there is some conflict in their existing set of collected aliases, add a qualifier, or choose an entirely different name that makes sense to them.

This is the "contacts list" model of naming. You can tell me your name but I don't have to use it for your entry in my contacts list. I can adopt the name you've suggested but if I know two "Johns" then I'm likely to add some other qualifier like "Tennis John" and "Football John".

Aside: it would be funny if even DNS worked like this. The first time you loaded Google it would suggest to you "please call me google.com" but you could choose whatever name you wanted to type into the URL bar from that point forward. Norms would form between humans using the internet for what different sites would be called, and sometimes they would be called something different than what the person owning the domain wanted.

I don't think I would use "google.com" for example. I can think of some better names for that site.

Summary

The system proposed here for naming users in decentralized way uses an amalgam of two models: Keybase-style service signing, and the contacts list model.

Detailed view of decentralized identity linking contact card

To summarize the process of managing identities in this system:

  • Each user in the decentralized app is identified by one or more cryptographic key pairs.
  • A user may set a suggested handle they'd like other people to use.
  • Optionally a user is able to add existing identities (Twitter, GitHub).
  • Optionally the app helps the user create cryptographically signed back-links from their existing internet identities to the keypair.
  • The app stores the user's links to their signed posts if any.
  • When user A sees some user B for the first time the client receives the following information about user B:
  • Their public key or fingerprint.
  • Their suggested handle.
  • URLs of their cryptographically signed identity-linking posts.
  • The app then fetches user B's identity-link posts and verifies the signatures found there.
  • Optionally user A is able to modify or supply their own local name (handle) for user B.
  • The app creates a contact entry for user B with this information.
  • When displaying user B the application uses the handle (chosen by user A) stored in the contact card.
  • Under the hood the application uses user B's public key or cryptographic fingerprint/address to refer to that user.
  • In the user interface the contact card is visible appropriately: for example on hover of user B's handle.
  • The displayed card shows user B's handle, identity-links with verification status, and public key or fingerprint.

The raw public key or fingerprint(s) can additionally be used to verify real world identity out-of-band such as at key signing parties, personal meeting, or over a known secure channel.

Read more posts on the subject of cryptography.

]]>
/tags/all Fri, 31 Aug 2018 01:46 GMT
Lost Worlds entries/lost-worlds http://mccormick.cx/news/entries/lost-worlds lost-worlds-1.jpg lost-worlds-3.jpg lost-worlds-2.jpg lost-worlds-4.jpg lost-worlds-5.jpg lost-worlds-6.jpg lost-worlds-7.jpg lost-worlds-8.jpg

Recent-ish sketches. Been learning from The Etherington Brothers, Dr. Seuss, and How to Build Treehouses, Huts, and Forts.

]]>
/tags/all Thu, 23 Aug 2018 05:54 GMT
On Self-hosting and Decentralized Software entries/on-self-hosting-and-decentralized-software http://mccormick.cx/news/entries/on-self-hosting-and-decentralized-software Sketch of a tree

Web applications often follow a client-server model meaning that there is a piece of software which runs in your web browser (the client) and a piece of software which runs on a server somewhere. I'm interested in this model, where it came from, and where it's going, and I discuss this below. I'll also discuss a new model for self-hosting web applications that I've been exploring.

tl;dr

  • To "self-host" a web application means to run the client and server on computers you own.
  • Self-hosting is a basic foundation of decentralization.
  • The "installable app" model on phones & PCs is quite decentralized.
  • Decentralization is robust and anti-fragile.
  • How can we bring self-hosting of web apps to everyone?

Brief history of software applications

In the old days most software people ran was in the form of applications that you would download onto your PC and run. This was quite a decentralised model in that you could find whatever software you liked and run it on your machine without asking permission from anybody.

The modern mobile-device app stores and the web have deviated from this model. In the case of app stores you can only download software that is sanctioned by the company who runs the app store. On Android it is quite easy to change the settings on your device to install software applications from any source but this is not the default, and on Apple devices it's very difficult to do.

The web has a more complicated approach. Running software in your web browser is generally as easy as visiting a URL and people are free to run whatever websites and "web apps" they like on their devices. As mentioned above however, the server-side portion of the web application you are using is often running on somebody else's server computer and not in your control.

Client-server model on the web

Over time more and more functionality has moved from server side code into the web browser. Applications like Gmail pioneered this transition. Recent browser technologies like WebRTC and service workers have given a stronger base to build client-only applications on. The "add to homescreen" paradigm, whilst relatively obscure, presents a vector for running web applications on your computers and devices in a similar way to installed applications.

The buzz-word "serverless" captures the zeitgeist: moving more and more of the software off the server and into the web browser client. The reason software developers are generally in favour of this move is because it is easier to deploy code to web browsers than it is to deploy code to servers; it's easier to get users to run that software (just send them a link); and there is less of a maintenance burden if you don't have to keep a server running.

There's another strong reason why client side code is more favourable than server side code and that is because most server code is running on servers you don't own. For example when you run Gmail the server code and all of your emails are completely controlled by a third party and trusted third parties are security holes.

Even "serverless" in the context of web apps just means that the server component requires less infrastructure and is easier for developers to deploy. The code is still running on a machine owned by some third party who is neither the user or the developer.

Whilst this move towards client-side web applications is good in terms of user control, a problem even with "serverless" web applications that run in your browser is that the software can be modified without your consent. When you load up a web application tomorrow the developer might have made a new version with features you don't like and your browser will load the new version automatically even if you wanted the old version. Even worse, because you load a fresh copy of the software each time you use it, a man-in-the-middle attacker might sneak a malicious bit of code into the version you load tomorrow that is not there today.

There are also many use-cases where only a piece of server-side software will do. Generally these use-cases fall under the umbrella of asynchronous communication, such as storing a file for later retrieval, sending a message to one or more people which might only be received when you are offline, syncing state between devices which might be connected at different times etc.

Examples of things the server code will typically take care of:

  • Connecting client apps together in real-time.
  • Data manipulation functions.
  • Proxying network requests.
  • Persistent data storage.
  • Running periodic jobs.
  • Access control.

So the world is trending towards a more fragile situation of centralized control of the software we all rely on. It would be better for humanity if we were instead moving towards decentralized models of software where an individual can run and control the software they want without fear of a fragile centralized system failing or being used against them by powerful interests and hackers.

Sketch of a tree

Self-hosting

So these latter problems are some of the reasons why self-hosting web applications is still a good move in terms of security and control. When self-hosting, all of the software and all of the data is running on your own computers and you don't have to trust any third party to not be evil, corrupt, make mistakes etc. You can choose which software to install and run and when without obstruction. You get the benefits of cloud connected software - shared state between devices and other users - without having to trust a third party.

The main problem with the self-hosting approach is that it is very technical and therefore simply not an option for most users. Some of the barriers to people self-hosting their web software stacks:

  • Renting or building a server.
  • Installation of server side code.
  • SSL certificate management.
  • Server maintenance.
  • Access control management.
  • Securing the server.

These are the types of things that systems administrators are paid a lot of money to take care of because they are difficult and skillful work. These are the things that big companies are doing for you when you use their online services. The unwritten contract we engage in today is that we give big companies control over our digital life and our valuable personal data in exchange for their building, installing, and maintaining the infrastructure code on their servers.

An additional problem is that even in the "host your own server" model there is a lot of centralization and passing around of valuable and private personal information. For example obtaining a domain name and SSL certificate requires central authorities who almost always require a lot of personal information. Not to mention forking over cash. Additionally, even if you host your code on a VPS - as is the case with almost all server side code on the internet - then some trusted 3rd party has unlimited access to the machine you are renting.

Sketch of a tree

Some existing proposed solutions

So the interesting question is whether there is some way to make self-hosting possible for everybody in the same way that PCs and phones made "run the software I want" easy for everybody.

There was a time when a lot of web applications were deployed as simple PHP scripts with HTML, CSS & Javascript for the front-end. This was probably the simplest format for self-hosted applications as it was easy to find hosting providers who would let you run PHP, and installation was as simple as copying files up to a server. I think this is a big reason why PHP has remained popular for so long despite the fact that it's such an awful language with frequent security issues. It simply let you do what you want. These days though, a lot of modern software on the internet is not written in PHP and developers often prefer other langauge ecosystems.

Another idea for self-hosting was the Freedom Box pioneered by Free Software enthusiasts in the 2000s. The idea is pretty good but does not seem to have acheived widespread adoption. My guess is the use cases are still too obscure for most users. what does "run your own XMPP server" mean? Most people have no idea.

A lot of people today are of the mind that "blockchain" is the singular solution to the issue of decentralizing the software we run. In this model you pay in small increments for the server side code which runs on a distributed system shared amongst many participants. You maintain control of your piece of the distributed service and your data stored in it using cryptography. In this model the server component and app state is shared across many computers all at once and you basically pay for a small slice of it.

This is a fascinating idea but I am not completely convinced that "blockchain" will be the future of decentralized software applications because:

  • So far it is unproven in all except one application, that of decentralized digital gold.
  • There are a number of very successful decentralized systems that function well without any kind of token/monetary incentive (email, irc, http, bittorrent, git etc.) and that original model of decentralization by cooperating parties is still a sound, well proven one. People still use email.
  • The blockchain design encapsulates a trade-off of low efficiency for immense security and trust minimization. This means that blockchains are very good at storing and securing transaction data but they are not very efficient at storing lots of other types of data. Imagine having your own dropbox folders also filled with encrypted copies of those of everybody else in the world. It does not scale.

In addition to the above ideas there exist new ecosystems like ownCloud and Sandstorm which enable people to deploy their own "stacks" hosted on their own servers. These are noble efforts at decentralization and self-hosting into which many people have poured a lot of work. The problem with these "host-it-yourself cloud stacks" is that they often still require trust in some 3rd party hosting service, and quite deep technical knowledge. Sure, to a nerd it is easy to upload a PHP script and configure a MySQL server, purchase VPS hosting, install a Let's Encrypt SSL certificate, but it is not always so easy to a nerd's mother, father or friend.

Sketch of a tree

A simple platform for self-hosting

I've been thinking about all of this in recent years. I've been asking myself these questions:

What if running persistent server side code was available to anybody, even non-technical users? What if installing server side software was as click-tap easy as it is on a phone or PC? What if you could run cloud software and servers on the desktop PC in your office, or tablet, or Raspberry Pi on your home network? What does it look like when anybody in the world can self-host their "cloud" software?

Criteria for such a system would be:

  • Easy to set up and administer.
  • Easy to install and uninstall new services.
  • Interfaces easily with web browser client software.
  • Secure.
  • Completely user-controlled and decentralized.

As I've thought about these ideas I've also been tinkering with WebTorrent. It's a cool piece of technology which is bringing a chunk of the BitTorrent architecture to the web.

Working with this technology made me realise something the other day: it's now possible to host back-end services, or "servers" inside browser tabs.

Client-server model with WebRTC

Instead of a VPS server running in some data center, you have a browser tab running on a spare computer. Instead of clients talking to servers over HTTP they can talk over WebRTC. You build your "backend" service code with the same tech as your client side web app, with HTML and Javascript.

When I realised this it blew my mind. I couldn't stop thinking about it. Maybe the persistent browser tab on the home PC can be the new server for self-hosting users? What if grandma could build out a server as easily as opening a browser tab and leaving it running?

So anyway, I've made this weird thing to enable developers to build "backend" services which run in browser tabs. It's called Bugout and it has been fun to hack together.

Check it out and let me know what you think.

]]>
/tags/all Sun, 12 Aug 2018 12:38 GMT
Live-code 8-bit algorave music in the browser with Clojurescript entries/live-code-8-bit-algorave-music-in-browser-with-cljs http://mccormick.cx/news/entries/live-code-8-bit-algorave-music-in-browser-with-cljs

Speccy is a small utililty I built for live-coding chiptune music in the browser with Clojurescript.

You can copy sounds from sfxr.me and paste them in as synth definitions, using code to modify any parameter over time, or start from scratch by building a synth up from basic parameters.

You can paste the following examples into the online editor to try it out:

; blippy synth
(sfxr {:wave :square :env/decay 0.1 :note #(at % 32 {0 24 3 29 7 60 12 52 19 29 28 52})})

; donk bass
(sfxr "1111128F2i1nMgXwxZ1HMniZX45ZzoZaM9WBtcQMiZDBbD7rvq6mBCATySSmW7xJabfyy9xfh2aeeB1JPr4b7vKfXcZDbWJ7aMPbg45gBKUxMijaTNnvb2pw"
      {:note #(or
        (at % 57
          {5 35
           27 34})
        (at % 32
           {0 24
            6 29
            18 21
            26 12}))})

; hi hat
(sfxr {:wave :noise
       :env/sustain 0.05
       :env/decay 0.05
       :vol #(sq % [0.3 0.1 0.2 0.1])})

; snare
(sfxr "7BMHBGCKUHWi1mbucW62sVAYvTeotkd4qSZKy91kof8rASWsAx1ioV4EjrXb9AHhuKEprWr2D4u4YHJpYEzWrJd8iitvr23br2DCGu7zMqFmPyoSFtUEqiM64"
      {:note 36
       :vol #(at % 16
         {4 0.5
          12 0.5})})

The full source code and documentation is available at GitHub.

Enjoy!

]]>
/tags/all Fri, 03 Aug 2018 02:14 GMT
Hash Function Attacks Illustrated entries/hash-function-attacks-illustrated http://mccormick.cx/news/entries/hash-function-attacks-illustrated Here are some illustrated explanations of the main ways in which cryptographic hash functions can be attacked, and be resistant to those attacks.

Zooko Wilcox's blog post Lessons From The History Of Attacks On Secure Hash Functions gives us a nice overview of these and I've quoted his concise explanations below. Check out his great post for more detail and history on this topic.

A cryptographic hash function is an important building block in the cryptographic systems that keep us safe in our communications on the internet.

A hash function takes some input data and generates a hopefully unique string of bits for each different input. The same input always generates the same result.

Diagram of an ideal hash function

The input to a secure hash function is called the pre-image and the output is called the image.

I use the following key below:

A red square

Red for inputs which can be varied by an attacker.

A green square

Green for inputs which can't be varied under the attack model.

To attack a hash function the variable inputs are generally iterated on in a random or semi-random brute-force manner.

Collision attack

Diagram of a collision attack on a hash function

A hash function collision is two different inputs (pre-images) which result in the same output. A hash function is collision-resistant if an adversary can't find any collision.

Pre-image attack

Diagram of a pre-image attack on a hash function

A hash function is pre-image resistant if, given an output (image), an adversary can't find any input (pre-image) which results in that output.

Second-pre-image attack

Diagram of a pre-image attack on a hash function

A hash function is second-pre-image resistant if, given one pre-image, an adversary can't find any other pre-image which results in the same image.

Hopefully these diagrams help to clarify how these attacks work!

Read more of my posts on the subject of cryptography.

]]>
/tags/all Mon, 30 Jul 2018 02:14 GMT
Fridgetown & Donnelly River July 2018 entries/fridgetown-amp-donnelly-river-july-2018 http://mccormick.cx/news/entries/fridgetown-amp-donnelly-river-july-2018 DSC_1961.JPG DSC_1962.JPG DSC_1963.JPG DSC_1969.JPG DSC_1970.JPG DSC_1982.JPG DSC_1988.JPG DSC_1989.JPG DSC_2005.JPG DSC_2008.JPG DSC_2009.JPG DSC_2011.JPG DSC_2024.JPG DSC_2029.JPG DSC_2032.JPG DSC_2040.JPG

]]>
/tags/all Mon, 16 Jul 2018 12:52 GMT
Talk: GNU/Linux in Tiny Places entries/talk-gnu-linux-in-tiny-places http://mccormick.cx/news/entries/talk-gnu-linux-in-tiny-places gnu-linux-in-tiny-places.jpg

Last night I gave a talk at a Perth Linux User's Group meetup about doing Linuxy stuff on small machines:

]]>
/tags/all Wed, 11 Jul 2018 08:10 GMT
Night Mushrooms entries/night-mushrooms http://mccormick.cx/news/entries/night-mushrooms DSC_1943.JPG

]]>
/tags/all Sat, 07 Jul 2018 00:52 GMT
Frock: Clojure-flavoured PHP entries/frock-clojure-like-php http://mccormick.cx/news/entries/frock-clojure-like-php Frock is a little experimental tool for writing PHP scripts using Clojure-like LISP syntax.

If you want to see what the code looks like, here's an example which fetches and lists top news items from the Hacker News API.

Some Frock code

Frock could be interesting to you if you are LISP or Clojure programmer writing a web application which is mostly front-end code, but which needs some small amount of server side logic for e.g. proxying, authentication, data persistence etc. and you want this application to be easily deployable by semi-technical users on commodity hosting.

Basically if your target audience is graphic designers, you like Clojure, and your backend requirements are slim, then you might be interested.

Why?

Pythagoras says no to Fava beans

PHP is an old server-side web development language which is simultaneously loathed by software developers everywhere, and also wildly popular and widely deployed. To reconcile this paradox let's take a look at some pros and cons of PHP.

Cons:

  • Ugly language semantics & features.
  • Dubious security record.
  • Much awful legacy code lying around.

Pros:

  • User-friendly app deployments (simply copy files to server).
  • Widely available on internet servers.
  • Mature language and ecosystem.
  • Excellent documentation.
  • Much useful tech bundled ("batteries included").

The pros make PHP quite democratic. It's very easy to install PHP code on widely available, cheap, commodity hosting. It's easy to get started writing PHP applications; the PHP binary comes pre-installed on OSX for example. PHP contains a lot of capabilities by default: zipping files, opening sockets, encryption, command execution.

Frock exists to make the language semantics and features less of a con for brace wrangling LISP heads, whilst retaining the wide deployment surface and other democratic features of PHP.

]]>
/tags/all Wed, 27 Jun 2018 08:51 GMT
Browser Blockchain in ClojureScript entries/browser-blockchain-in-clojurescript http://mccormick.cx/news/entries/browser-blockchain-in-clojurescript I built a little blockchain-in-a-browser in ClojureScript to help understand the underlying algorithms.

You can simulate a network of peers by opening multiple browser tabs. Each peer can mine blocks and make transactions independently and the resulting blockchain will resolve conflicts correctly across all tabs.

A blockchain works by laying down a chain of blocks of transaction data.

Bitcoin whitepaper SPV

Each block in the chain contains a cryptographic hash with two important properties:

  • It proves a link to the previous block.
  • It proves that difficult computational work has been done.

The proof-of-work is accomplished by iteratively updating a nonce until a low-probability hash is discovered.

These two properties mean a blockchain is digital amber.

Insect embedded in amber

If somebody wants to modify a transaction deep inside the amber it would be very difficult because they would have to re-create every layer of the blockchain by doing as much work as the original process required.

In my browser blockchain the hashing is implemented like this:

(hash-object [timestamp transactions previous-hash nonce])

As you can see the previous block's hash is included in the current block.

The hashing is performed iteratively in a loop until a hash with at least one byte of leading zeroes is found:

(loop [c 0]
  (let [candidate-block (make-block (now) transactions previous-hash new-index (make-nonce))]
    (if (not= (aget (candidate-block :hash) 0) 0)
      (recur (inc c))
      candidate-block)))
]]>
/tags/all Wed, 13 Jun 2018 01:30 GMT
Across the Sea of Space entries/across-the-sea-of-space http://mccormick.cx/news/entries/across-the-sea-of-space Mountain with space ship

letters.png

helmet.jpg

eyes.png

Romanesque arial

ship-and-planet.jpg

Hillside, tree, and spacecraft

computer-tunnel.jpg

Airballoon over a valley

]]>
/tags/all Wed, 09 May 2018 05:22 GMT
Scitech Show entries/scitech-show http://mccormick.cx/news/entries/scitech-show DSC_1197.JPG

I'm playing a show tonight at the local science education centre, Scitech, for their adult event, After Dark.

I'll play live electronic music using some Gameboy, Commodore 64, and Raspberry Pi gear and algorave Pd patches. I'll also give a little talk about the tech and how it works.

Scitech, After Dark

]]>
/tags/all Sat, 14 Apr 2018 00:59 GMT
Plastimake's Great for Making Homethings entries/plastimake-s-great-for-making-homethings http://mccormick.cx/news/entries/plastimake-s-great-for-making-homethings plastimake-models.jpg

A couple of years ago my friend Joe recommended this stuff called Plastimake to me.

It is a hard plastic which goes soft and malleable at around 60 degrees celcius. You drop some in boiling water until it goes clear and soft and then you can mold it into whatever shape you want. It cools and hardens again quickly in whatever shape you have molded it into. You can re-heat it to soften and re-use it again.

Scout and I have used it several times to hand craft little figures for play. I've also used it around the home and when prototyping things as it's a very quick way to get a hard plastic into exactly the shape you want.

Here's their video which is clear and honest:

]]>
/tags/all Thu, 01 Mar 2018 04:19 GMT
Internet of Things Questions entries/internet-of-things-questions http://mccormick.cx/news/entries/internet-of-things-questions A list of real questions that could be answered by teensy little technology nuggets.

Raspberry Pi with Waveshare Rpi Hat

  • In which physical folder is my child's birth certificate?
  • What items of mine are not here?
  • How much hand soap refill is left in my bathroom cupboard?
  • What is the smallest storage space in which I can fit all of my furniture?
  • Which items that I own do I never use?
  • At what time of day do I interact with different items I own?
  • What is the total weight of my filing cabinet and work desk?
  • I need a new one of these, pull up the page where I purchased it in my browser.
  • This thing does not belong to my grandmother. Who did she borrow it from before she died?
  • List the items in my craft box which have "needle" in the name.
  • How much television are my kids watching and what percentage are educational shows?
  • Are there any NE5532s in my tool box?
  • Graph my family's diet composition. How much of it is fresh food?
  • Place a grocery order under $50 for the items I most commonly use that I will soon run out of.
  • Search all of the physical books in my personal library for the following phrase.
  • Are my running shoes in this house or the holiday house?
  • We are leaving this hotel. Have we packed everything?
  • Where have I put my phone and keys?

Generic USB Sound Device

Most of these question could be answered without an internet connection. "Of Things" sounds kind of weird by itself though.

"Internet connected lightbulb" does not provide a use-case that anybody wants or needs.

The things should be telling us their data. They should not be telling corporations our data.

What you want is dumb little things that do one thing well. Good traditional design plus CPU, I/O, and memory.

Things that talk straight to us [and nobody else] with IR, sound, light, QR code, and raw radio.

Is there a word for "Internet of Things" objects which don't have an internet connection?

Maybe "ov things" lol.

"Neat little ov thing you got there friend."

]]>
/tags/all Fri, 16 Feb 2018 12:22 GMT
Tiny Core Linux on Raspberry Pi entries/tiny-core-linux-on-raspberry-pi http://mccormick.cx/news/entries/tiny-core-linux-on-raspberry-pi Tiny Core Linux SSH screenshot

I'm discovering Tiny Core Linux, a beautifully executed, minimalist, immutable-by-default GNU/Linux distribution that runs nicely on the Raspberry Pi and other x86 and ARM devices.

The documentation is comprehensive but arcane so here are my field notes.

I'm using piCore the Raspberry Pi variant of TinyCore but most of these notes should work for other variants too. These notes assume you are already a GNU/Linux desktop user and know basic Linux command line fu.

Happy penguin jumping

I'm a huge fan of this distribution!

Official disk images.

Here's the official README for the Raspberry Pi version.

Write the disk image to your SD card

sudo dd if=piCore-9.0.3.img of=/dev/mmcblk0

Make sure you get your sd card's device (e.g. mmcblk0) correct so you don't overwrite the wrong disk!

Tip: you can see where dd is up to by sending it a signal:

sudo kill -SIGUSR1 `pgrep -f mmcblk0`

After this put the sd card into your Raspberry Pi and it'll boot Tiny Core Linux with an SSH server running so that you can access it remotely over the network.

Find the Pi on your network

find-pis: use this little script to find the Raspberry Pi on your network so that you can ssh to it.

Default login:

username: tc
password: piCore

Immutable by default

Tiny Core Linux is a perfect fit for Raspberry Pi because it does not write to disk by default. Note that between reboots if you want to persist any changes you've made, you need to do it manually with filetool.sh -b. You'll especially want to do this after first boot to persist the SSH server keys. This includes any changes you make to files in the home directory.

This lack of disk writes is a huge boon because it prevents issues that distributions like Raspbian have with SD card corruption when you power off the Raspberry Pi. Immutability is also just a good thing generally for building robust software systems.

Tiny Core Linux package repository

The packages are .tcz files which like most package formats are a zipped up collection of files with some metadata. You can browse the packages available to the Raspberry Pi distribution.

Various useful commands

Persist current state to disk:

filetool.sh -b

Where to specify additional default file locations for persistence:

/opt/.filetool.lst

Download and install packages (nodejs binary package in this example):

tce-load -wi node.tcz

Show which packages are currently installed:

tce-status -i

Install a package for doing C/C++ compilation & development:

tce-load -wi compiletc

Find current OS version info:

version

Search for and install packages with console UI:

tce

Where to put your own startup and shutdown scripts:

/opt/bootlocal.sh
/opt/shutdown.sh

Getting WiFi working

You'll want the packages wifi and firmware-rpi3-wireless and then reboot and set up a connection:

sudo wifi.sh

Don't forget to persist your changes.

Getting sound working

You'll want the alsa and alsa-utils packages.

I managed to compile Pure Data and output a basic test tone. I went into the src folder of Pd and issued make -f makefile.gnu to build it from the source after checking it out from git.

GPIO access

I managed to interface with the Raspberry Pi GPIO by installing node and then using the onoff package installed via npm. Lots of dev packages were required for a successful build (compiletc probably covers most of them). Each time npm threw an error I looked at what the error message was to determine which package to install next until it built successfully.

I managed to get an LED to blink on pin 16 with this code:

var Gpio = require('onoff').Gpio;
led = new Gpio(16, 'out');
led.writeSync(1);
c = 0
setInterval(function() { led.writeSync(Number(c = !c)); }, 1000);

I had to run node as root to get access to the GPIO.

Philosophical waxing

GNU/Linux has now been subsumed into the technological substrates of the world. It is found in most phones, servers and appliances that people interact with every day. There are probably 10 copies of Linux running in the median developed-world household. It has become infrastructure, like roads and wires and water pipes.

I don't see that many young people at GNU/Linux meetups these days. I don't think we GNU/Linux nerds are required by the world in the same way that we were before when it was sparkly and new.

It's exciting for me to find Tiny Core Linux which has re-ignited the spark of enthusiasm for this technology.

]]>
/tags/all Sat, 03 Feb 2018 05:34 GMT
Tech Nugget entries/tech-nugget http://mccormick.cx/news/entries/tech-nugget DSC_0413.JPG

Secret project.

]]>
/tags/all Mon, 29 Jan 2018 04:35 GMT
The 2018 Situation entries/the-2018-situation http://mccormick.cx/news/entries/the-2018-situation DSC_0149.JPG

]]>
/tags/all Mon, 01 Jan 2018 01:46 GMT
Other Worlds entries/other-worlds http://mccormick.cx/news/entries/other-worlds planet-0.png planet-1.png planet-2.png planet-3.png planet-4.png planet-5.png

I just finished another sketchbook.

Recently a friend linked me to The Etherington Brothers and I've been doing their tutorials.

Lately I've been concentrating on plants.

]]>
/tags/all Fri, 24 Nov 2017 12:49 GMT
Technological Artifact entries/technological-artifact http://mccormick.cx/news/entries/technological-artifact Hand drawn technological artifact in the style of Scott Robertson

In the style of this guy in the style of Scott Robertson space ship sketches.

]]>
/tags/all Tue, 17 Oct 2017 03:55 GMT
Lovelace Day 2017 entries/lovelace-day-2017 http://mccormick.cx/news/entries/lovelace-day-2017 A non-exhaustive list of technologies that I used this year which happen to be built by women:

I feel grateful to these people for enriching technology with their contributions.

]]>
/tags/all Wed, 11 Oct 2017 06:58 GMT
The Mountains entries/the-mountains http://mccormick.cx/news/entries/the-mountains IMG_20170912_170725_387.JPG

Some mountains I copied from some website.

]]>
/tags/all Tue, 12 Sep 2017 09:09 GMT
Cloud Notepad entries/cloud-notepad http://mccormick.cx/news/entries/cloud-notepad Cloud Notepad on the Desktop

I love this piece of software and I use it every day. It is a simple note taking application which syncs across all of your devices. It is a self-hosted single-page web app that runs on a PHP server and does not require a database.

Cloud Notepad on the Desktop

I run a copy on my phone and a copy on my laptop.

The app was built by Kaspars Dambis and I forked it to modify the design and add some usability tweaks like ctrl-S to force sync. You can find the source code of my fork on GitHub if you want to install it yourself.

]]>
/tags/all Mon, 04 Sep 2017 03:00 GMT
Clerk: Event Logging Web App entries/clerk-event-logging-web-app http://mccormick.cx/news/entries/clerk-event-logging-web-app Screenshot

There are times in life when you need to keep track of periodic events as they happen. For example when you have a new baby it is sometimes useful to keep track of when they feed, nappy changes, etc. Another example might be tracking how often you eat chocolate or drink beer.

Clerk is a simple self-hosted web application that I built which you can install to the home screen of your device (by doing "add to home screen" in your browser) or load up on your tablet or laptop. You can then keep track of simple events with two taps on your device - once to open the app and once to record the event.

Screenshot 2

For every event logged the event type, timestamp, and comment are stored in CSV files. Events are stored in individual CSV files - one file per event type. You can also download all CSVs stiched together with an extra column for the event name.

Features

  • Web based.
  • Easy to deploy.
  • Self-hosted & FLOSS.
  • Simple text based CSV format.
  • Allows multiple people to log events.
  • Mobile friendly - "Add to Home Screen" web-app.

Install

To require authentication, first create a password file:

htpasswd -c /path/to/.htpasswd username

Then copy ./example.htaccess to .htaccess and edit it.

Enjoy!

]]>
/tags/all Thu, 06 Jul 2017 02:38 GMT
Lost Town Of Belgium entries/lost-town-of-belgium http://mccormick.cx/news/entries/lost-town-of-belgium

Scout and I made this stop-motion short film.

How we made it:

  • We used an old Android phone with one of those $10 phone tripods to take each frame.
  • We flipped through the stills in Ristretto by hand, recording the output with RecordMyDesktop.
  • We used avconv to convert between formats.
  • We used Audacity to record the audio.
  • We used OpenShot to edit the video.
]]>
/tags/all Thu, 08 Jun 2017 09:06 GMT
A Smart Alternative to `watch make` entries/a-smart-alternative-to-watch-make http://mccormick.cx/news/entries/a-smart-alternative-to-watch-make watch-make is a script that rebuilds your project only when make detects it needs a rebuild, for example when source files change.

Features:

  • Works with any existing Makefile based project.
  • No dependencies apart from make.
  • Passes any arguments to make (such as -C mydir).
  • Silent if there is nothing to build and does not swallow output when there is.

I wrote it in response to this Stack Overflow question.

The source code is hosted on GitHub.

Install it

curl -s https://raw.githubusercontent.com/chr15m/watch-make/master/watch-make > ~/bin/watch-make
chmod 755 ~/bin/watch-make

Full source code

#!/bin/sh

while true;
do
  if ! make -q "$@";
  then
    echo "#-> Starting build: `date`"
    make "$@";
    echo "#-> Build complete."
  fi
  sleep 0.5;
done
]]>
/tags/all Wed, 31 May 2017 03:13 GMT
The 2017 Situation entries/the-2017-situation http://mccormick.cx/news/entries/the-2017-situation IMG_20170506_150538.jpg

No point crying!

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

]]>
/tags/all Mon, 08 May 2017 01:10 GMT
Lonely Robot entries/lonely-robot http://mccormick.cx/news/entries/lonely-robot Simple line sketch of a robot walking in a natural scene.

I went to the woods because I wished to live deliberately, to front only the essential facts of life, and see if I could not learn what it had to teach, and not, when I came to die, discover that I had not lived.

-- Thoreau, Walden

]]>
/tags/all Sun, 05 Mar 2017 04:24 GMT
Xmas Geodesic entries/xmas-geodesic http://mccormick.cx/news/entries/xmas-geodesic DSC_2621.JPG DSC_2608.JPG DSC_2597.JPG DSC_2577.JPG DSC_2654.JPG

Over the Xmas holiday my friend Fenris and I built this geodesic dome (actually a truncated icosahedron) out of corrugated plastic sheets and gaffer tape.

It took about 4 hours over two sessions of cutting and then taping.

]]>
/tags/all Fri, 17 Feb 2017 07:09 GMT
Hope entries/hope http://mccormick.cx/news/entries/hope Gödel's incompleteness theorems provide us with mathematical proof of the unknowable. The vast empty skies of those things we don't and can't know -> that is where hope resides. Nobody knows the future.

]]>
/tags/all Thu, 02 Feb 2017 11:44 GMT
Sounds Incredible entries/sounds-incredible http://mccormick.cx/news/entries/sounds-incredible sounds incredible by chr15m + fenris

After 14 years of playing music together on Gameboy Advance and Commodore 64 my buddy Fenris and I finally recorded an album while he was visiting during Xmas.

You can listen to the album for free or purchase a download for however much you like.

All of the software we use to play music is Free and Open Source:

I hope you enjoy the music.

]]>
/tags/all Sun, 15 Jan 2017 10:52 GMT
New York PdCon 2016 entries/new-york-pdcon-2016 http://mccormick.cx/news/entries/new-york-pdcon-2016 DSC_1662.JPG DSC_1673.JPG DSC_1731.JPG DSC_1701.JPG DSC_1716.JPG DSC_1739.JPG DSC_1864.JPG DSC_1742.JPG DSC_1680.JPG DSC_1690.JPG DSC_1698.JPG DSC_1859.JPG DSC_1793.JPG DSC_1801.JPG DSC_1818.JPG DSC_1788.JPG DSC_1810.JPG DSC_1724.JPG DSC_1862.JPG DSC_1713.JPG DSC_1747.JPG DSC_1743.JPG DSC_1745.JPG DSC_1877.JPG

In November I was in New York for PdCon 2016 and to visit my brother, thanks in large part to my friend Joe Deken and his not-for-profit, New Blankets.

The conference was fantastic. Many fascinating performances, a chance to catch up in person with people from the Pure Data community, and the opportunity to present and perform some of my own work. A highlight for me was hearing Miller Puckette, creator of Pure Data, talk about his approach and philosophy.

On top of that I got to catch up with some awesome people outside of the conference, especially my brother. We went hiking together one day - a rare opportunity to hang out together in nature.

]]>
/tags/all Mon, 09 Jan 2017 09:49 GMT
Gameboy Nature Beats entries/gameboy-nature-beats http://mccormick.cx/news/entries/gameboy-nature-beats gameboynaturebeats-poster-1.png gameboynaturebeats-poster-4.png

Tonight my friend Fenris and I will play some music in a park here in Perth, Western Australia, on Gameboy and Commodore 64 powered by batteries and broadcast over FM radio to local speakers hanging from the trees. We'll start playing at 9:30pm and after us our friends Atomsmasha and Kataplexia will also play some music on Gameboys.

Might see you there!

]]>
/tags/all Fri, 06 Jan 2017 07:07 GMT
Geodesic Scale Test entries/geodesic-scale-test http://mccormick.cx/news/entries/geodesic-scale-test DSC_1913.JPG DSC_1914.JPG DSC_1918.JPG DSC_1908.JPG

]]>
/tags/all Sat, 26 Nov 2016 06:32 GMT
Open Skies entries/open-skies http://mccormick.cx/news/entries/open-skies Hand drawn image of a country scene with a rocket flying above the clouds and the moon with a habitation ring around it.

]]>
/tags/all Fri, 25 Nov 2016 01:51 GMT
Algorave Set in Williamsburg entries/algorave-set-in-williamsburg http://mccormick.cx/news/entries/algorave-set-in-williamsburg Lately I've been working on new algorave music in the style of drill&bass and I'm playing a set here in New York for the PdCon16 party. It's at a space called Vital Joint in Williamsburg, tonight (Saturday) at midnight.

spinning globe 
visualisation

]]>
/tags/all Sat, 19 Nov 2016 06:12 GMT
Startup Idea: Web App Installer entries/startup-idea-webapp-store http://mccormick.cx/news/entries/startup-idea-webapp-store Although it is an exadgeration to say that app stores are dead it is true that web apps (applications that run in a web browser) and the mobile-device browser platforms have become powerful to the point that it is often not neccessary to build a native app.

There is a gap in the web app paradigm as users don't always realise they can install a web app they use by going to "Add to homescreen".

An interesting way to fill that gap would be to build an "app store" for web apps. That is, a native app that curates and carries out the "add to homescreen" process for the user for a wide variety of quality web applications. So basically like Firefox OS but without the OS - just the installer, and for the native browser of each platform.

Ideas are cheap and execution is everything - you don't need my permission to take this idea and run with it if you're convinced.

]]>
/tags/all Mon, 14 Nov 2016 15:22 GMT
Tentacle Being entries/tentacle-being http://mccormick.cx/news/entries/tentacle-being Drawing of a tentacle being

Drawing practice in the style of Ben Hatke.

Scout and I finished Zita the Spacegirl recently which was a wonderful adventure.

]]>
/tags/all Fri, 11 Nov 2016 08:12 GMT
Delhi 2016 entries/delhi-2016 http://mccormick.cx/news/entries/delhi-2016 DSC_0232.JPG DSC_0242.JPG DSC_0251.JPG DSC_0304.JPG DSC_0326.JPG DSC_0350.JPG DSC_0358.JPG DSC_0217.JPG DSC_0411.JPG DSC_0212.JPG DSC_0432.JPG DSC_0453.JPG IMG_20160930_105853.JPG

Couple of weeks ago I was fortunate enough to visit Delhi and spend a week with my colleagues Umang, Gaurav and Tom. We had an excellent and productive week and in between development discussion Umang was kind enough to drive us to many fascinating and beautiful places - not least of all to enjoy a wonderful meal at his sister's house.

We worked out of Awfis co-working, which I recommend.

I feel lucky to have seen Delhi this way.

]]>
/tags/all Thu, 20 Oct 2016 06:57 GMT
Sci Fi UIs in ClojureScript entries/sci-fi-uis-in-clojurescript http://mccormick.cx/news/entries/sci-fi-uis-in-clojurescript I built these sci fi user interfaces using ClojureScript, React, and SVG:

Tap or click to interact with them.

 

 

 

 

 

More here.

Source code here.

]]>
/tags/all Sun, 11 Sep 2016 07:13 GMT
Namibia 2027 entries/namibia-2027 http://mccormick.cx/news/entries/namibia-2027 TS.2850-Anthony-Scime-style-copy.png

I am trying to teach myself sci-fi style vector painting and this a piece that I think meets the post-on-blog standard.

I tried to copy the basic palette/mood/style of this image.

]]>
/tags/all Sun, 21 Aug 2016 02:05 GMT
You Are Here entries/you-are-here http://mccormick.cx/news/entries/you-are-here you are here

]]>
/tags/all Sun, 24 Jul 2016 08:13 GMT
OMG Not Another TODO List Application entries/omg-not-another-todo-list-application http://mccormick.cx/news/entries/omg-not-another-todo-list-application My wife and I needed a collaborative shopping list that we could update from our phones. There are proprietary solutions to this but after some research I was surprised to discover that there is no Free Software application that meets the following criteria:

  • Web based.
  • Easy to deploy.
  • Self-hosted & FLOSS.
  • Allows multiple people to update a list.
  • Simple text based format for easy editing.
  • Mobile friendly - "Add to Home Screen" webapp.
  • Satisfies the single use-case of collaborative TODO editing.

Of course I built one with ClojureScript.

Screenshot of 
OMGNATA

We've been using this "in production" for 3 months and so far it fills our need without issue.

  • Authentication can be accomplished with a .htaccess file or similar.
  • The text-file format is designed so that you can edit lists with a text-editor directly if you want to.
  • If you want to support multiple users you can set up two instances in two different folders and symlink the textfile of the list you want to share between them. Each folder can have its own authentication.
  • You can also do other textfile things like make a symlink into a Syncthing folder which enables you to modify your TODO lists on your laptop or server as well as through the web app.

The realtime updating is accomplished via long-polling. Primarily I used this instead of websockets because when it comes to browsers, older tech is more robust to different operating environments than newer tech.

I resorted to using PHP for a very lightweight server backend because it has the property that basically anybody with web hosting is able to upload a PHP script and I think it's good to give software as egalitarian a deployment surface as possible. Luckily it is only 150 lines of not-too-painful PHP.

Click here to get the source and download/install it.

]]>
/tags/all Sat, 28 May 2016 01:29 GMT
Treehouse Building entries/treehouse-building http://mccormick.cx/news/entries/treehouse-building DSC_0381.png DSC_0386.png DSC_0387.png smssecure-2016-05-07-141043.png DSC_0407.png DSC_0392.png

Couple of weekends ago Jessee and Chris came over and we made this free-standing tree-house-like platform thing for Scout and Orson out of some wooden palettes I'd collected during the preceding week.

When I say "we made" of course I mean they made it and wisely only let me touch one or two power tools during the course of construction.

]]>
/tags/all Sun, 22 May 2016 11:01 GMT
Some Isometric Sprites entries/some-isometric-sprites http://mccormick.cx/news/entries/some-isometric-sprites Ship

Rocks

Mandarc

Tree #1

Tree #2

Mandarc side view

These are some video game style isometric and side view renders of previous 3d work I did:

]]>
/tags/all Fri, 08 Apr 2016 05:58 GMT
Corn & Zucchini entries/corn-amp-zucchini- http://mccormick.cx/news/entries/corn-amp-zucchini- DSC_0129.JPG DSC_0054.JPG

Wrong time of year but we'll see what happens.

]]>
/tags/all Sun, 27 Mar 2016 01:52 GMT