[Proposal] NEAR Paper Wallet

Idea

Paper Wallets are great way to onboard new users. On different events a printed in advance paper wallet with a very small amount of NEAR can be given to participants.
Used successfully by many communities (BCH etc.) from long time to do onboarding.
Paper wallets are also a great way to save funds off-chain (cold storage). Technically it is not a difficult task - just two QR codes with public and private key. However some sweeping functionality need to be added to the wallets.

More detail roadmap:

Paper wallet generator

  1. Generate public/private key pair
  • need introducing some randomness via keyboard or mouse moves
  • result is public/private keys pair
  1. Generate QR codes for both keys
  2. Ability to choose from several designs
  3. Ability to print batch of wallets
  4. Print the result

Wallet sweep component

  1. Use device camera to read QR code
  2. Use scanned private key to create a wallet
  3. Fund the wallet with the amount of stored NEAR
  4. Send the tokens to the target account (the wallet doing the sweep)
3 Likes

Very cool! This could be useful in lots of onboarding cases.

The wallet sweep component is a dApp?

Linking back to the Passed :white_check_mark: Proposal https://www.sputnik.fund/dao/nft-onboarding.sputnikdao.near/proposals/10

1 Like

Still working on the sweep idea. I’m very new to the NEAR world, so still searching my way. dApp is not a bad idea - very specialized and simple one: scan QR code, send funds.
Or it can be implemented as a JavaScript npm (the real sweep function), so it can be used from CLI apps. Something as near-sweep npm. And maybe an add-on (plugin…) in React from wallet . near . org. Useful (maybe) libraries:

  • react-qr-reader - will provide reading QR codes with the device camera. Nothing NEAR specific. Should work without changes.
  • bch-token-sweep - BCH implementation of sweeping - can be modified for NEAR keys usage
2 Likes

Either approach would be interesting:

  • dApp will make for a better demo and is closer to seeing use from end users.
  • JS lib sets the stage for more projects to use the functionality.

What are the advantages to onboarding with a paper wallet VS linkdrop / nearnames / redpacket?

If being used for cold storage, have you taken staking into consideration?

1 Like

Not familiar with linkdrop / nearnames / redpacket in detail, but they all seem like pre-recorded one-time payments. Paper wallet on the other hand is more like a real wallet - it can also accept payments. What this give us:

  • dynamic funding:
    • the event participants can get an empty or very small amount paper wallet at the beginning of the event , but receive more tokens on completing some tasks - after every workshop, etc.
    • they can bring the same paper wallet on the next event - continuous engagement
    • when onboarding random people, deciding the right amount for the specific case “on the fly” - like the guy/gal - more tokens
  • emergency usage
    • it is always a good idea to have a paper wallet in your pocket - forgot your phone, your phone battery is down - still can accept a payment
    • it is always a good idea to have a paper wallet with a small amount of tokens in your pocket (hm, here linkdrop made on QRcode maybe will be ok) - so you can pay your restaurant bill after you drop your phone in the toilet :wink:

Staking… still don’t know how is it implemented in NEAR protocol… If it requiring some action from the wallet owner after the wallet creation, it will be out of the paper wallet scope of use.
The whole idea of the paper wallet as cold storage is: you print it once, fund it and bear it in your back yard. If you can get your staked tokens after you sweep the wallet back, then maybe staking is also ok.

1 Like

The first approximation of the code is available in GitHub repository. Documentation and example usage provided.
Created also NPM package for an easy install.

Still no QR codes. Only CLI commands for create, sweep and delete the paper wallet.

Question to admins: Can (and how) I apply for more funds? The reward for the idea was 10 NEAR, but for a repository with code - 40 NEAR. Is it possible to apply for that reward?

3 Likes

Yes, you can definitely submit for 10 NEAR for the ideation and you can also submit for 40 NEAR for the github repo! If you would like to do a presentation (20 NEAR) or video (30 NEAR), you are more than welcome to get those done as well, but it is not necessary.

1 Like

New code version (v0.1.1) with some exciting changes:

  • Using external storage for wallet creation - allows me to start working on browser usage. The current file storage can be replaced with browser local storage one - keyStores.BrowserLocalStorageKeyStore()
  • examples/create_wallet.js will also print a nice, big QR code on the console with a link for wallet additional funding (redirecting as usual “Receive” QR code to the web wallet site)

npm package is also updated to v0.1.1

2 Likes

I’ve given a thumbs up over on the proposal for the repo.

approved at nft-onboarding.sputnikdao.near/proposals/23

Looking forward to seeing this demo’d / presented!

2 Likes

A small progress report and a summary of the work done until now.

Two applications created:

1.) CLI paper wallets generator (OSS, GitHub repository)

  • Contains an npm package, which can be used from other applications. Working well with CLI application (file-based storage). Still cannot make it work with browser local storage.
  • 3 simple example scripts to create, sweep and delete paper wallets (see the examples/ directory). Usage:
node ./examples/create-wallet.js -a 2
node ./example/sweep-wallet.js -w paper-xxxxx.aaa.testnet -r other_user.testnet
node ./examples/delete-wallet.js -w paper-xxxxx.aaa.testnet

More usage documentation is provided in the GitHub repository.

The result from these scripts is a single JSON file with format:

{
  "accountId": "paper-xxxxxx.aaa.testnet",
  "privateKey": "oziip........xhg"
}

Not very exciting, except maybe for CLI nerds, but a great way to prototype new designs: create the JSON file and feed it to some GUI application to create QR codes and some fancy wrapping art.

  1. Web paper wallet generator as React SPA (OSS, GitHub repository)

This one has pretty much all needed functionality implemented - create wallets, sweep wallets, show QR codes, print wallets.

!!! Live application is deployed on IPFS for everybody to try it. !!!

More documentation is provided in the GitHub repository, but the short story is:

  • Login button - Login to the application (NEAR wallet approval)
  • Create new button - enter initial funding amount and create a paper wallet (NEAR wallet approval)
  • Show button - will show the two QR codes - public and private. You can also Print the wallet from here
  • Sweep - because this requires NEAR wallet changes, at the moment scanning QR code and sweeping is impossible. That’s why there is this Sweep button - enter the receiver of the funds (can send them to yourself) and sweep the whole amount.

Next steps:

  • create a video with applications presentation in Loom or on YouTube and apply for the 30 NEAR award
  • If there is still time, create a very simple stand-alone sweeper application:
    • Get the receiver address
    • Scan the private QR code - get wallet account id and private key from there
    • Sweep the funds and send them to the receiver.
2 Likes

More updates: Created stand-alone NEAR paper wallets sweeper application.

!!! Live application is deployed to IPFS for everybody to try it. !!!

Just put the account ID, you want to send the funds to, scan the secret QR code on the paper wallet and send the funds.

With this the project is fully functional - create wallets, print them, sweep them!

Next step - presentation and video.

2 Likes

loving these updates :slight_smile: thanks for sharing them in the createabse telegram as well so we can follow along.

1 Like

Created a short Loom presentation to demonstrate both Generator and Sweeper web applications. Applying for the video (30 NEAR) reward on sputnik.fund.

1 Like