Skip to content

ninegua/ic-qr-scanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0784806 · Sep 3, 2021

History

54 Commits
Jun 9, 2021
Sep 3, 2021
Jun 7, 2021
Jun 19, 2021
Sep 2, 2021
Jun 13, 2021
Jun 9, 2021
Sep 3, 2021
Jun 13, 2021
Jun 9, 2021
Jun 9, 2021
Jun 9, 2021
Jun 9, 2021
Jun 13, 2021
Jun 13, 2021

Repository files navigation

IC Transaction Scanner

Security minded people prefer an air-gapped (AG) setup where they can always keep their private keys offline.

  1. Create a transaction on AG computer (e.g. dfx canister sign DFINITY SDK) as a JSON file.
  2. Create a QR-Code by cat message.json|gzip -c|base64|qrencode -o message.png.
  3. Scan the QR-Code on a non-AG computer (e.g. mobile phone) using this single page app to send it.

This app has been deployed on the IC at https://p5deo-6aaaa-aaaab-aaaxq-cai.raw.ic0.app

Features:

  • Send both query and update calls produced by dfx.
  • Send update calls with request status produced by quill.
  • Support request status for dfx >= 0.7.1.
  • Decode message send result in Candid format.
  • Reproducible build.
  • Switch between text input and camera video.
  • Support Add to Home screen from mobile browser.
  • Pick a better default camera (micro-lens) by default, or let user choose.

Note:

  • A message has to fit in the QR-Code size limit, which is about 4000 characters after gzip -c|base64.
  • Blurry image does not work, but you can always enlarge the QR code displayed on your AG computer to help with the scanning.
  • The JSON output from quill may be a list of messages, you can extract them one by one using jq to produce multiple QR codes.

Reproducible build:

You can verify the build by comparing hashes from 3 sources, github release, local build, and the deployed canister:

$ curl -Ls https://github.com/ninegua/ic-qr-scanner/releases/download/v0.1.12/ic-qr-scanner.wasm|sha256sum
9371610517945c65def5265bdde78597159bcc55e3dea58ce3e5111212e2f010  -

$ cat $(nix-build ic-qr-scanner.nix 2>/dev/null)/bin/ic-qr-scanner.wasm |sha256sum
9371610517945c65def5265bdde78597159bcc55e3dea58ce3e5111212e2f010  -

$ make dfx.json && dfx canister --no-wallet --network ic info p5deo-6aaaa-aaaab-aaaxq-cai
Controller: ihamg-4yaaa-aaaab-aaafa-cai
Module hash: 0x9371610517945c65def5265bdde78597159bcc55e3dea58ce3e5111212e2f010

Acknowledgement:

To learn more about developing apps on the Internet Computer, see the following documentation available online: