Early history of me, part 5

Filed under: Ego, Historia, Paidagogia, Vita — Jacob Welsh @ 17:13

Continued from part 4

Lest I paint too bleak a picture of a flat landscape in the public school system, special-needs options started to be offered around the fourth grade for those afflicted by working brains, namely honors classes and once-weekly programs with pompous acronyms whose meaning nobody remembered like FUTURA and SPECTRUM. These provided welcome relief, but remaining surrounded by a crowd that was none too interested in that whole learning thing, and probably resentful of being subjected to it, was still draining. And even in the honors classes, I found the ever-expanding homework burden full of silly, pointless or repetitive drudgery. Around the eighth grade I chose to drop my "straight-A" record to make more time for my interests outside school, which by that time had gravitated toward computer programming.

I sometimes complained to my parents about the situation. Why not the local private school where my friends from the organization went (by financial support from extended family)? Why not home-school? Such entreaties would be dismissed in the "yes, but" style.(i) While they did help pressure teachers and administrators into better supporting me, questioning the system itself was off the table. I see it as a kind of passivity from assumption of helplessness, lacking adequate consideration of what might have been possible or weighing of longer-term costs among proximate ones. When high school came around, there was finally a more serious option of a full-time magnet school;(ii) the proximate cost was being in the next county over with a lengthy bus commute. They rejected this on the first pass, hoping the local situation would improve. To their credit, they came around once it clearly wasn't improving and I got in as a sophomore transfer; unfortunately this meant having missed out on a number of freshman bonding experiences.

To be continued

  1. That "well, yes, but..." was a phrase often cited by LaRouche regarding the avoidances of potential recruits. [^]
  2. Thomas Jefferson High School for Science and Technology. [^]


Early history of me, part 4

Filed under: Ego, Historia, Paidagogia, Vita — Jacob Welsh @ 17:31

Continued from part 3

There was none of that IV drip of brain sugar known as television in the household. My parents were quite concerned with the developmental effects of screen time, especially of that aimless and passive sort; movies and video games were fairly restricted as well. As intended, this directed my entertainment desires to books. My father's reading to me became a cherished evening tradition, and I eagerly took up reading myself as I became able, with interests tending toward fantasy adventure and a bit of science fiction.

While I loved the family time, a sore spot for me is the amount of time spent being not-raised by not-them. Like many - I'd venture to say most - American kids of this era I was "institutionalized", with daycare from an early age (around one year, if I recall) feeding right into preschool, kindergarten, then school proper. I'm not too clear on how this compares to global or historical norms, but my understanding is that the crowded environment makes individual attention difficult and the constant change in caregivers disrupts bonding. "Because I said so" and "life's not fair" are the typical explanations I remember from the preschool authorities. While the unfairness point is perfectly true, I see its usage more as code for "I feel overworked and underpaid and can't be bothered to help you think through your kiddie problems." Not that solving one's own problems isn't important either, but I don't know... how much reflection or social finesse can you really expect from four-year-olds, especially if it hasn't been well modeled? The typical justification for this outsourcing is Money; the only difference in my case is that it was the Mission.

I don't well recall if or how I expressed myself about the preschool environment at the time, but as time went on the deficiencies of the cookie-cutter approach of the school system became evident. One story (handed down as I didn't recall it myself) was the third grade teacher asking, "What solid has the same shape on every side?" An eager me: "Actually, there are five:", proceeding to rattle off the 'hedrons with correct pronunciation that my eighth grade geometry teacher later wouldn't manage. Teacher: "Yes Jacob; but the third grade answer is the cube." Peer: "That's right Jacob, this is third grade!!11" Me: "That's right. Third grade, not kindergarten." Then in the sixth grade, there was that "science" teacher who earnestly believed the moon orbited the earth every 28 hours and criticized me as "argumentative" (something my parents were delighted to hear).

To be continued


Early history of me, part 3

Filed under: Ego, Historia, Philosophia, Vita — Jacob Welsh @ 17:16

Continued from part 2

The kids were all sent to conventional schooling of one sort or another, I suppose to be properly socialized in the "outside" world, which I've been starting to see as nothing but the inside of the larger cult of 'Merica - the more nefarious one for its scale and pervasiveness in the environment.

The organization hosted a day camp in the summers between school sessions. I remember these fondly for the most part; there was instruction in music, visual arts, drama, and some hands-on variety of math or science, punctuated by lightly organized sport, swimming, and at least some time for unstructured outdoor play.(i)

Not all was rosy, to be sure. The idea of an inner spark of goodness present in every human,(ii) that just needs the right sort of love and attention to kindle, played out bitterly in at least one way. Many families had put off childbearing well past their prime years for the sake of fighting the war, and realized too late either that they wanted kids or that the "about to win, any minute now" wasn't working out. Some, such as my own parents, made it work; others not so lucky turned to adoption, generally from the offerings of more-dysfunctional countries.(iii) Of these, some worked out fine, at least as far as the naked eye could tell; others did not. The camps were plagued by severe behavior problems from these, who would seek attention of any kind by being maximally disruptive and wasting everyone's time. And why shouldn't they anyway, with the "adults" perceiving themselves to have no options and nobody taking a serious stand to put a stop to it?

For my part, I thought of myself as a good kid and was eager to please. My home life, in continuation of my parents' own upbringings, was non-violent; I hesitate to say "peaceful" because there's always conflict of some sort, naturally. Voices were almost never raised, and disagreements generally worked out through discussion (though not always free of emotional "reasoning"). In my case conflicts centered around things I actively disliked doing, such as chores, trying new foods, and setting toys aside when the time called for it.(iv) My mother was the disciplinarian of the household, while I felt I could count on my father more for cooler evaluations of difficult topics.

To be continued

  1. Something I gather has been almost entirely disappearing from modern childhood in this not-so-brave new world of "safetyism" and touchscreen entertainment from the earliest years. [^]
  2. Possibly originating from LaRouche's high regard for Christianity (though he didn't require any particular religion or non-religion of members). [^]
  3. For reasons I'm unsure of but suspect to be ideological. [^]
  4. Things I still sometimes struggle with - go figure! [^]


Early history of me, part 2

Filed under: Ego, Historia, Philosophia, Vita — Jacob Welsh @ 17:29

Continued from part 1

While I lacked the knowledge to grasp the teachings or follow the affairs of "the organization" at a deep level, I loved the community and intellectually lively culture it provided, and engaged as best I could. We were at the "national center", which in the 1980s had fled the New York City rents to the then-small town of Leesburg, Virginia,(i) and provided a "critical mass" with other kids to befriend and helpful grown-ups who could teach on a variety of topics.

Like any good religion, music played a major part of daily life, regarded as a focused activity to train the mind and also providing pleasure and bonding. The focus was heavily on Classical music, with its emphasis on beauty and sophisticated harmonies (counterpoint) rather than the repetitive chord progressions of popular music. In fact, music was regarded to have healing powers, at least in a spiritual sense; there was no soul so lost that a sufficient application of Bach couldn't lift it back up, or so the theory went. There was a weekly chorus for the children, though the coaching didn't get much past the elementary; I had a good sense of pitch but never quite got the hang of projection and vibrato, and was fairly self-conscious about singing solo. I was also subjected to enriched by violin lessons, a more difficult and correspondingly rewarding pursuit.

Outside these mandatory activities, my interests got me into a geometry class with the adults; they used it as practice of what I gather to be their Platonic views, such as the process of creative discovery conceived as the mind becoming aware of something it already contained, and superiority of the "mind's eye" to direct sensory perception. "Accept nothing that you have not constructively proven for yourself" was one teaching. I also received private tutoring from a fellow who liked building things, reading classical physics texts and reproducing experiments. Among other projects we managed to build a working demonstration of magnetic levitation. As with music solving inner problems, it was believed that advanced technology could solve all economic problems, if only it were given proper respect and state financing of course.

To be continued

  1. Not so small anymore after the huge growth of the Washington, DC area, fueled as I understand by growth of the Federal bureaucracy and decay of industry elsewhere. [^]


Early history of me, part 1

Filed under: Ego, Historia, Vita — Jacob Welsh @ 17:06

A principal authority in my early years, until somewhere around age 14, through the natural channel of parental involvement, was the American self-styled philosopher and statesman Lyndon LaRouche (1922-2019) and his organization.(i)

They used various names for different branches of their efforts, from the ever so Soviet sounding "National Caucus of Labor Committees" for the activist core, to the "Schiller Institute"(ii) for larger philosophical, artistic and political outreach. It was a high-pressure environment for members, with promises of immanent collapse of the global monetary-financial system on the one hand, and a new renaissance uplifting the world from poverty and realizing the glorious potential of mankind on the other. Once committed, one was expected to give everything one had, and then some, to the cause. It was effective at least in terms of putting out vast volumes of printed material, attracting a sizable audience, running numerous election campaigns (though not especially successful), and keeping the operation more-or-less afloat for decades.

At least to my young self, the man was impressive in speech as in writing. He hailed from an earlier era, before the generations raised by television with 45-second attention span, could hold forth for hours on a wide range of topics with deep vocabulary and historical knowledge, and would expect you to keep up.

To be continued(iii)

  1. The "attempt to predicate the meaning on an authority predicated on the meaning" description would seem to fit. [^]
  2. After 18th century German poet and playwright Friedrich Schiller. [^]
  3. As before, I'm on a daily deadline in order to keep the pen moving. [^]


Analysis of "The road to Ossasepia" series

Filed under: Ego, Writing — Jacob Welsh @ 18:41

diana_coman: anyways, it's easy then: do a re-reading tomorrow and extract theme, structure and scope for the road to ossasepia series,(i) write them analytically bullet-point style and then see what you can say about them

The overall themes I see in the series are the journey, the internal struggle, relationships, and vulnerability.

The attempted scope was the events of my time in the channel from joining to acceptance with enough context to make sense of them.

The overall structure was narrative, starting with exposition on background concepts then proceeding to my initial state, my interactions in and out of channel, and ending with results. In detail:

Part 1:

  • Opens with a quote from my entry to the channel, representing the beginning of this journey and middle of larger one.
  • Sets up for explaining the meaning and context of the quote and the events to follow.
  • Introduces TMSR through a summary of what I understand it to be about.
  • Introduces the concept of the forum through a summary and reference.
  • Hints at the structure of the hierarchy.
  • Introduces Diana Coman in this context, though not much is said about who she is otherwise.

Part 2:

  • Turns the focus to me, and in particular where and how I'd gotten myself stuck, by my present understanding and with reference to some TMSR terms of art.
  • Introduces Robinson, somewhat obliquely.
  • States the dissonance, the decision, the plan, and early steps (without much detail)

Part 3:

  • Describes my heading to the castles, learning about YHC and deciding to focus my attention there.

Part 4:

  • Describes my struggle with the reading and decision making.
  • Illustrates some interactions in channel and privately.

Part 5:

  • Analyzes causes for my hesitation and how they were dealt with.

Part 6:

  • States my next steps upon applying.
  • States the criticism of unbalance in the form of weakness or avoidance in talking about myself.
  • Itself comes across as a reversion to this pattern, presenting a rather dry account of events without shedding light on my own experience of them.(ii)
  1. Parts: 1, 2, 3, 4, 5, 6. [^]
  2. And indeed I wasn't all that enthused to dig back into it now, which precisely shows that it's an important exercise. [^]


Next steps in wallet planning

Filed under: Bitcoin, Software — Jacob Welsh @ 18:40

The planning in my last article left a fair amount to the imagination, and in particular several pending decisions without sufficient detail to move discussion forward. The picture coming into view is that through a habit of insufficiently structured communications between engineering and management, I've been attempting to bear more weight of decision-making than is my due, trying to optimize things from the technical point of view which, while not unimportant, does not always align with the needs of a business to survive and grow in a dynamic market. I'll also take the opportunity to encourage present or future management to lean on me for support should it happen that I wander off into my own world.

With that in mind, let's expand a bit on the remaining tasks and decisions.

Switching to the now-builtin bignum support

I noted this as something that could potentially be deferred due to time constraints, because it does work as is. Unfortunately upon testing I've found that performance is noticeably degraded from what it used to be, at 14 seconds to derive an address from a private key on my dev system where I recall this having been closer to 5 seconds on earlier versions of the interpreter. (Transaction signing would be several times this.) I suspect a big part of the slowdown is the now-redundant layers of type and overflow checking; I'm unsure how to confirm this other than just trying the change. FWIW, I don't anticipate it taking all that long; maybe I take an hour and see if I can get it done.

Unspent output accounting; import of inbound or previously unknown outbound payments

The wallet tracks three types of data: private keys, the public keys and addresses derived from them, and transactions affecting its addresses. Queries such as balance and unspent outputs can be resolved by scanning the list of transactions, or tracked separately. As I see it, the "full scan" will have to work anyway so separate tracking, while desirable from an algorithmic scalability standpoint, would be a premature optimization at this stage. Without any such derived data to maintain, the "import" operation can simply mean appending lines containing encoded transaction data to a text file. Which brings us to:

External representation of transaction data (S-expression or maybe JSON)

I'm presently thinking S-exprs are the way to go; it keeps things simple on the Scheme side, and the Python side would only need to emit them, not parse them. What I'm not in a position to see is whether interoperability with other JSON-based tools would be desirable. I do have a parser in Scheme for a simplified form of JSON - omitting some Unicode details - that would suffice here.

Transaction input selection (menu-based?)

A possible cut here is to skip any sort of interface and use a simple selection strategy like FIFO. A manual interface could be added later. The idea here was to print a numbered listing of outputs by address/age/value and prompt for which ones to spend until sufficient value is accumulated.

ECDSA S-value normalization?

Turns out I've already got this: "As (r, -s mod n) is also a valid signature, the result is canonicalized to use the lesser of the two possible s-values." Thanks, 2017-me! (Some background.)

Fetching blocks from TRB (new RPC? Bitcoin protocol?)

In fact this could be done using the existing "dumpblock", perhaps using a named pipe. An RPC to return a block directly still seems preferable to me, but patching TRB isn't free. The "Bitcoin protocol" angle here meant connecting to port 8333 and using the p2p protocol commands to fetch a block, which is probably overkill if this is to be used in a batched or "pull" style.

Pushing raw transactions to TRB (likewise)

This one I don't think can be avoided.

Tracking watched addresses and synchronization state (SQL?)

The simple approach here, if indeed we're going for a batch model, would be a text file listing addresses and another that gives the last scanned block number/hash. When you run a scan, new transactions affecting the given addresses are emitted to a text file for transfer offline, and the last-scanned-block file is rewritten. If whatever data gets lost, you just rescan from an older block. Dealing with reorgs is where it could all get messier; one approach could be to insist on, say, 6 confirmations, and do a full rescan in the rare event of a deeper fork. How exactly one detects this and what could happen if one doesn't seems to warrant further consideration.


Gales Bitcoin Wallet: status, preliminary work plan and code dump

Filed under: Bitcoin, Software — Jacob Welsh @ 21:01

The item in question is the software component of a combination of hardware, software and operational practices with the goal of sending and receiving Bitcoin while excluding the possibility of remote compromise of keys (so long as underlying cryptographic assumptions hold). Proper airgapping is the foundation, but it's easier said than done when it comes to Bitcoin because of the dependency on data from the outside world for the inputs of a transaction. Popular "cold storage" solutions may involve storing keys offline, but have windows of vulnerability when the keys are generated and funds are swept using an online (i.e. insecure) machine.

Our approach is to allow data to jump the gap as selectively as possible, using a simple and low-speed channel (serial port) with optical isolation and manually switched simplex operation (one way at a time). The system is intended for manual, low-frequency usage; thus we're not especially concerned with performance or timing side channels.(i) At the same time, we're very concerned with correctness, which informs a preference for straightforward "textbook" implementations when possible, minimizing external dependencies and overall system complexity, maximizing auditability (e.g. avoiding any sort of processor-specific "crypto acceleration"), and publishing code.(ii)

Design points include:

  • An offline machine, running the offline component of the wallet. The machine is to have no swap, be operated on battery power during key operations, and powered off after use.
  • A set of private keys, generated offline by explicit request and associated with names of the operator's choice, stored in a tmpfs during operation and GPG-encrypted on disk using a strong password when at rest.
  • A true (i.e. hardware) random number generator, used for all key generation including the ephemeral keys used in ECDSA signing.
  • Transactions constructed offline (potentially reducing round trips through the airgap).
  • An online machine running a TRB node and the online component of the wallet, which pushes outbound transactions, scans for sufficiently-confirmed new transactions affecting the set of watched addresses, and produces minimal data structures for updating state of the offline component.


I've used my own Scheme system for implementation of the offline component so far, after an earlier prototype in the much larger (albeit more battle-tested) Python. Much of the code falls into one of two categories: math, or shuffling data from one format to another.

On the first category, I've implemented the following algorithms, with reference primarily to Menezes, van Oorschot and Vanstone and the SECG standards.

  • Bignum arithmetic: addition/subtraction, multiplication, division/remainder. My first pass here was intended more as an exercise, a "userspace" (pure Scheme) implementation supporting only unsigned values. I subsequently redid this, with signed integers and plugging into the generic arithmetic operators, still mostly in Scheme. The wallet code is presently still using the former. This is a conventional arbitrary-precision framework and thus does not support constant-time operations.
  • Modular inversion (extended Euclidean GCD).
  • Unbiased random integer in a given range.
  • Elliptic curve point addition and scalar multiplication, for the secp256k1 curve required by Bitcoin. Scalar multiplication is the most intensive operation, done once for key generation and several times for signing, and comes out noticeably slow; one optimization was to precompute iterated doublings of the generator point.
  • ECDSA signing.
  • SHA256 and RIPEMD160 hash functions.

On the second, the following, with reference primarily to the TRB and OpenSSL code (and sometimes the Bitcoin Wiki which was almost always a mistake):

  • Base58 and Base58Check
  • Little-endian hex and octet encoding
  • Fixed and variable-length integer byte encodings as seen in Bitcoin
  • The OpenSSL EC point (public key) encoding
  • The subset of ASN.1 DER as used by OpenSSL for ECDSA signatures
  • Bitcoin script, with code to construct p2pkh and p2sh outputs(iii)

These are presently wrapped up into commands by which one can generate private key files, the associated addresses, and (in case of emergency) export private keys to the "WIF" format for import to other wallet software.

The aforementioned Python prototype also implements the somewhat convoluted Bitcoin transaction signing algorithm, and I have Python code for deserializing blocks and transactions.

Remaining tasks

This list will surely need some revision upon contact with reality. The practical deadline so as not to wreck my own holiday is December 13.

For the offline component:

  • Porting transaction signing to Scheme
  • External representation of transaction data (S-expression or maybe JSON)
  • Switching to the now-builtin bignum support
  • Unspent output accounting; import of inbound or previously unknown outbound payments
  • Transaction input selection (menu-based?)
  • ECDSA S-value normalization?
  • Frontend commands
  • Shell scripts for "opening/closing" the wallet (GPG operations)
  • More tests

The online component, for which I'll probably stick to Python and make use of available libraries:

  • Fetching blocks from TRB (new RPC? Bitcoin protocol?)
  • Pushing raw transactions to TRB (likewise)
  • Tracking watched addresses and synchronization state (SQL?)
  • Export of new payment data for transfer offline
  • Alert for unexpected outbound payments

Partial code dump

Python prototype:

Offline component, Scheme code:

  • pkg.scm - basic import/export mechanism used by the remaining
  • bignum.scm - Unsigned "userspace" bignum library
  • ecdsa.scm
  • bit-ops.scm - some rather sad complexity for implementing fixed-width arithmetic and bitwise operations, which in hindsight would have been better done as interpreter extensions
  • hashes.scm - the RIPEMD and SHA families, based on the above
  • wallet.scm
  1. Certainly it would be preferable to eliminate these. [^]
  2. At least when it comes to cryptography, you don't gain much from obscuring your algorithms or implementation, because chances are you're not as clever as you think: all the ways to mess it up are already known to someone and will eventually be probed. [^]
  3. The latter might be a contentious point; it does not involve any support for "multisig", "segwit" or similar on my side, but enables one to transact with those who insist on these Gavinistic 3-addresses. [^]


Blogging photos and chat logs: some handy scripts

Filed under: Software — Jacob Welsh @ 20:37

For last night's article I had to pay the debt of having deferred my ever so carefully planned dig into photo blogging for quite so long. I started from Popescu's recipe and made it into a script, including doing the necessary jiggling so I wouldn't have to recall the details every time.

One detail I wasn't sure about was the function of the "size-large" and "wp-image-###" classes on the <img> tag, so I left them out. If I wanted to style an individually numbered image, I can't imagine why I'd want to do it in a global CSS file rather than a local style attribute but perhaps there's some other reason. Ideally I should have asked in advance.

Without further ado, the blog-photos script:(i)

echo -n "Output file prefix: "
read pfx
root="/wp-content/uploads/`date +%Y/%m`"
let cnt=0
for f in "$@" ; do
	let cnt++
	echo -n "<a href=\"$root/$pfx-$cnt.jpg\">"
	echo "<img src=\"$root/$pfx-$cnt-720px.jpg\" alt=\"$pfx-$cnt\" title=\"$pfx-$cnt\" width=\"720\" class=\"aligncenter\" /></a>"
	echo # paragraph break for spacing between photos
	convert "$f" -auto-orient -geometry 1920 "$pfx-$cnt.jpg"
	convert "$f" -auto-orient -geometry 720 "$pfx-$cnt-720px.jpg"

The chief dependency here is of course ImageMagick. Typical usage, from a directory full of pre-selected images:

blog-photos *.JPG > draft.html

You could of course use "tee" instead of redirection if you'd like to see the progress. Once you've uploaded the resulting images to the proper directory, paste the draft as a new article (I like "xclip" for this; of course a GUI text editor would work too) and load the preview; this allows you to identify image numbers by mouseover so as to find where to put your text.

Next up, a simpler one for importing chat logs in the presently prevailing style from a browser, with proper escaping of special HTML characters, logotron2wp:

sed -re 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/^([^: ]*)/<strong>\1<\/strong>/'

Come to think of it, the first three substitutions there also work for any sort of code import that might contain those pesky &<> characters - such as this one right here.

The comment box awaits any questions, comments, flames etc.

  1. And now we'll get to see how badly long code lines will render... [^]

Hiking La India Dormida

Filed under: Vita — Jacob Welsh @ 08:43

El Valle de Anton is a town situated in a dormant volcanic crater, about two hours' drive from Panama City (assuming you time it to avoid traffic). One of the surrounding rock formations is known as La India Dormida, because it resembles a woman lying on her back, with trees and rivers for hair, peaks for nose, chin and breast, and more gradual slopes for legs. I couldn't quite see it at least from the vantage points we got, but either way it made a great hike and a way to escape the swelter of the city and enjoy the cooler mountain air.

Crossing the Pacific mouth of the famed canal on the Puente de las Americas.




On the right, a typical Diablo Rojo. On the left, the Saturday inbound commute.


Highway passing through the suburbs.


November is the end - and peak - of the rainy season. The grass looks happy.


Off the highway and heading inland.


First view of mountains.



Looks like they're doing something with it...





On the outskirts of town there was a strong presence of chinos (convenience stores run by Nth-generation Chinese). At this one, a taste of the local classifieds: hard drives and rabbits.





We stayed at Hostal La Casa de Juan; I wouldn't recommend it. The perhaps nicer Bodhi was all booked.



Indeed they don't seem to worry about much. Nor do the dogs that roam freely around the town, one of which we encountered taking a nap in the middle of the road. We didn't get to trying the pool table.


The bikes were "free"; maybe one of them had a working brake. The bedroom had a thick odor of mildew, and we soon found why: when it rained, the roof leaked right onto one of the beds. When we pointed this out to the staff they acted surprised. Fortunately there were enough extra beds.


Setting out on the adventure.


Perhaps the botanists in the audience can fill me in?





After the first ascent.





This would be why it's called El Valle.



Sniping some folks on the next peak with the 40x optical zoom on my newish Lumix.






Defunct vineyard?


After the final ascent; the view is almost straight down. (They say I like a few hundred feet of rock under foot!)








There's an excellent waterfall pool we dipped in to cool off. To get there we had to scrabble a ways up the rather slippery rocks, while it was raining, so I wasn't risking the camera, but here it's kinda visible through the trees.


There must be some story to this massive thing...


Across the bridge it opens back to the road and we've completed a 3-hour loop.


Afterwards we grabbed a meal at Charlie's Empanadas y Pizza y something-or-other. Food was tolerable and service was surprisingly attentive, compared to what we'd heard of other places. Afterward we stopped for groceries at a Rey that looked just like they do in the city, made some proper piƱa coladas back at the Hostal, and played a few rounds of rummy, taught by Robinson as the rest of us had been missing out.

And we're back home on Sunday.


« Newer PostsOlder Posts »

Powered by WordPress