RC Hackathon

Today was an internal RC Hackathon. Tenor and I were going to do some dev ops on the internal cluster, but that did not pan out. Instead I worked, sort of answering python questions, on a zulip chat bot spearheaded by Michelle and Terry.

At first we created a bot as part of the zulip bot architecture only to realize we did not have access to the zulip server. Then we moved over our app to use the rest api framework.  I wanted to deploy it with now, a sort of heroku for serverless apps, but the app was running as a statemachine.  Really what I need is iron.io. Do people still use that? I did some googling and could not figure out how to schedule now.  One bogus thing I could do would be to deploy the chat bot to now and then ping it with a cron job.

I made some head way building out the PrayerCoin contract and a contract for reifying non fungible tokens. These are up in github.  I am going to continue to clean them up.  I got integration working with haskell and mastodon. The more I work with Rust the less patience I have for Haskell, but something about the language seems very beautiful and I would like to stick with it. I had to do some pruning of my code base but that too is now up on github. I still need to write up my dapp ripple tutorial. But I feel like I am in a good groove with contract development in truffle and I have some ideas for creating automated dapp deployments.

There was a great discussion of consciousness in the consciousness reading group.  Why are we interested in the brain? What if consciousness is not located in the brain? DEEP THOUGHTS. Next week we are going to read about complex systems, mycelium, and the microbiome (my personal favorite for seat of consciousness) .

Now I am going to curl up with some green nettle tea and some James Hillman,

Rust or Can’t understand the ‘use of moved value’ error

I had allocated 2 hours to write out cryptopals in Rust. Instead it took about 4 hours. I am including the hour I spent on a coffee chat and general mingling.  It was a long four hours – it seemed like 1000 hours. I struggled with Options and unwrapping and &Str and String.  I rewrote code to fix a bug to discover I still had the same bug and uglier code. But in the end it worked and I finally pushed it to my github repo.  I have a back log of problems to implement,  I hope they go faster.

Do you see my title –  that error stopped me for about an hour while I rewrote all my chars to be Strings, only to figure out I needed to make a variable mutable. OY!

In any case, I made the program interactive which was very helpful in debugging since I could pass in parts of a hex string rather than the entire string.  I was aided in my work by these trusty websites and Austin and Liz.

After I had a quick rust code review with some folks where I picked up a bunch of tips like using Chunks, and using bitwise operations for optimization.   Last week I was really impressed with a presentation on assembly and we looked at this fantastic tool call godbolt that translates code into assembly.  You can also do this on the command line: RUSTFLAGS=”–emit asm” cargo build and the cat (in my case) target/debug/deps/cryptopals-*.s. I think it would be interesting to see how the compiler handles multiplication vs bitwise operations.

Some links that fellow rc’ers put up today that I want to investigate later are: A Sol Lewitt drawing application that implements his ‘algorithms’, a conference for women and non-binary coders, rust debugging (I am still looking for a good debugger to integrate with neovim), and Curv -“a programming language for creating art using mathematics.”

Tomorrow is the RC hackathon. I will probably be hacking with Tenor on devops tools for a computer herre. I am sort of obsessed with getting to use an expensive gpu for machine learning.  Tenor wants to build an env for k8 deployment (I’m oversimplifying).  If we dont get access to said computer we will probably hack on a super secret zulip integration.

One first today! It was also the first time that I remember using git rm -rf –cached ., because I forgot to gitignore my target files.


View collection at Medium.com

Series: University Casebook Series Hardcover: 1088 pages Publisher: Foundation Press; 8 edition (June 18, 2013) Language: English ISBN-10: 1609300971 ISBN-13: 978-1609300975

Creating Contracts

I powered through the cryptozombies tutorials and it gave me a real sense for how to build NFTs and create interactions between NFTs.  But, the best part of the tutorial came from implementing ERC721x – NFTs that have limited quantities. I mentioned this in an earlier blog post but ERC721x are items that have multiples, like a sword in world of warcraft that has many copies in a game.

This is applicable to my prayer project since multiple people can have the same prayers -so there are multiple copies of the prayer.

It is also applicable to a supply chain idea I have for a while – refiedNFT- non fungeable tokens that you can turn into physical objects. This happen, if for example, I want to make my crypto kitty into 3D printed kitty, or crypto zombie into a real card, or my crypto tee shirt into a real tee shirt.  Looking at the ERC721x gave me a sense for what it would be to create my own EIP or ERC for this type of token and I have been going through the EIPs/ERCs submitted to the ethereum repo on github.

For a refiedNFT we would probably want to expand on ERC721x since we might want to create multiple editions, but to keep things simple we can start with an ERC721. To reify, we need a reification address (the manufacturers ethereum address), a physical shipping address – although this maybe we can encrypt on IPFS since it is a security issue, a description of what the physical item is, and confirmation of delivery (maybe a tracking address or the ethereum address of a shipper).

I imagine a function makePhysicalItem where the manufacturer offers to reify an NFT.  And then a reify function where someone orders the physical item.  I am still mulling this over.  Rather than only a _mint function there are 3 other funtions:  _make,  _order and _fulfilled.

In the meantime, I have settled on the basic structure of my prayer coin that I will post to github this week.  It will have a message (prayer), a uri (optional), strength, execution schedule, (execution place?), perhaps a notion of execution type, and then a mapping of users with number of prayers, mapping of prayers id to prayers, mapping of prayers to prayer instances (ERC721x), mapping of prayers to number of prayers.   My big issue with ERC721x is that it uses indexes to divide between types of NFT (multiples and singletons). Everything with an index under 1,000,0000 is a singleton, over is a multiple. I would rather keep separate mappings rather than use this convention.

I need logic for updating the strength of a prayer – this will depend on how many people share a prayer and the last time it was ‘prayed’.  I also need logic for updating the execution schedule.  This will depend upon the strength of the prayer.

Thinking about an execution type complicates things. What do you want your prayer to do?   Should I define it or should the prayer define it? Can the same prayer have different executions depending on who owns that particular prayer?  Maybe the prayer is written to the blockchain, or ethereum is donated to a particular charity (transferred to an address).  I will probably leave this out for the first iteration of the prayer coin  BUT  I can imagine an EIP for this to create a new token standard.  I will probably just write the prayer to the blockchain for this version or write the token id as Proof of Prayer!

But, what can you do with prayers like the eco system built around cryptokitties? Well, you could build out liturgies and rituals by chaining prayers.  Maybe build altars or memorials or intention experiments. I do not really know.   We can imagine that perhaps  many games started out as prayers or rituals – or a connection between games and ritual or prayer.  Is there a connection between pickup sticks and throwing the I-Ching?  I searched the internet and found this, perhaps bogus, but thought provoking article on St Teresa of Avila – the patron saint of chess. St Terese encouraged because the attributes necessary to become a good chess player are similar to the attributes necessary to become a spiritual person.  So maybe we can create a cryptokitties universe from cryptoprayers.


Binge Learning

Sunday I spent most of the day in transit, so I used it to binge learn.  I powered through the last few tutorials of crypto zombies and through the first few lessons of fast.ai.

I highly recommend anyone interested in tokens and dapps to do the crypto zombies tutorial/game. It really filled in some gaps in my token knowledge – like when to create a modifier, how to implement the approve interface (if you saw my blog post a few days ago you will see my puzzlement around this interface method), and the secrets of Emit. Also there are some best practices for creating webdapps, that I had to figure out the hard way, so save yourself some heartache and go through the tutorial.

One of the main takeaways was how to create non fungible tokens that are not really unique.  This is under a specification called ERC732x (according to cryptozombies).  The example is something like game assets such as a sword or a magic rock. Many people might have the same game assets – such as the same sword.  But it is non fungible to a certain extent.  This is the same thing with prayers. We may have the same prayers, similar to the way we might all have the same sword in an RPG.

The biggest revelation came with my binge learning on fast.ai. It is blowing my mind. I did the Andrew Ng course on coursera a few years ago, but fast.ai is amazing. The teacher is very inspirational and it is all about learning tools and then coming up with new ideas to apply the tools to.   I finally understand what the different levels in a neural net do. Why you would want to freeze some and train others more.   The first example is to create a CNN for recognizing cats from dogs.  I replaced it to recognize mala beads from rosary beads.  I am hitting a few snags with the fast.ai library finding the path for my images but if I bite the bullet and use keras I think I could fix it.

But really I am interested in the relation between things not the differences! So step two – which I learned in lesson two of fast.ai is to separate out the different CNN layers to see what the interpretation is at each layer.  Then it is to use all manner of prayer tech, prayerwheels, tefillin, and maybe create an ai that creates new prayer tech – that would be kind of amazing.

But practically,I think it would be amazing to write an article around the tech behind the machine learning, and with the CNN visualizations this is really approachable.

scp my.tar.gz paperspace@ip:/data/


Transmediale – An Archaeology of Prediction

Today I engaged in a talk Tom Moynahan as part of a series of talks at Trasmediale.

Apparently my audio totally dropped out, but it was a good dialogue on hypothetical ethics – and I think I’m going to explore the topic more.

The title of the talk was hypothetical ethics.

What is hypothetical ethics?  We have a lot of information generated by predictive systems – ie simulations.  What is the epistemological status of this information? Are they facts? Are they opinions? Are they empirical data? What are they? But more important what ought we to do with this data.  How should we use this information to act ethically.

So this is a new issue.  Because of our ability to run large simulations on computers we can run scenario analyses and predict with some probability whether or not a certain event will happen.  I look at this form of  prediction and the latest is prediction technology, this exists in a continuum beginning with fortune tellers and augers.

How is prediction different from traditional ethical reasoning. If we look at deontological ethics, rules for how to live, predictive ethics turns it on its head.  Instead of looking at universal rules we are looking at particular instances. And perhaps our rule base – our deontology – moves to the simulation rule set. We perhaps need a meta-denotology to govern how to build simulations.

My thesis is that we need a new framework to think about this. This is through an archaeology of prediction. in this way we begin to think of ethics as a collection of tools, as techne, this is contrary to the traditional distinction between ethics (action) and techne (material).  Ethics is about action where as techne is about things. But today we are experiencine a dematerialization of everything (and we see this in art) – and material objects create a performative activity (code actually does something). The old distinctions do not hold  – everything is action and everything is craft.



Olympic champion Germany edges Canada 3-2 on late goal in women's soccer frien

Weekly Goals

This past week I was able to accomplish some of my goals – a web deployment of an NFT, and did not accomplish another goal – a toy project related to conscious computation, keep up to date with Fast AI. I added and maintained some other goals related to education rather than production: work through cryptokitties, work through cryptopals, learn terraform. And I did add and achieve some goals related to community: continue my weekly blockchain working group (although only Amy attended),  started a weekly conference workshop – to workshop conference or meetup talks, and I started pair programming with Ben on OpenZeppelin deep dives.

A blockchain reading group started for Thurs at 10. This week was a deep dive into ethereum, but some fellow recursers posted links to bitcoin tutorials  and of course the original bitcoin paper.  Ben here at recurse is building his own blockchain from the bitcoin white paper.  I think it would be cool to have a cryptozombies for actual blockchain creation.

Last week my goal for week 3 was a deep dive into webpack and deployment. If I end up building the prayer coin in rust then I will then I will not do a deep dive into webpack.

This week my goals are  – I would like to reduce this to 5 things, because this is a lot. But we will see what I can get done.

  1. To release a medium article / tutorial on created a react web dapp based on my unpaid labor coin.  I would like to extend eventually beyond ReactJS and look at Rust (Tower) and perhaps Haskell.
  2. Work on UI beautification and continue building out the features of prayer coin. Instead of a deep dive into webpack, build the ui in Rust and maybe take  a look at some of the 0x utilities that Sarah posted on zulip.
  3. Deploy one toy open source project related to conscious computation. Ideas include finishing the virtual  prayer wheel, a musical integration with mastadon, or a python module that creates prayers from a corpus of prayers, or analyzes the structure of prayers.
  4. Contribute to a rust open source project – probably Tower
  5. Continue with the educational and community projects.
  6. This week is the RC hackathon. I may try and work with Tenor on his suite of mesh network deployment of build tools. Or Maybe an RC coin – not sure what that would be used for.


Unpaid Labor Coin – A New Hope

Today I finished up the webclient  to allow people to create and view Unpaid Labor Coin. It uses IPFS and rinkeby. I used this fantastic rinkeby tutorial to get up and running. I did not realize that I had to run a local node.  My goal is to move it over to heroku this weekend and release a medium tutorial.

My biggest takeaway was that it is pretty easy to add access to a smart contract (e.g., token) interactions to a web app. All you need to do is bring in the ABI (application binary interface) for the token into a variable in the webapp and call the functions on that variable.  It makes me think that I could deploy prayer coin in Rust!  But one thing to remember when you edit and redeploy your contract in testing use reset “truffle migrate –network development –reset –compile-all”. Otherwise your ABI will have more cruft than necessary associated with old contracts.

This use of smart contract also made me think of other methods of interoperability such as shaders (interop between the GPU and the CPU) and web assembly (wasm – formata for a virtual machine that can be a target for compiled languages to run in multilple environments.  There seems to be a glitchy area – it is hard to debug these items beyond looking at the byte code. I wonder what a more elegant solution would be? Perhaps when machine learning AI write our software it will not be an issue.

There were a bunch of fantastic presentations tonight at RC. One person deployed an npm library that customizes node init, another person when through the steps involved in optimizing a compiler and how to view the Assembly code. A third person went through his creation of a cheering bot using mastendon, which I was completely unfamiliar with although now I am going to use to for my music transduction bot. Some other presentations included music visualization, open whisper system, and chrome extensions, and an attempt to read 100 papers in 7 hours.  I cant play with all these technologies, but it is inspiring and educational to see what everyone is working on.

I continued with cryptozombies, took the day off from cryptopals, and decided to try to do as similar exercise with traditional algorithms. I find that spending 30 min a day working on these exercises are very worthwhile. It is something I definitely want to continue when I leave RC.

I had two events scheduled, a how to present at conferences event:  We are going to meet every week and individuals will propose and workshop possible event or conference presentations AND my weekly crypto hacking workshop. Only Amy came that one – thanks AMY! It was fun we set up ganache with metamask.  I am becoming a pro at basic ethereum blockchain setup.

This wraps up another official week at RC. I am making progress on my project but I am also thinking about what ancillary open source projects and open source tooling I can release as part of my over all prayer wheel project and the larger project of conscious computation.  I am thinking about what I can contribute to and what sort of meta learning goals I can use to frame my weeks beyond technical milestones and deliverables.

Red Mars By Kim Stanley Robinson


This is a picture of the book Red Mars, the first volume in the Mars Trilogy, by Kim Stanley Robinson. It too is about terraforming (among other things). Its a fun book, I recommend it.

But today, I am going to talk about the other terraforming involving dev ops – and that is Terraform by Hashi Corp.  Terraform is a framework for making and executing automated script based deployments. I have seen this story before with ansible, salt stack, chef, puppet there are probably more.  I have always revered back to bash scripts because I am old school and these tools were not 10x. But then I started playing around with ILP nodes and used their fantastic terraform scripts.  (ILP is a technology that provides cross blockchain interoperability).  Basically the scrips spun up so many aws services in such an elegant design, that, if I would have done it by hand, it would have taken me forever and would probably look a bit gnarly  (since I would just want to get it over with and would not take time to make in beautiful).

Fellow recurser Akiva gave a lovely terraform tutorial, which really demystified everything. We talked a tiny bit about providers. Providers, in terraform, are definitions for, or extensions of, services that you are integrating with e.g., AWS, GCS, Digital Ocean, Heroku, etc. I would like to write a terraform provider, but I am not sure what environment needs one.  If someone comes up with one let me know.

I missed the consciousness reading group, because terraform ran over and I just wanted to get back to my rust cryptopals.  I am really enjoying programming in Rust, feel like I am getting a hang of the language.  I sort of just want to lie on a couch and program in Rust reverie.

Ben and I continued our ad hoc contract reading group and looked at ERC721 in openzepplin  – Non Fungible Tokens (ie cryptokitties).  There was a bunch of weird magic involving hex referring to function stubs. Not quite sure why we need that.  We are considering submitting a sample contract for ERC721 to github- which would be exciting.

I also did the first chapter of cryptozombies, a fun website that walks you through recreating cryptokitties but with zombies.  I was fast, fun and reinforced my cryptocurrency knowledge – also I think it was a well made app, but the compiler does not recognize blank lines and spaces – where can I send a git pull. I kinda want to create cryptosucculents now.  The day is not over yet and I hope by the end of the day to have deployed my UnpaidLaborCoin app via heroku. This would satisfy my tech proof of concept for the prayer blockchain and remove the unknown unknowns (for the most part). I also hope to finish the first two lessons in fast.ai.  If I can get this done – then maybe I can write up a tutorial tomorrow on creating a blockchain app with truffle and react and revisit the Haskell music prayer wheel.

There was this random url in my browser.  Its cool so I am including it hear. I am not sure where I got it from but who does not love Tan Lin?

Reading Documentation

Today I continued building out the prayer project by adding token functionality to the reactjs project via the abi and address generated in the build file of the truffle project.  This was punctured my slow going Rust implementation of cryptopal solutions.

In the morning Ben and I went over setting up truffle and the ganache to create a ERC20 token. It was helpful for me to review what I had learned by teaching another person. And we founds things that neither of us knew.  The best though,w was taking a deep dive into the ERC20 documentation (hence the title of this blog post). This raised two questions.

First, where is the documentation that tells us to define the symbol and description variables of a ERC20 Contract? ERC20Details.sol! (Thanks Ben) Second, what is up with the Approve and Allow functions? Why does ERC20 need them?  I have read a bunch of different answers that range from:  it is because everything on ethereum operates by push notification (there are no listeners), to it is a security measure to make sure that only a certain number of tokens can be transferred by a smart contract execution.

I still don’t have a great intuition around it, but I read this very helpful article, and I think I somewhat get it. It is sort of a a failsafe.  I would like to read through the documentation for ERC721 with Ben tomorrow. These sorts of exercises are very useful and rarely are you able to engage with them when you have tight deadlines and just have to sling code.

This afternoon there were fantastic non-programming related presentations about everything from how the democratic party works, to polyamory, to hiking the pct. Fellow recursers are so interesting!  I followed this with some cryptopals with Austin and Liz. We discussed different algorithms for implementing a weighting algorithm to figure out which message is most likely to be a  plain english message base on word frequency.

One thing we talked about was using the sum of least squares as a weighting algorithm. This I somewhat remembered from my finance days and finding the best fit of a line among a cloud of points. It is the square of the standard deviation. So for example if ‘e’ is found at a .15 frequency and in this message it is found .25 frequency the standard deviation and ‘f’ is found at a .20 frequency and in the message at a .25 frequency. We average the difference so .10 + .05 = .15/2  = .0072 subtract this from each frequency. so .25 – .075 and .25 – .075  then square each result (to get rid of negative numbers).  Finally average those out  – this is sigma squared or the Variance. When you take the square root, sigma, this is the standard deviation.   The standard deviation brings everything back into the same units as your original measurements or quantities.

This reminds me of options trading, where you are trading the volatility rather than the price. That means you are looking at sigma – the standard deviation in stock price. This helps you understand the risk that a option will move X standard deviations away from its current price.  But it means that you think there is a bell curve (normal) distribution of prices.

This is not the case! First, there is skew – ie the curve is not symmetrical.  You also have kurtosis which describes the distribution at the tails of the curve which also do not follow assumptions that they are 3 standard deviations away – yada yada yada. Both of these could be applicable to the word frequency weighting algorithm.  Word frequency probably does not follows a bell curve (normal) distribution.   There is also the concept of Heteroskedasticity which refers to sigma changing over time. That is, volatility is not constant over time.  I dont think this is applicable our problem of word frequency unless we are looking at messages trying to be deciphered from a long time ago -but then I would just get the word frequency from that moment in time.

I am super exhausted. I wanted to say something about log normal and keeping your volatility between 0 and 1 BUT it is quite possible whatever I just wrote does not make sense, so I am going to hold that thought.

Austin came up with a brilliant idea for the physical implementation portion of the prayer blockchain. It is super cool and I cannot wait to build it. I am going to keep it secret.

And the bookstore from yesterday’s post is topos bookstore and there is another group Patrick told me about is called I/O that hosts radical-tech events at various locations. Thanks again Patrick for telling me about these and sending me the info on zulip!

From the movie Beetlejuice 1988 American comedy-fantasy[2] film directed by Tim Burton, produced by The Geffen Company and distributed by Warner Bros. Pictures. T

Getting into the rhythm

When I got into RC this morning it was time for a group communal learning activity. It was lead by one of the members of the W1 batch who had 7 weeks under her belt. It was interesting to see on a blackboard what people wanted to learn or teach.  I grabbed a coffee and chatted with my fellow recurser, Patrick, about his work as a political activist and we made tentative plans to visit an activist bookstore in queens that runs a mesh network allowing users to download ebooks or chat with one another BUT only while they are local (ie able to connect to the local network).

I spent most of the day working on the web app for my test NFT – unpaid labor coin. I am building it in react and I used create react app to generate the scaffolding.  Most of my work came in the form of reading documentation about the latest web3.js library.  I also did a deep dive into which node package manager I should use yarn or npm.  I also spent a little time connecting my ganache local blockchain to metamask – so I test the entire web app.

At about 5 pm I was done with my blockchain work for the day and I headed to the 4th floor, the social floor, to work on the first cryptopals project. Liz and I puzzled through converting hex to base64 without a library. I learned a bunch of things behind code I have written for years like what UTF-7 or UTF-8 really means (Hint: it is the way that the ascii characters are mapped to the decimal representations of each 6 bit chunk of data).

I wrote the conversion code in Rust, which is a very pleasurable language to program in, and I am excited to be learning it. I also aliased vi to nvim in my .bashrc because  my muscle memory is too strong and I cannot stop typing vi whenever I want to edit something.

To end the day, I bookmarked a few rust open source projects that are interesting and that  I would like to contribute to one of them: either a web framework called tower, or a web assembly library, which is heavily used by  parity  (a company building a suite of crypto tools, wallets and cross chain protocols).  I would have liked to have gotten in a bit of Haskell, but tomorrow is another day.

A bunch of folks  then headed into chinatown for noodles.  I went home and put the kids to bed and went to bed early. We made a perhaps unwise decision this weekend to allow the kids to watch the movie Beetlejuice, and although they have discovered calypso music, they now are afraid of ghosts.