Skip to content

Instantly share code, notes, and snippets.

View Jropp's full-sized avatar

Jason Ropp Jropp

  • Ummm Software
  • Goshen, IN
View GitHub Profile
@Jropp
Jropp / WalletAssociation.md
Last active November 2, 2023 17:03
How to associate a user with a wallet

Overview

In order to associate a web2 user account with a Web3 wallet, we need a way for the database to provide a challenge that the web2 user must answer via web3.

Here is my very simple solution.

  1. Api creates a unique nonce to an authorized user who has provided an EVM wallet address. This hash is stored with an expiration in the Db and returned to the client.
  2. The client immediately initiates a transaction for the user to sign with the nonce as an argument to the smart contract function. This is sent to the WalletAssociation smart contract address.
  3. The code packages the nonce with msg.sender and emits an event.

Today is my last day. And today might be one of your first. I have been told my time here was successful and helpful, so I thought I would pass on a couple of the things I've learned that might be helpful for you as you work through your first years as a developer. There's not enough time to say everything, so I'll just list a couple.

Turn Yourself In

There is a great temptation to appear smart and confident in any field, in software this temptation is compounded by imposter syndrome, that nagging feeling that you don't actually belong here. The fear is that as soon as you are found out, you will get the boot out the door.

While a small dose of this dread can keep you on your toes, it can quickly become overwhelming and start to kill your enjoyment and productivity. And then the shame of feeling inadequate compounds with the shame of not getting any work done.

My solution to this problem is to continually turn myself in, to find every opportunity I can to own a mistake when I want to hide, say I don'

What Is Working

Redirect from Shopify to my Express App

When I click the button to start the install of my sales channel on my test store it appropriately hits my express app /install endpoint:

app.get('/install', (req, res) => {
  const {shop} = req.query;
  const api_key = APP_API_KEY;
 const nonce = uuidv4();
import { PolymerElement, html } from "@polymer/polymer/polymer-element.js";
import "@polymer/polymer/lib/elements/dom-if";
import "@polymer/polymer/lib/elements/dom-repeat";
class SampleCustomElement extends PolymerElement {
static get template() {
// anything inside this template literal string gets appended to the dom as html
return html`