Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ethereum-compatible wallet (WIP) #56

Closed
wants to merge 63 commits into from
Closed

Conversation

dckc
Copy link
Collaborator

@dckc dckc commented Dec 14, 2018

We can use metamask in place of RSign if we make an analog to BasicWallet that uses RLP (recursive length prefix) in place of protobuf to serialize the signed parameters.

I think I have the tedious details prototyped:

https://github.com/dckc/RChain-API/blob/ethWallet/src/rlp.rho

https://github.com/dckc/RChain-API/blob/ethWallet/src/ethSig.rho

ethSig includes findOrCreateWallet, a sort of "hitching post".

cc @JoshOrndorff @cboscolo @edeykholt

depends on some ByteArray methods that didn't quite get into 0.8: rchain/rchain#1968

dckc added 30 commits November 15, 2018 19:49
  - integrationTest: no more need to use a public name to get to private names
    - change integrationTest to async function
    - { RNode, RHOCore } are powerless; OK to import at module scope*
  - phloPrice, phloLimit are plain numbers now*
  - fix type of listenForDataAtName(par) arg

* please excuse the lack of atomic commits for these
Protobuf returns int64 as string, presumably because js numbers can
only handle 53 bits.
I haven't decided to represent JSON { "x": 1 } as rholang {"x":1}
instead of @#x"!(1) yet, but when going back the other way, I see
no reason not to support both.
... using the registry and previewPrivateName
The ids from `previewPrivateNames` had to be wrapped up to make a
channel to listen on. `previewPrivateChannels` does the wrapping.
`previewPrivateIds` is more clear about what it returns.
  - Don't swallow exceptions in `integrationTest()`. Have the caller
    handle them.
  - factor out defaultPayment
  - re-use deployData between preview and doDeploy
  - refactor xPar as idToPar
Only works if proxy is patched.
  - refine documentation of toJSData / fromJSData
  - unit tests
esp. for use in signing wallet transactions

IOU docs, tests
  - never mind mapping GPrivate back to in-scope names
  - no need to deploy the genesis contracts ourselves
dckc added 24 commits November 26, 2018 02:43
  - register rlp
  - uses stupid Rholang tricks to handle bytes
... rather than stupid Rholang tricks
 - hoist rlp import so verifySignature can run more than once :)
 - move test cases to the bottom
I found a nice way to factor encode, but decode is messy enough that
after only a few days, I can hardly read it.
  - compute signature using rlpEncode, keccak256Hash
uses findOrCreateWallet, EtherWallet
  - decode nonce, value
  - factor our sendIt
@dckc
Copy link
Collaborator Author

dckc commented Dec 18, 2018

@edeykholt, @cboscolo and I went over this tonight: wallet Zoom meeting recording

Of note:

metamask doesn't do offline transactions after all: MetaMask/metamask-extension#3475

maybe the thing to build is a proxy that speaks the web3 HTTP/JSON interface (e.g. eth_sendrawtransaction), takes the transactions from metamask and forwards them to RChain.

See also:
https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26

@dckc
Copy link
Collaborator Author

dckc commented Jan 14, 2019

subsumed by #57

@dckc dckc closed this Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant