Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ryanberckmans/731710cc0d050b4f4c3930ebbb45be28 to your computer and use it in GitHub Desktop.
Save ryanberckmans/731710cc0d050b4f4c3930ebbb45be28 to your computer and use it in GitHub Desktop.
Selling jobs ads for Week in Ethereum News with ecommerce on ethereum

Selling jobs ads for Week in Ethereum News with ecommerce on ethereum

Motivation

Week in Ethereum News features crypto job ads and allows readers to buy these ads. Buying a job ad is a manual process that requires correspondence between the customer and Evan. Below, we show an ethereum-based ecommerce solution for an Amazon-like UX and hopefully less work processing these orders for Evan.

Proposed new UX when buying a job ad

Week in Ethereum News gains a new "Place a Job Ad" link to https://place-job-listing.evan.ethereum.eth.link/

When the user clicks that, it loads an IPFS app:

  • just one page, no routes/navigation
  • a radio box to select payment in DAI, USDC, or ETH
  • auto-filled payment amount of $250 of that token using current on-chain price
  • says "List your job in Week in Ethereum News - $250 per line"
  • connect wallet button
  • "pay now" button that starts the transaction. Disabled with a warning if the user doesn't have enough tokens of the selected type. Eg. if the radio selection is USDC and I have 245 USDC in my wallet, that's less than 250, so pay now is disabled
  • 1-liner text box for them to enter job desc. Has instructions "~75 character limit including spaces"
  • page is hardcoded to send money to evan.ethereum.eth
  • page monitors the transaction while it's confirming
  • after the transaction confirms, it says, "thank you! In most cases, your ad will appear in the next edition of Week in Ethereum News", and has a button to "place another job listing" (recruiter mode)
  • a centralized backend detects the new purchase and sends an email to Evan

Discussion

Why not just use Shopify or Paypal?

If Shopify, PayPal, or Amazon add/expand on web3 wallets as a payment method, why not just use them instead of an open solution?

Well, prior to ethereum, the web couldn't handle money natively. Now that the web can handle money natively, we shouldn't expect centralized solutions to go away because they do many useful things beyond payments. (If anything, Amazon accepting crypto payments may make them stronger and richer as they can disintermediate payment gateways.)

What's new now is that ethereum enables ecommerce platforms to exist without merchants needing to have heavy relationships with those platforms or payment providers.

An open, modular, FOSS, ethereum-based ecommerce platform may be competitive on the following customer needs/segments:

  • for merchants with simple needs, lighter-weight than Shopify/PayPal. A few clicks and you can sell something online. No login required. Like craigslist but your own storefront
  • for crypto natives, the platform is designed around the strengths and peculiarities of web3 wallets
  • for digital goods/services, the platform is optimized for digital fulfillment, with no need to support mailing physical merchandise to customers. Great fit for ethereum's global nature. Eg. digital art/NFTs, telehealth/paid video chat sessions, or digital advertising
  • for communities, smart contracts enable new forms of purchasing, such as "this new photo album will unlock for everybody when our community collectively donates/pays $10k"-- Kickstarter for collective buying of digital goods. Apparently, Vitalik used to sell his bitcoin magazine articles this way.

For the job ad UX above, how does it work on-chain?

There are at least two options:

Option one, the storefront uses no dedicated smart contract -- it's just a normal 250 USDC transfer, and the 75-char job ad is not included on-chain. In this case, the centralized backend must efficiently monitor the USDC log stream for $250 payments to Evan and take secure receipt of the 75-char job ad from the client. The pro of this solution is that a lack of dedicated smart contract for the storefront may make it cheaper for anybody to make a storefront. One con is it introduces a workflow element for the customer's web browser, because the storefront must somehow hook into the centralized service to say "hey, I just sent Evan $250. Here's the tx id and my 75-char job ad for you to email Evan"

Option two, the storefront uses some kind of dedicated smart contract. It might be a smart contract bespoke to that storefront, which is expensive and unpreferable, or a single smart contract for all storefronts on this platform, which makes it cheap to reuse the same smart contract for future storefronts. A pro of having a dedicated smart contract is that the user's order details (in Evan's case, the 75-char job desc) is stored on-chain where it can be reliably retrieved by the centralized backend, removing any need for the user's web browser to send information directly to the centralized backend.

How do refunds work?

Refunds are excluded from this prototype and must be handled manually.

How does order fulfillment work?

Shopify does a lot more than just payment -- it keeps track of orders, shipping, records, taxes, etc. How does this solution handle that stuff?

Well, it doesn't. At this point, the ecommerce platform sends Evan an email for a new order, then Evan must somehow keep track of which ads have been approved, placed, etc., and rely on other tools (eg. Zerion) to do the accounting for his ads income.

How does the centralized backend work?

The design space for the centralized backend is very interesting: how general is it? Is it specific to ecommerce? Does it bundle other ecommerce tools, eg. tools for taxes/accounting? Who owns it? How does the centralized backend authenticate the sending of emails/sms and avoid spam?

Here's a design for a general-but-narrow backend that sends an email when requested by the creator of any on-chain transaction. Here's how the API might work:

  • any user can call the endpoint sendEmail(txId, signature, emailTo, emailSubject, emailBody)
  • the centralized service then sends the requested email iff txId is an on-chain transaction for which no email has been sent yet and signature proves that the user who called the sendEmail API is in possession of the private key used to create the tx
  • this centralized service could act as a quasi-public-good, where anyone in the ethereum community could use it to send emails. There is no service revenue at this point
  • spam is somewhat handled automatically because only confirmed transactions can be used to send emails, and those cost money, filtering out most spammers. A bit like earn.com
  • for Week in Ethereum News, the API call would be made by the user's browser after their Job Ad buy transaction confirmed. Eg. an API call like sendEmail("0x123", "abc", "thecryptonewspodcast@gmail.com", "New Job Ad", "IcecreamDAO is hiring a web developer!! Stop by our discord.")

afaik, no service currently exists to easily send an email as a result of an ethereum transaction. Ethereum Push Notification Service (EPNS) is promising but in the design stage and not ready to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment