Closed iam-dev closed 6 months ago
The correct network id to use with devnet is 'testnet', so we already support devnet.
The network id is supposed to prevent replays of testnet transactions on mainnet. So it only needs to distinguish between testnet and mainnet, not what kind of testnet (the custom option is intended to support alternative mainnets, like L2s)
This is misleading because auro wallet gives back devnet as connected network, which mean mina-signer will error using devnet
const requestedNetwork = await (window as any)?.mina?.requestNetwork().catch((err: any) => err);
My use case will be:
@iam-dev I guess the answer is, requestedNetwork
returned by Auro wallet just doesn't have the same meaning as the network
parameter of mina-signer, that's why you can't plug in one of them into the other.
In the case of mina-signer, it just wants to know whether this is a testnet or a mainnet, and nothing else. We should document that better.
Adapting your use case is easy: If Auro returns something else than "mainnet"
, use "testnet"
in mina-signer.
@iam-dev another thing to note. If you aren't signing transactions, but just use signFields()
or verifyFields()
from mina-signer
, to handle signatures which are consumed by zkapps, then the network
parameter doesn't matter at all. It won't be used.
Our zkApp verify this signature using mina-signer
@iam-dev finally, I hope it's obvious but just to make sure: mina-signer is not creating constraints and can't be used to verify a signature as part of a zkApp @method
It's clear for me now, I had a backend working that validate signature to signin with Web3, which also uses mina-signer. I solved it with a workaround using "testnet" and works like a charms. I guess this is a workable workaround
Thanks @mitschabaude for clearing this up for me
The ability to use devnet using mina-signer