Before you go, check out these stories!

0
Hackernoon logoHere's How I Built An ETH Wallet On A Cheap NFC sticker by@omodaka9375

Here's How I Built An ETH Wallet On A Cheap NFC sticker

Author profile picture

@omodaka9375Branislav ฤaliฤ‡

https://gitzilla.netlify.app/users/Omodaka9375

Story of how I tried to become a cyborg, but with a geeky twist

So let's get familiar with this technology we will talk about here for a second. Here is what Wikipedia has to say about NFC:

Near-Field-Communication is a set of communication protocols for communication between two electronic devices over a distance of 4 cm or less. NFC offers a low-speed connection with simple setup that can be used to bootstrap more-capable wireless connections.

NFC is amazingly convenient technology. Even with small data throughput you can do many fun things with it like data transfer (android beam), authentication, cool v-cards etc. Sort of using it as read/write QR code in most cases.

Check out this recent amazing example of putting a snake game on a big QR code that stores up to 2,953 bytes:

https://itsmattkc.com/etc/snakeqr/

How it came to this

My original idea was to get some nifty xNT chips at dangerousthings.com and install them to soothe my needs and hobby project requirements.

After a month of waiting for the shipment (due to delays) it turns out I needed special permit for importing these harmless devices into my county. This was a problem and devices got sent back. So I was a bit disappointed, but never discouraged!

The original chip for xNT series is NTAG216 generation and one of the most durable and recommendable among the list.

Here are some important specs that reveal capabilities and limitations of this chip according to shopnfc.com:

NTAG216 13.56MHz ISO14443A

  • 924 Bytes total memory
  • Writable memory: 888 bytes or 852 characters
  • The latest chip, with higher capacity and high scan strength
  • Compatible with all NFC Smartphones, NFC Tablets

One might think this is still too little memory to do anything meaningful ...

Challenge accepted!

While chatting over a coffee with friend and a colleage who recently entered crypto market, he raised the question of practicality of regular payment cards vs crypto wallets. They all use NFC for wireless pay! So I came up with idea to try and make a custom ETH wallet app that will be stored on the chip itself. I decided to call it xETH - in memory of xNT series chips I never got.

So after considering the application I decided to go with 29mm round sticker tag:

I still find it sleak that they are so thin and basicly well, stickers! Maybe I can't be one of the "cool" cyborg kids, but at least I can give my honest developer contribution, and that is to stick NFC tag inside my wallet!

Idea is to have both my "real" and my crypto wallet in one place. I would just tap my phone to my wallet and voila I get my xEth UI on the screen ready to send/receive some crypto.

I had next wallet-like functionalities in mind:

  1. Ability to create an new ethereum addresses
  2. Ability to get balances
  3. Ability to make a transactions

All this without leaving the NFC app, with 888 bytes of writable space, on a chip that doesn't support encryption. What can go wrong?

S in NFC is for security

There is not much of security built in these chips, or none at all I should say, so we need to be specially careful and pay attention to what we can do and achieve security wise. Here are some tips:

  1. Using SSL to communicate to server (traffic encryption is a must!)
  2. Whitelisting your nfc chip on your smarphone (just you right?)
  3. Using password encrypted private key (maybe for part two?)

So how do you write an NFC app anyway?

Under keep-it-simple-stupid guidlines (KISS) I decided to go for more reproducible way by using NFC Tools and NFC Tasks android app to program the chip.

NFC Tools Pro for Android

I created 25 tasks under a custom profile called XEth that is executed when device scans the chip.

If anyone wants to create their own xETH wallet I provided the code here:

https://github.com/Omodaka9375/xEth-wallet-for-NFC

and video instructions on Youtube here:

So there it is.

xEth an ETH wallet in 861 bytes on cheap NFC tag in my wallet!

I hope you enjoyed this little adventure into a hobby project that turned interesting in the end!

Tags

Join Hacker Noon

Create your free account to unlock your custom reading experience.