Integrate Web3Auth with Hyperledger Fabric

I want to use Web3Auth to integrate it with Hyperledger Fabric. For this purpose I need to sign a transaction or message without applying chainId in the signature. here is the code sample to sign a transaction:

const elliptic = require(‘elliptic’);
const { KEYUTIL } = require(‘jsrsasign’);

const privateKeyPEM = ‘<The PEM encoded private key>’;
const { prvKeyHex } = KEYUTIL.getKey(privateKeyPEM); // convert the pem encoded key to hex encoded private key

const EC = elliptic.ec;
const ecdsaCurve = elliptic.curves[‘p256’];

const ecdsa = new EC(ecdsaCurve);
const signKey = ecdsa.keyFromPrivate(prvKeyHex, ‘hex’);
const sig = ecdsa.sign(Buffer.from(digest, ‘hex’), signKey);

// now we have the signature, next we should send the signed transaction proposal to the peer
const signature = Buffer.from(sig.toDER());

How can I achieve it from Web3Auth? is there any way for customization?



Originally posted by: hnamzian

Check the discussion at: https://github.com/orgs/Web3Auth/discussions/1349