Giter VIP home page Giter VIP logo

Comments (30)

vm avatar vm commented on May 18, 2024 3

I'll attempt adding walletconnect. I'm a bit new to Rust/dapps, so may post some questions!

from foundry.

numan avatar numan commented on May 18, 2024 2

from foundry.

onbjerg avatar onbjerg commented on May 18, 2024 2

I'm still unsure on the abstraction, we already have a working abstraction for signers in ethers-rs, it's just a matter of implementing them there and/or "flipping the switch" here 😄

from foundry.

vm avatar vm commented on May 18, 2024 1

i'm going to pause on this for now, struggling to do this without understanding solidity contracts a bit more. if someone wants to tackle this feel free, i'll grab a different issue once I'm up to speed.

from foundry.

gakonst avatar gakonst commented on May 18, 2024 1

It'd also be sick if we added https://github.com/gakonst/ethers-fireblocks

from foundry.

numan avatar numan commented on May 18, 2024 1

@gakonst walletconnect seems a little more involved. Would I have to implement a signer here?

https://github.com/gakonst/ethers-rs/tree/master/ethers-signers/src/

from foundry.

numan avatar numan commented on May 18, 2024 1

from foundry.

gakonst avatar gakonst commented on May 18, 2024 1

An RPC signer with some access control in ethers-rs would be like a software HSM. Have thought about it before and like it as an idea. Should be simple.

from foundry.

prestwich avatar prestwich commented on May 18, 2024 1

Would it do any harm to change the AwsSigner to own its KmsClient property?

No, it's fine. It's actually been on my to-clean list for a while. Initially wrote it this way to save resources when using several AWS keys in the same bin, but later dug in and figured out that KmsClient holds a rusoto_core::Client which wraps an Arc containing the actual request dispatch system. It won't add significant overhead to change to an owned KmsClient, as it's always cheap to clone

from foundry.

jatkz avatar jatkz commented on May 18, 2024 1

@prestwich perhaps it's something I could look into if its alright?

from foundry.

gakonst avatar gakonst commented on May 18, 2024
  • trezor
  • walletconnect

from foundry.

numan avatar numan commented on May 18, 2024

I'll give walletconnect a go since nobody else is currently working on it.

from foundry.

gakonst avatar gakonst commented on May 18, 2024

You can also implement in a separate crate like ethers-fireblocks does it, you just need to implement the ethers::signers::Signer trait.

from foundry.

gakonst avatar gakonst commented on May 18, 2024

https://github.com/nlordell/walletconnect-rs FYI

from foundry.

ameyabhat avatar ameyabhat commented on May 18, 2024

Is this still open? Interested in having a go at this if no one else is

from foundry.

numan avatar numan commented on May 18, 2024

from foundry.

ameyabhat avatar ameyabhat commented on May 18, 2024

go for it!

Sweet, thanks! Is there a branch you were working on that I should take a look at / work off or should I start from scratch?

from foundry.

OliverNChalk avatar OliverNChalk commented on May 18, 2024

Could we not enable arbitrary signing via a simple local REST/JSON-RPC service? e.g. something like:

/sign-eth
-> raw_unsigned_tx
<- raw_signed_tx

This would for allow users to forward the raw_unsigned_tx to their favorite key management tool and then return the signed tx for validation & submission. My personal use case is forwarding the raw_unsigned_tx to fireblocks for signing, so we would need to allow for slow response times from the signer-service (we could go for a callback/polling approach instead of a single long-lasting REST call).

from foundry.

onbjerg avatar onbjerg commented on May 18, 2024

I don't think these are handled by wallets like Ledger/Trezor? I might be wrong here

from foundry.

OliverNChalk avatar OliverNChalk commented on May 18, 2024

I think you're right, wallets will probably steer away from eth_sign due to the risk that a user signing a message will actually sign a valid ethereum tx. In this case the interface would look like:

/eth_signTransaction
-> (legacy | eip-1559 | eip-2930)
<- encoded_transaction

/eth_accounts
<- address[]

This should allow users to fairly simply host a local proxy to forward the requests for signing to their various signing mechanisms. It would also return the accounts the signing mechanism has access to, this can be used by forge's wallet management logic.

from foundry.

OliverNChalk avatar OliverNChalk commented on May 18, 2024

Fair enough, the only arguments would be the ease of implementation (and/or not needing to expose config to foundry). That said, one could always implement a "localhost signer" in ethers-rs and flip the switch

from foundry.

jatkz avatar jatkz commented on May 18, 2024

Hi I wanted to try and tackle the aws kms implementation but I ran into an issue I wasn't sure the best path forward would be.

From my understanding the AwsSigner uses a reference to a borrowed KmsClient.
https://github.com/gakonst/ethers-rs/blob/master/ethers-signers/src/aws/mod.rs#L48

When I try to pass the signer to an async function such as cast_send it throws an E0597 error.
https://github.com/foundry-rs/foundry/blob/master/cli/src/cmd/cast/send.rs#L211

What would you suggest to proceed on this ?

For example I could create a separate cast_send function for the aws signer but wasn't sure if there is a better way.

from foundry.

gakonst avatar gakonst commented on May 18, 2024

Can you please share your branch?

from foundry.

jatkz avatar jatkz commented on May 18, 2024

Can you please share your branch?

oh yes,
https://github.com/jatokz/foundry/tree/aws_kms

from foundry.

jatkz avatar jatkz commented on May 18, 2024

sorry I misunderstood what the issue was. The error I get happens when trying to create the Cast struct because the impl requires
impl<M: Middleware> Cast<M> where M::Error: 'static,
Since AwsSigner borrows kmsClient it raises the error:
argument requires that kms is borrowed for 'static

Would it do any harm to change the AwsSigner to own its KmsClient property?

from foundry.

gakonst avatar gakonst commented on May 18, 2024

Defer to @prestwich , im Ok with that

from foundry.

prestwich avatar prestwich commented on May 18, 2024

ya, should be really easy

from foundry.

odyslam avatar odyslam commented on May 18, 2024

@gakonst This issue should be marked as done as be closed, no?

from foundry.

lucas-manuel avatar lucas-manuel commented on May 18, 2024

Close-able? @mds1

from foundry.

mds1 avatar mds1 commented on May 18, 2024

seems closable, if anyone disagrees lmk and I'll reopen

from foundry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.