Coder Social home page Coder Social logo

Comments (8)

jxom avatar jxom commented on September 24, 2024 4

FWIW, 6492 is built into Viem's SIWE implementation. Would highly recommend using it. :D

from siwe.

Ivshti avatar Ivshti commented on September 24, 2024

here's how to implement ERC-6492: AmbireTech/signature-validator#3

or the signature-validator library can be used directly

Alternatively, if you don't wanna use the library, you have to rewrite this method

export const checkContractWalletSignature = async (
message: SiweMessage,
signature: string,
provider?: providers.Provider | Signer
): Promise<boolean> => {
if (!provider) {
return false;
}
const walletContract = new Contract(message.address, EIP1271_ABI, provider);
const hashMessage = utils.hashMessage(message.prepareMessage());
const res = await walletContract.isValidSignature(
hashMessage,
signature
);
return res == EIP1271_MAGICVALUE;
};

to do this: https://github.com/AmbireTech/signature-validator/pull/3/files#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R36-R49

variables are 100% equivalent but the names are different
SIWE hashMessage -> ambire finalDigest
SIWE message.address -> ambire signer
signature is signature in both places

if you don't feel comfortable with copy pasting the magic contract, you can compile it from source by doing solc contracts/DeploylessUniversalSigValidator.sol --bin in the signature-validator repo

from siwe.

obstropolos avatar obstropolos commented on September 24, 2024

Taking a look at this and also very excited for AA and Sign-In with Ethereum. We'll take a look at what compatibility would look like here - and thank you for the example @Ivshti !

from siwe.

jd1900 avatar jd1900 commented on September 24, 2024

Not news on this?

from siwe.

Ivshti avatar Ivshti commented on September 24, 2024

here's something that may help integrating ERC-6492: #153 (comment)

from siwe.

wminshew avatar wminshew commented on September 24, 2024

is there any kind of timeline/roadmap available on when SIWE will support eips 4337/6492?

from siwe.

Ivshti avatar Ivshti commented on September 24, 2024

hey @obstropolos, any update?

from siwe.

0xTranqui avatar 0xTranqui commented on September 24, 2024

just started working on a 6492 sign-in implementation and also find myself in this thread. really want to use SIWE but current lack of support means I need to fall back to use ambire tech or viems verifying libraries, which are great, but techincally dont match the SIWE spec. would love to see this

from siwe.

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.