Category Archives: Uncategorized

Today i almost lit my house on fire with electrical experiments!

There I was, full of Covid brain-fog, attempting to put together the simplest of electrical experiments, building an electromagnetic coil for my kids, when I got distracted and nearly burnt the house down!

Yes, yes, it’s missing a ferrous core to make the coil produce a truly B-eefy field, and yes dumping 5A through the coil for 15s should have made the Jerry-rigged water compass do more than the nothing that you can see in this video.

Continue reading Today i almost lit my house on fire with electrical experiments!

Wanted: blockchain games that actually run on the blockchain

Extremely late to this party, just like everything else for my generation. I’m looking for “blockchain games” that actually encode their logic into the blockchain. I’ve drawn a blank on pretty much everything that I’ve looked at so far (in that there’s typically some UI that runs animations and performs game logic and then writes the results of individual rounds back to the underlying store).

For all the hype, I’ve yet to see an NFT/blockchain game where all of the logic is encoded in the smart contracts. Likely because the space is full of scammers who don’t actually understand technology and have never encountered Andrew Parker’s user-driven minting mechanism.

Anyways, if you know of a game that’s fully encoded on the blockchain, let me know in the comments.

Filter the generative horde with hard cryptography

Hannah Wiggins wrote The Piece (née “Shall Be Delivered”) on how asymmetric cryptography distinguishes humans from the mob, strong recommend even a decade after publication[1]Goodness gracious, has it really been a decade? The world has changed such, we’ve all lost so much and learned so much. Can it be that Trilema is truly off the public net for good? From … Continue reading. All the more disappointing then, that Maggie Appleton doesn’t even mention it in her piece on how surprisingly adequate GPT and friends have grown at imitating the output of your typical human. tl;dr Maggie, if you’re reading text that wasn’t published by an individual who publishes a GPG key you got from some channel you trust, you are axiomatically unable to distinguish them from internet noise. Go, read! Wiggins’ “Shall Be Delivered” still chills and inspires me.

Continue reading Filter the generative horde with hard cryptography

References

References
1Goodness gracious, has it really been a decade? The world has changed such, we’ve all lost so much and learned so much. Can it be that Trilema is truly off the public net for good? From intellectual poverty came, and to intellectual poverty apparently we must all return

Bash Bitcoin Miner

A little tongue-in-cheek, it’s missing several practical elements but nevertheless here’s some filthy bash to mint sha256 coinbases in the least efficient way possible:

#!/usr/bin/env bash -eu

DESIRED_DIFFICULTY=1

GENERATED_NONCE_COUNT=0

while true
do
nonce=$(xxd -l16 -p /dev/urandom)
hash=$(printf $(printf "$nonce" | shasum -a 256))
diff_string=$(printf '%*s' "$DESIRED_DIFFICULTY" | tr ' ' 0)
if [[ "$hash" = "$diff_string"* ]]
then
printf '%s %s\n' "$nonce" "$hash"
[1]GENERATED_NONCE_COUNT=$GENERATED_NONCE_COUNT+1 fi
done

You’re welcome!

References

References
1GENERATED_NONCE_COUNT=$GENERATED_NONCE_COUNT+1

AGI needs goals, and satisfying curiosity has to be the first

I spent some time with ChatGPT last night, out of curiosity about the state of the art and how close we might be to runaway artificial general intelligence (AGI). I’m entirely underwhelmed at its inability to model conversational state, its incuriosity towards interlocutors, the obvious polite/inoffensive response templating, and just how far the AI industry appears to be from achieving anything remotely capable of passing for a human.

The rationalists are convinced we face a high risk of AGI going into runaway mode, where it relentlessly optimizes itself, establishing enough control over enough humans that in the large “we” (for some value of we) won’t actually be able to turn it off. Matthew Ward works an example through the lens of Facebook, saying something along the lines of “there’s a ghost AI embedded in Facebook’s myriad of recommendation systems that has financially motivated a bunch of people to prevent turndown: Continue reading AGI needs goals, and satisfying curiosity has to be the first

Andrew Parker’s Sybil-Resistant User-Operated NFT Minting Mechanism

Never mind that NFTs have rolled off the hype cycle’s peak of inflated expectations and now grind through an unknowably-long trough of disillusionment! Let’s revisit Andrew Parker’s mechanism for end-user NFT minting, and make some technical cleanups and tweaks such that NFT contracts extract maximum fees from minters.

NB: there’s no code in here, so if you’re expecting to find something to copy/paste into the contract that some ding dong on Fiverr is paying you to cobble together, you can just scram, kid. As I say at the office from time to time, my job is (tragically) not to write code any longer, but to help you figure out what code to write.

Definitions

  • Minting
    Creating a new token in an NFT contract.
  • Premine
    Old-school scam wherein a select number of individuals operate a blockchain in secret and private before exposing its critical values to the rest of the internet for public mining, thereby safely reserving an unholy pile of the shitcoin for the initial operators themselves without competition against the rest of the universe of hashpower. Satoshi is the original premine case, which is how you know that Bitcoin is a scam.
  • Gas
    The cost of including a transaction in an Ethereum block. Dynamic, like Bitcoin transaction fees, based on current demand for block space.

Current Minting Challenges

NFT drops, premints and user-operated minting and so on generally suffer on a few common axes: mishandled manual allocations, sophisticated contract operators out-performing naive humans, and egregious gas fees.

Manual allocations are when NFT contract authors (or their marketing agencies) sell or give away individual tokens or token-minting rights before the contract hits the blockchain[1]In some cases, the NFT contract can be updated by its authors or maintainers, but I’ll neglect this case for now, excommunicating such misbehavior as cryptographic heresy. Manual allocations are sometimes implemented with some kind of pre-computed list (dumb) embedded in the contract (wasteful) blessing specified addresses with permissions to call various NFT minting methods, or in the dumbest possible cases, the contract authors themselves are the only ones allowed to “mint” NFTs and then variously hand the tokens out or auction them. All of the above implementations are stupid, poorly factored, and generally suck (and moreover point towards the comic ignorance of NFT contract authors of pretty much all prior art in the space), but can be understood in the context of contract authors attempting to milk their mints/drops for as much end-user cash as possible.

A smaller number of Ethereum contracts by JavaScript developers with delusions of grandeur (those who bother to look will find a Lisp in the historical detritus. No points for guessing why that never made it into the DevRel propaganda…) attempt to solve this problem by hardcoding rules like “any given wallet can only mint N tokens per Q blocks” into the contract. I find this even more tragically stupid than the premine strategies (which are at least not stupid and intellectually honest insofar as the implementation is saying: “these are my enn eff tees and you can have them for a price that I set”), because it conflates individuals with addresses, something that Bitcoin lore disposed of purt goddamn near a decade back. The poor schmucks who attempt this strategy are so unfortunate that nobody around them is smart enough to whisper “sybil attack” in their ears, and so they go about blissfully unaware of the entire corpus of literature until they release their contract and it gets pwned on day zero by someone with a college-prep high-schooler’s mathematical savvy. This is like inventing scalable session handling by storing session data in individual web heads, pushing that sticky session notion into your load balancer, and then wondering why new nodes in your autoscaling pool don’t serve as much traffic as old nodes. In 2027.

Egregious gas fees are the final failure mode I find worth talking about, because these are typically also a symptom of unqualified engineers mucking about with mathematical systems they don’t really understand. During exceptionally hype-frothy NFT minting event the sheer number of people attempting to call methods on the popular contracts to mint tokens explodes the demand side for Ethereum block storage space. Naturally, those who bid the highest get their transactions confirmed, and everyone else misses out. Not just everyone else competing for block space to support the particularly popular transaction, but everyone on the entire Ethereum network now competes against folks tryna get their mitts on the latest cryptowhatever, which is not just a spectacular waste of the NFT squad’s money (hey, I love me a deflationary cryptosystem, don’t get me wrong), but of everyone’s money who might be attempting to use Ethereum for…something useful. Assuming such applications exist. But I digress.

Design Goals

  • Low gas fees
  • Arbitrary users can mint NFTs
  • No off-chain trust mechanisms
  • Minting mechanisms can’t be spammed
  • NFT authors capture some fraction of the demand otherwise spent on gas fees
  • Thwart front-running

Design

Proof-of-work.

That’s probably not enough to go on (tee hee hee), so I’ll sketch out the fundamental mechanism for those unfamiliar with how Bitcoin solves this exact same problem.

The minting method must accept payment, and has a signature of:

mint :: str -> ()

Where that str argument is the nonce used to prove that work has been done.

Hashing implementation

  1. Concatenate:
    1. mint function caller’s address
    2. supplied nonce
  2. Hash output of 1.

Difficulty (and the ultimate input)

Bitcoin adjusts difficulty every so often by comparing how quickly blocks were generated with a desired production rate and then ratcheting up or down the required number of leading zeros from the output of hashing some well-known data (neé nonce).

In an NFT implementing this interface, you’ll track difficulty in the exact same way: calculating how many leading zeros your hash function needs to output in order for the contract to consider the nonce valid for NFT minting.

Since mining is a proxy (syntactic sugar) for the minter’s ability to buy the NFTs they want to mint, shouldn’t we just give folks the ability to buy NFTs over the counter, without any of this complicated hashing stuff? If the buy-side is prone to literally throwing money away on gas fees during times of competition for block space, how can we capture that cash that’s otherwise being lit on fire during minting races?

To effectively capture the gas market, simply add the order of magnitude of wei sent along with the minting transaction to the number of leading zeros from the hash output, and if the total number of zeros is greater than the current difficulty number, mint a new NFT.

Departures from Parker

  1. Dynamically calibrate difficulty after every minting event to ensure desired output characteristics
  2. Incorporate payments to augment pure hash difficulty
  3. Don’t require the previous token’s hash in minting
    This is probably the most controversial proposal. I contend that if you check to see if difficulty needs adjustment after every single minting event, you can ensure that even if an infinite number of mintings are submitted in a single block, the adjustment recalculation will ensure that as soon as your difficulty threshold exceeds that which is supplied in the infinite series, all other minting transactions will be tossed. For this we have the serial nature of block construction in Ethereum to thank 🙂

Design Goal Evaluation

  • Low gas fees
    Check, gas auction dynamics are captured by the payable minting function, and concatenating the number of zeros of wei along with the leading zeros of the hash output to get final hash strength.
  • Arbitrary users can mint NFTs
    Check.
  • No off-chain trust mechanisms
    Check.
  • Minting mechanisms can’t be spammed
    Check.
  • NFT authors capture some fraction of the demand otherwise spent on gas fees
    Check.
  • Thwart front-running

References

References
1In some cases, the NFT contract can be updated by its authors or maintainers, but I’ll neglect this case for now, excommunicating such misbehavior as cryptographic heresy

The hateful jealousy of those who cannot

On the way to dropping the children off at school this morning, we espied a truly noxious plume of smoke right around the corner from Cedar’s school. To satisfy my morbid curiosity, after I shipped Cedar to his first day of first grade (!), Tallulah and I took a slight detour to check out what looked to be a truly magnificent pyre of modern hydrocarbons.

Lo and behold, when we pulled onto the offramp, an entire ad-hoc unhoused enhousement had tragically gone up in flames:

I disembarked, wandered up to get a quick look, and asked how long they expected to hold us up on the offramp, to resounding shrugs from WSDOT and firefighters alike.

Being joyously a new owner of a truck fully equipped for most reasonable offroading situations, and still wanting to get my daughter to school not terrifically late, I effected a two-point turn, and went bumping into the median between the offramp and the highway. Only to be accosted by some standard-size American in a broken down Ford sedan something or other: “YOU STUPID FUCK!”

This is just what you have to expect from the chronically oppressed American. They know they can’t get or do anything, and their response is to get absolutely infuriated when they see other folks they can’t understand aren’t cattle like themselves to raise the spectre of rule-following and fairness.

Following the rules is for schmucks. Those who can, do. Those who cannot, endure. I have a truck capable of getting me out of minor binds like “pulled off on an exit that was immediately closed right in front of me”, and frankly the Ford in question could absolutely have driven up the shoulder back to the highway junction, even if it wasn’t capable of navigating the ditch. But! Its pilot is tragically cursed by the American prole’s mental capture by the local rule system, and can’t comprehend how anyone else would be willing or able to break those rules.

I’m rubber, you’re glue etc.

Fixing pocket doors with captured-nut hangars

The captured-nut pocket door hangers my 2005-vintage pressed-shitboard house came with are the absolute fucking worst.

This bolt (that threads into carriage running on the pocket door rails behind the moulding)…

…will back out of the threads on the carriage over time.

When it does, one side or the other of the pocket door will drop down to the floor, and leave you with the threaded part of the nut poking up out of the door. Good luck getting a wrench up behind the molding to screw it back into the carriage.

Since this has happened to me on 3 separate pocket doors in my house over the last year, I have tried umpteen different approaches to getting these bolts back into their carriages and the doors rolling smoothly, and I have finally developed a formal process that works every time. It’s a giant pain in the ass, but it is at least less obnoxious than staring at a cockeyed door poking out of the wall that you CAN’T EVEN USE TO CLOSE OFF THE SOCIAL PART OF THE HOUSE FROM THE CHILDREN AFTER BEDTIME, or flailing un-directedly at the problem with no plan.

Trust me, I’ve lived both of those stories. This repair method works, and doesn’t require that you take off moulding or make any other destructive repairs to the foamed-wood-product buttbox Americans call houses.

The fix.

  1. Detach the pocket door from the other hangar. In my experience, this is always the “shallow end” of the door, that makes contact with the wall when the pocket door is closed.

    Rotate the retaining clip into its non-retaining position, lift the door up, and push the bolt out of the receiver on the top of the door:
  2. Remove the bolt that has unscrewed itself from the carriage from the other receiver at the other end of the door. In my experience, this is always the “deep end” of the door, that recesses way way way back into the wall.
  3. Thread the bolt from 2 back into its carriage.
  4. Tie a string around the bolt from 2 in such a way that you can yank on it for a bit before it comes untied, but use a knot that will come undone after a reasonable amount of wiggling so that you don’t end up with a string stuffed up in your pocket or heaven forfend, dangling over your door causing a permanent eyesore.
  5. Using a prybar, shim the door so that the bolt-receiver is juuuust below the z-height where the bolt would slide into the receiver:

    Protect your shitty plastic laminates from the metal! The children do enough damage to the house already, you don’t need to compound it while effecting a fix.
  6. Position a chair such that you can gently lean on the prybar with one foot.
  7. Lever the door up just enough for the nut to slide into the receiver, and pull on the string from 4 until you get that satisfying *click* indicating the bolt-head is firmly seated in the receiver. You will have to wiggle the door up and down while pulling on the string in order to get it past a detent.

    If the string comes off the bolt, go back to step 4.
  8. Rotate the clip back into position.

    To hang the door on the second hangar, you can use the exact same technique, or take an easier approach:
  9. Lever the door up until the bolt-receiver is in the appropriate position.
  10. Using a long, thin rod (I recommend small-diameter carbon fiber tubes, an essential tool in my toolbox of weird), push the bolt into the receiver until it clicks

    The reason that you can’t do this for the “deep end” of the pocket door is because you simply cannot get a rod into the gap that the door recesses into in such a way that you can push on the bolt. Instead, you need to pull on it, which has been the source of pretty much all of my howling about how to fix these doors.
  11. Slide the door into the recessed position, and using your long thin rod (or whatever, a knife will work at this point), rotate the retaining clip into position.

Voilá, you have a properly-rehung door again. You also know how to reset it after the children slam it against its stops fifty times and that accursed bolt backs out again.