Bash Function for Assbot Authentication

Michael Goldstein – February 5, 2015


Recently, the gribble IRC bot used by the Bitcoin-OTC web-of-trust was down, so #bitcoin-assets forked the WoT. Furthermore, their IRC bot, assbot, was given GPG authentication commands. A nice upgrade is that it authenticates every command for more security, rather than establishing a session. This can be tedious for the user, but it’s nothing a little dash of bash script can’t alleviate.

Open up the terminal and type vi ~/.bash_profile. This will open up your .bash_profile file or create one if it doesn’t exist. Scroll to the bottom using the arrow keys or typing G. Type i to enter insert mode. Type the following:

wot() {
  echo -n "!v" $(curl $1 | gpg -d) | pbcopy;
}

Hit the escape key to exit insert mode, and type :wq to save the file and quit vi. Now enter:

$ source ~/.bash_profile

or close the terminal window and open it again to load the bash profile.

Now when you make a command to assbot in IRC, copy the URL for the OTP and open a terminal window.

$ wot http://w.b-a.link/otp/[random hex]

If GPG asks for your password, type it in. Open your IRC client, and paste the clipboard contents into a message to assbot. It should look something like this:

!v assbot:[username].[command]:0f0c15c6a64dca33a464c93fc9b67e4ad2e7dc4ebf002f35da01850d422fc0f1

Done!

If you are new to the terminal, all of this may look like gibberish, so let’s walk through how it works:

Note: This will obviously not work for more advanced users who opt to keep their keys on an airgapped computer.

Learn more about #bitcoin-assets, GPG, the Web of Trust, and assbot on the bitcoin assets wiki and more about bash scripting in Mendel Cooper’s Advanced Bash-Scripting Guide.



←Pierre Rochard and Gavin Andresen Discuss the Block Size Limit Bitcoin the Currency→