Page MenuHomePhabricator

[Cashtab] Building txs in sendXec with bitcoinjs-lib bitgo wrapper
AbandonedPublic

Authored by bytesofman on Dec 23 2022, 14:37.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Diff implements transaction building in the sendXec function using the @bitgo/utxo-lib library, a BitGo maintained wrapper of bitcoinjs-lib

This diff involved experiments to get bitcoinjs-lib to work straight-up. This failed as I could not get the tiny-secp256k1 library to work in React, despite their provided example at https://github.com/bitcoinjs/tiny-secp256k1/tree/master/examples/react-app

Bitgo evidently had a similar issue and uses the Noble library.

The Bitgo library added eCash support ~5 months ago. The library itself is well maintained and used in production by many enterprises. Imo it's a better starting point than the current state of ecashjs-lib, which is forked from bitcoincashjs-lib.

Test Plan

N/A, this diff is a proof of concept. Actual implementation will be cleaned up.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
trying-bitcoinjs-lib
Lint
Lint Errors
SeverityLocationCodeMessage
Errorweb/cashtab/src/components/Send/Send.js:42ESLINTno-unused-vars
Errorweb/cashtab/src/utils/cashMethods.js:176ESLINTetc/no-commented-out-code
Unit
No Test Coverage
Build Status
Buildable 21670
Build 42980: Build Diffcashtab-tests
Build 42979: arc lint + arc unit

Event Timeline

Diff is a proof of concept. Will be abandoned when cleaner implementation is landed.

Tail of the build log:

npm WARN EBADENGINE   package: 'postcss-preset-env@7.8.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-pseudo-class-any-link@7.1.6',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-selector-not@6.0.1',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32

> cashtab@1.0.0 prepare
> cd ../.. && husky install web/cashtab/.husky

husky - Git hooks installed

added 1787 packages, and audited 1788 packages in 27s

237 packages are looking for funding
  run `npm fund` for details

2 critical severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New major version of npm available! 7.7.6 -> 9.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
npm notice Run `npm install -g npm@9.2.0` to update!
npm notice 

> cashtab@1.0.0 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

[eslint] 
src/components/Send/Send.js
  Line 42:19:  'sendXecNewTxBuilder' is defined but never used  no-unused-vars

Search for the keywords to learn more about each error.


Build cashtab-tests failed with exit code 1