(Also includes fixes for bls-wallet-clients... guessing there was a bad merge involved previously.)
Adds ERC20 expander that encodes transfers in about 20 bytes plus:
1 byte to indicate the choice of expander
shared signature bytes
Supports multiple actions and the other ERC20 methods (approve, transferFrom, mint).
Example:
0f - 0x0f = 0b1111 bit stream:
- 1: Use registry for BLS key
- 1: Include a tx.origin payment
- 1: Use registry for ERC20 address
- 1: Use registry for recipient address
000000 - Registry index for sendWallet's public key
00 - nonce: 0
0bda28 - gas: 92,483
02 - two actions
000000 - Registry index for ERC20 address
00 - transfer
000002 - Registry index for recipient address
9100 - 0.1 MCK (amount/value)
6d00 - Pay 0.000005 ETH to tx.origin
Improvements that could be made for super-optimized transfers:
Optimize specifically for transfer
Require registries, removing the need for a bit stream
Use a fixed gas value
Use a dedicated ERC20 registry, allowing a single byte for popular currencies (and 2 bytes for all but the most obscure currencies)
Use a fixed tx.origin reward (or call contract that computes an appropriate reward)
This would get us down to about 11 bytes.
How can these changes be manually tested?
yarn test
Does this PR resolve or contribute to any issues?
Resolves #576
Checklist
[x] I have manually tested these changes
[x] Post a link to the PR in the group chat
Guidelines
If your PR is not ready, mark it as a draft
The resolve conversation button is for reviewers, not authors
What is this PR doing?
(Also includes fixes for bls-wallet-clients... guessing there was a bad merge involved previously.)
Adds ERC20 expander that encodes transfers in about 20 bytes plus:
Supports multiple actions and the other ERC20 methods (approve, transferFrom, mint).
Example:
Improvements that could be made for super-optimized transfers:
This would get us down to about 11 bytes.
How can these changes be manually tested?
yarn test
Does this PR resolve or contribute to any issues?
Resolves #576
Checklist
Guidelines
resolve conversation
button is for reviewers, not authors