Page MenuHomePhabricator

[Cashtab, doc] Suppport empp raw push addition for bip21 and ALP sends
Needs ReviewPublic

Authored by bytesofman on Tue, May 13, 23:50.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Introduce new spec allowing an additional empp push to be specified in bip21 token sends (ALP only). Implement and test in Cashtab.

The use case we are solving for here is including arbitrary message data in a token transaction. This is important in cryptocurrency for onchain annotation of payments, or allowing a token payment to interact with an app.

This implementation covers an MVP use case: including a Solana address in a FIRMA payment to allow onchain redemption of Firma for USDT on the SOL network.

In this diff,

  • We define a spec
  • We modify the Send screen in Cashtab to support the new bip21 spec, either by entering a bip21 string into the "Address" field or by including a bip21 query string in the URL
  • We modify Cashtab-specific ALP output construction to optionally support a single additional user-specified output
  • We modify tx parsing to parse for this in ALP txs
  • We define a spec for encoding a SOL address in an EMPP push, and implement parsing this app action in Cashtab
Test Plan

Proofread spec. npm test in Cashtab. Can check it out at the test site: https://cashtab-local-dev.netlify.app/

e.g. go to https://cashtab-local-dev.netlify.app/#/send?bip21=ecash:qr8hdk8rxjc5nj6f450eth3nnslxa8k4gysrtyfxc5?token_id=0387947fd575db4fb19a3e322f635dec37fd192b5941625b66bc4b2c3008cbf0&token_decimalized_qty=1&empp_raw=534f4c304ebabba2b443691c1a9180426004d5fd3419e9f9c64e5839b853cecdaacbf745 and see this

image.png (445×1 px, 49 KB)

Parsed tx in history:

image.png (299×1 px, 29 KB)

Diff Detail

Repository
rABC Bitcoin ABC
Branch
spec-empp-bip21-msg
Lint
Lint Errors
SeverityLocationCodeMessage
Errorcashtab/src/opreturn/__tests__/index.test.js:132ESLINT@typescript-eslint/no-unused-vars
Errorcashtab/src/opreturn/index.ts:6ESLINT@typescript-eslint/no-unused-vars
Errorcashtab/src/opreturn/index.ts:17ESLINT@typescript-eslint/no-unused-vars
Errorcashtab/src/opreturn/index.ts:21ESLINT@typescript-eslint/no-unused-vars
Unit
No Test Coverage
Build Status
Buildable 33297
Build 66076: Build Diffcashtab-tests
Build 66075: arc lint + arc unit