rchain-community / rchain-api

An API for rchain dapps to communicate with the blockchain
Other
22 stars 12 forks source link

wallet based on ethereum transaction signatures #55

Closed dckc closed 5 years ago

dckc commented 5 years ago

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

It relies on some new ByteArray methods, a couple of which I haven't written yet: https://github.com/rchain/rchain/pull/1968

It would also depend on a "hitching post" for "find or create the eth-style wallet for eth address A".

cc @JoshOrndorff @cboscolo

dckc commented 5 years ago

I think the ByteArray methods are complete: 9af5fa4 in https://github.com/rchain/rchain/pull/1968

Interpolation on ByteArray makes the DER encoding stuff much nicer: bb08e15

dckc commented 5 years ago

ethSig.rho has the findOrCreateWallet hitching post now (9631495)

sendTransaction can find the wallet to send from and have it verify the signature and find the wallet to send to. It can't yet transfer the funds because I haven't integrated real purses.

A little more rlp decoding (for nonce, value) is also TODO.

cc @edeykholt

dckc commented 5 years ago

for follow-up, see #56