diff --git a/did/section.d.js b/did/section.d.js index 6759ccd..fe181a7 100644 --- a/did/section.d.js +++ b/did/section.d.js @@ -55,6 +55,16 @@ did.Section.prototype.bls12_381; */ did.Section.prototype.secp256k1; +/** + * The Schnorr signatures kept as a list of 64 bytes compact signatures, + * sorted in lex order. + * + * Each signature must be from a different (valid) signer node. + * + * @type {Array} + */ +did.Section.prototype.minaSchnorr; + /** * Contains the fundamental identification data of a person such as * name, date of birth, national id etc. diff --git a/did/section.js b/did/section.js index 23ec7b6..03fd4f3 100644 --- a/did/section.js +++ b/did/section.js @@ -63,7 +63,7 @@ const hash = (sectionName, section) => { } } /** @const {!Set} */ - const notHashed = new Set(["secp256k1", "bls12_381", "commitmentR"]); + const notHashed = new Set(["secp256k1", "minaSchnorr", "bls12_381", "commitmentR"]); return keccak256( KIMLIKDAO_HASH_PREFIX + JSON.stringify(section, Object.keys(section).filter((x) => !notHashed.has(x)).sort()) @@ -121,7 +121,7 @@ const signSection = (sectionName, section, commitment, signatureTs, privateKey) const d = BigInt("0x" + hash(sectionName, section)); let { r, s, yParity } = sign(d, privateKey); if (yParity) s += (1n << 255n); - section.secp256k1 = [evm.uint256(r) + evm.uint256(s)]; + section.secp256k1 = section.minaSchnorr = [evm.uint256(r) + evm.uint256(s)]; } export {