Testing Your ERC20 Tokens

  1. Deploy a test network like Rinkby or Ropsten. The ether on these networks are test ether you can get them for free from a faucet.  I am using a Ropsten node run on infura.
  2. Get a wallet with a Mnemonic. I am using iancoleman’s wallet generator.  This is not secure don’t do this for real ether.  Save the mnemonic to a .secret file and .gitignore it.
  3. Get some free test ether from a faucet like this one.
  4.  Edit your truffle-config.js file and  uncomment the lines related to ropsten like lines approx 24,25,63-70.
  5. npm install truffle-hdwallet-provider (or a hdwallet provider)
  6. truffle test
  7. Then do some debugging so your unit tests work
  8. truffle test –network ropsten
  9. ooo tests have different results on different blockchain networks yikes
  10. the errors are not that bad and its a test network – lets deploy
  11. truffle compile –reset –compile-all (because why not)
  12. truffle migrate –network ropsten
  13. did it work? lets check the ropsten blockchain! Its alive! Here is the repo
  14. Tomorrow we interact with it via our web app and reactjs

Important you must call approve before transfer or your tokens will be inaccessible forever.

I also got some good haskell links from some folks at Recurse.  And my favorite link of the day – Voldemort types!  I discovered this while googling a rust bug.

Rust Deep Dive and other things


Although I did not anticipate I would be doing this, at Recurse I have been doing a deep dive into the rust programming language.   I have been coding the cryptopals solutions in rust, and I am exponentially faster. What took me 6 hours last week now takes me 1 hour.  I am still doing many things the unrusticrutian way, but I am slowly refactoring.

There is a great community of Rust programmers and enthusiasts at Recurse and it is really helping improve my code (and code readability – thanks for the linting tips y’all). I am using this for Solidity linting, because my nvim inter makes me do all the work manually!

I have been looking around for an open source Rust project to contribute to.  I was thinking of tower, which is a web and networking framework.  But yesterday. J at Recurse, who has been really helpful in all things Rust, posted a blog post and a link to Dalek, a cryptolibrary.  The blog post is a fantastic meditation on drop and memory management and how to understand libraries and contribute to a codebase.  I also got this great suggestion for rust debugging. I am now looking for a good rust unit testing lib – any suggestions?

I sort of have this feeling that crypto and cryptographic work is to today what the web was to the 90s (and 00s).  But I also had a feeling that facebook was a fad, so I should probably not be trusted.  In any case, I am loving my blockchain work, cryptopals and algorithms reviews so much I think I am going to work on this library, or maybe a rust library for signal.

PrayerCoin is moving along, every day I look at it and spend an hour meditating on what I need to add.  I have expanded the ecosystem with Ritual and Liturgy Contracts.  I am adding functionality whereby you can donate a cryptokitties to a prayer and make a ritual. Donate is the wrong word – the word is at the tip of my tongue and I cannot get it.

I had a great short discussion with Noah about games and blockchain.  All the logic for blockchain games are around pips not the board.  The cryptokitty has all the logic and then we bring it to the game space.  This is different from say the magic circle of Huizinga.  The circle is everywhere and no where. It has infinite circumference and zero area like a Sierpinski Carpet. These games are more like world building than traditional games.  Why is it a game?  My definition would be that the rules structure the game and the magic circle, rather than a board or physical location of a magic circle.

But if the power is in the pips and not the board what does this mean for game design?


In the weeds


Today I fired up aws and set up an IPv6 machine to access the heap at Recurse.  I was assisted in the anaconda in stall by Mari’s blog post.  I have to fix the tunneling so that the Jupyter notebook works.  I think this would be a perfect terraform project –  and I’ve put it on the docket for Thursday.

I continued to add some functions to the PrayerCoin contract. Ben and I played around with 0x Relays, launched RCCC (recurse center coin) on Ropsten, and generated a some wallets, per truffle requirements, with mnemonics.   We are almost ready to trade RCCC on the 0x Relay.  I am a rebuilding my dapp deployment to create a framework for automating  react/truffle dapp creation. I sort of have an idea of something like glitch for dapps. But I am not going to let this distract me from the prayer coin.  HOWEVER, if I can create tools to help build prayer coin, or help people build PrayerCoin dapps – all the better.

I made some progress with my Transduction music app, after breaking and then fixing the Mastodon integration.  Integration with Euterpea has been slow going. I am finally making it to the exercises portion of The Haskell School of Music.  I had some difficulties getting the examples in the book working but when I discovered the examples github repo, everything ran much more smoothly.

Amy and I brainstomed about webrings, an early web phenomena when people linked their sites together as sort of a discovery tool.  Is there any role for a webring today? Most curation is done by automation and tagging. There is something interesting about someone creating a home grown ‘webring’. What is the content that will be strung together today? Probably not websites.  I am curious to see what Amy creates.

A group of people are going to pair program this weekend on pwnable.  This looks super cool but I have zero time to devote to it. I went through the first lecture on consistent hashing from Tim Roughgarden.  I remember first starting to use hashtables and it was like a secret super power.  Consistent hashing is this times a lot.

Weekends are for cryptopals


I have decided that weekends is for implementing cryptopals – at least sunday night after a nice bath with epsom salt, candles, incense and cryptopals mood music.  I am starting to get faster with rust. My code needs refactoring, optimization, and unit tests, but I really like the rust linter  (ale) I am using – thanks folks on the zulip message thread.  This site for binary/hex conversion was also helpful in my debugging.

I am extending my RC stay to the full 12 weeks. This gives me some time to r&d my prayer coin once it is released it in the next week or so.  It will also give me the chance to bone up on my fundamentals such algorithms and distributed computing, similar to the cryptopals exercises.   I can also develop the core concepts of conscious computation.

I finally finished reading James Hillman’s The Dream and the Underworld.  Now I finally understand what people mean when they say the ancients had mythology (powerful forces explained as stories of the gods and heros), and the moderns have psychology (powerful forces explained as personal complexes or features of the mind).  I also was interested in the idea of a topos of the dream world vs a geography of the dream world and the similar relationship between a depth psychology and a biological study of the mind.

Loosely speaking, in the first instance you treat the mind as a whole with its own logic and landscape, in the other, as a collection of parts to be measured and parsed independently.   There is a point that Hillman talks about regarding the inaccessibility of the unconscious. The  idea that there area aspects of the mind, and of the dream world in particular, that we cannot access, e.g., that which is hermetically sealed, that which is invisible. We can only access these things obliquely.

I was thinking about this in relation to Machine Learning, since I  have been repeatedly binge listening to Machine Learning fast.ai course.  What we learn about a model generated by an RNN or CNN (or some other NN), is learned obliquely. How we reason about the speed of a compiler or a computer program is also learned obliquely. These things, machine code and neural networks,  are also hermetically sealed.  How can we access something that is hermetically sealed? Is it through the aesthetics of the enclosure?  The style of the computer language used to generate the machine code, or the data set and training used to generate the NN model?

It reminds me of Deleuze and the fold (and the Baroque).  The ultimate hermetically sealed object is Leibniz’s monad (its kinda like an atom with no subatomic particles).  How do we communicate with the monad? We have the new concept of the fold!  The topology of the interface, the folds, allow stuff to come through because when you look at a curve analytically (with calculus) you will come up with holes! This allows us to obliquely see the light within.  Meditate on that – grasshopper.

Some things I learned:

I learned about a new npm package, cross-env, which takes care of setting environment variables across different systems.

I am looking into parsing chess game files to use with my Haskell music program. This will be interesting because I will have to write a Haskell parser, which I feel is a very Haskell thing to do. This is something I have wanted to do for a while, since the 8×8 chess board maps well to the western musical scale.

Michelle wrote a great blog post on how to release an npm package.

Elias posted about cool linux tools.

Someone on zulip posted this course on hacker tools at MIT, which I probably will skim at some point.  This is probably the most useful course anyone can take.

RNNs Vs CNN.  RNN pays attention to the order of things, such as world always comes after hello. CNN pays attention to the pattern of a thing, such as this is round and this is angular.  It is written logic vs pictorial logic. What about the logic of world building or algorithmic logic?  What kind of neural net do we use for that. Perhaps that is in the next fast.ai video.

Because the heap is on IPv6 and the rest of the free world is onIPv4 I had to do some learnin in this area. Digital Ocean had a great online tutorial.  Sophie Dogg also had a useful post.


From Little house on the prairie

Things I learned Today


Thing number 1 – Glitch!  It is like a mash up of geocities and heroku and git and animated gifs and unicorns.   I just learned about it. Apparently it used to be Fog Creek – which made debugging software.  I know about Fog Creek because I worked with a guy who was obsessed with Joel on Software – and rightly so – the guy has done some amazing things.

I then spent some time working in rust on cryptopals, which has replaced kundalini yoga as my meditative and spiritual practice and  then continued my research in borrowing and other things rustifarian.

Grin mining went live this week, or maybe last week. It’s a blur really, but I watch their github repo. Grin is written in rust and like monero is forked every 6 months to avoid ASIC mining.  It implements the MimbleWimble protocol.  Here is an article on how to mine grin, which I may implement if I spend more than an hour in the car this weekend.

Amy helped me with my fastai paperspace (a digital cloud for gpus)  issues namely

print(filename) cv2.imread(filename).astype(np.float32)/255

fastai claims filename is not an image. But it IS an image and it renders an image with other fastai tools. Amy thinks I have the wrong version of the fastai lib. So tonight I am trying to install this on the RC heap. But my ssh is not working because of IPv6 things.  I may try plaidml.

Amy and I reviewed how to use a model with a web app. I am really excited about this and plan to implement it once I finish training my model.  We then talked briefly about the decentralized web and web rings and scuttlebutt and mastodon . I mentioned blockstack. I have been working a bit with mastodon this week on my Haskell music transduction project so it was interesting to view it from the perspective of decentralization and open source (I was just using it because it was easy to create bots!)

Today Michelle and Terry demoed Kudos.  I think it is a really nice sample app for writing zulip bots. We deployed on now, which took a little bit of work but worked out fine.  In now 2.0 we can schedule tasks, but for now we use cron jobs (thanks Alan).  Michelle introduced me to the fanatic git tool – git flow,  and **/*.py (wildcard for this directory and children directories).

Alan walked me through some typescript, which I really appreciated, and it looks much less painful than using javascript.  Javascript offends my aesthetic sensibilities as I have mentioned on this blog before.

Finally,  here is some nyc housing data that someone shared on zulip. I am just going to stash it here because it may come in handy one day for a ML project. I am a digital hoarder.


View at Medium.com

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 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.


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.