You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Release Notes / Change-Logs
* 1.24.0
#### Calidus Pool-Key updates
- A new path shortcut `--path calidus` was added to the `keygen` function
- Using the new calidus path also switches the output description of skey/vkey files to be `Calidus Pool Signing Key` and `Calidus Pool Verification Key`
- Using the new calidus path also outputs the new `Calidus-ID` in hex and bech format with the `--json-extended` flag
- The `sign --cip88` function to generate Calidus Key registration data now also outputs the new `Calidus-ID` in hex and bech format. In addition it also outputs the `Pool-ID` in bech format.
- The `verify --cip88` function to verify Calidus Key registration data now also outputs the new `Calidus-ID` in hex and bech format. In addition it also outputs the `Pool-ID` in bech format.
#### Other updates
- A new internal function was created to convert maps in to json format, this is simplifying various inputs and output in the future
- The key7 entry for the CIP88v2 format was renamed from `update-key` to `calidus-key`
boolean: ['help','version','usage','json','json-extended','cip8','cip30','cip36','cip88','cip100','deregister','jcli','bech','hashed','nopayload','vkey-extended','nohashcheck','replace','ledger','trezor'],//all booleans are set to false per default
20
+
boolean: ['help','version','usage','json','json-extended','cip8','cip30','cip36','cip88','cip100','deregister','jcli','bech','hashed','nopayload','vkey-extended','nohashcheck','replace','ledger','trezor','include-maps'],//all booleans are set to false per default
21
21
//adding some aliases so users can also use variants of the original parameters. for example using --signing-key instead of --secret-key
console.log(` ${Dim}optional data/payload/file if not present in the COSE_Sign1 signature${Reset}`);
167
167
console.log(` [${FgGreen}--address${Reset} "<path_to_file>|<hex>|<bech>"] ${Dim}optional signing-address to do the verification with${Reset}`);
168
168
console.log(` [${FgGreen}--nohashcheck${Reset}] ${Dim}optional flag to not perform a check that the public-key belongs to the address/hash${Reset}`);
169
+
console.log(` [${FgGreen}--include-maps${Reset}] ${Dim}optional flag to include the COSE maps in the json-extended output${Reset}`);
169
170
console.log(` [${FgGreen}--json${Reset} |${FgGreen} --json-extended${Reset}] ${Dim}optional flag to generate output in json/json-extended format${Reset}`);
170
171
console.log(` [${FgGreen}--out-file${Reset} "<path_to_file>"] ${Dim}path to an output file, default: standard-output${Reset}`);
171
172
console.log(` Output: ${FgCyan}"true/false" (exitcode 0/1)${Reset} or ${FgCyan}JSON-Format${Reset}`)
console.log(` Params: [${FgGreen}--path${Reset} "<derivationpath>"] ${Dim}optional derivation path in the format like "1852H/1815H/0H/0/0" or "1852'/1815'/0'/0/0"${Reset}`);
console.log(` ${Dim} --path cc-hot, --path pool, --path calidus${Reset}`);
212
214
console.log(` [${FgGreen}--mnemonics${Reset} "word1 word2 ... word24"] ${Dim}optional mnemonic words to derive the key from (separate via space)${Reset}`);
213
215
console.log(` [${FgGreen}--passphrase${Reset} "passphrase"] ${Dim}optional passphrase for --ledger or --trezor derivation method${Reset}`);
214
216
console.log(` [${FgGreen}--ledger | --trezor${Reset}] ${Dim}optional flag to set the derivation type to "Ledger" or "Trezor" hardware wallet${Reset}`);
@@ -460,6 +462,7 @@ function readAddr2hex(addr, publicKey) { //reads a cardano address from a file (
// VERIFY CIP8/30 FUNCTION -> coded as a function so it can be reused within other functions
604
613
functionverifyCIP8(workMode="verify-cip8",calling_args=process.argv.slice(3)){//default calling arguments are the same as calling the main process - can be modified by subfunctions
//generate the protectedHeader with the current values (the address within it might have been overwritten by a given one)
766
774
// alg (1) - must be set to EdDSA (-8)
767
775
// kid (4) - Optional, if present must be set to the same value as in the COSE_Key specified below. It is recommended to be set to the same value as in the "address" header.
if(payload_data_hex.length<=2000000){content+=`"payloadDataHex": "${payload_data_hex}", `;}//only include the payload_data_hex if it is less than 2M of chars
793
801
content+=`"isHashed": "${isHashed}",`;
794
802
if(Sig_structure_cbor_hex.length<=2000000){content+=`"verifyDataHex": "${Sig_structure_cbor_hex}", `;}//only include the Sig_structure_cbor_hex if it is less than 2M of chars
varcalidusIdHex=`a1${getHash(calidusPubKeyHex,28)}`;//hash the calidus publicKey with blake2b_224 (28bytes digest length) and add the prebyte a1=CalidusPoolKey
1464
+
varcalidusIdBech=bech32.encode("calidus",bech32.toWords(Buffer.from(calidusIdHex,"hex")),128);//encode in bech32 with a raised limit to 128 words because of the longer hash (56bytes)
//calculate the pool-id, which is just the hash of the pubKey
1469
1483
varpoolIdHex=getHash(pubKeyHex,28)
1484
+
varpoolIdBech=bech32.encode("pool",bech32.toWords(Buffer.from(poolIdHex,"hex")),128);//encode in bech32 with a raised limit to 128 words because of the longer hash (56bytes)
1470
1485
1471
1486
//get the --nonce parameter
1472
1487
varnonce=args['nonce'];
@@ -1515,19 +1530,15 @@ async function main() {
1515
1530
//compose the content for the output as JSON registration, extended JSON data or plain registrationCBOR
1516
1531
if(args['json']===true){//generate content in json format
case'CALIDUS': //path is --path calidus -> generate the calidusID and special description for the skey/vkey content
1995
+
varcalidusIdHex=`a1${getHash(pubKeyHex,28)}`;//hash the publicKey with blake2b_224 (28bytes digest length) and add the prebyte a1=CalidusPoolKey
1996
+
varcalidusIdBech=bech32.encode("calidus",bech32.toWords(Buffer.from(calidusIdHex,"hex")),128);//encode in bech32 with a raised limit to 128 words because of the longer hash (56bytes)
elseif(!payloadMap.get(1)instanceofArray||payloadMap.get(1)[0]!=1){console.error(`Error: PayloadMap key 1 (registraction-scope) is not an array or not of type pool-scope(1)`);process.exit(1);}
2552
2579
elseif(!payloadMap.get(3)instanceofArray||isNaN(payloadMap.get(3)[0])||payloadMap.get(3)[0]!=2){console.error(`Error: PayloadMap key 3 (validation method) is not an array and/or not set to [2] -> CIP-0008`);process.exit(1);}
2553
2580
elseif(isNaN(payloadMap.get(4))){console.error(`Error: PayloadMap key 4 (nonce) is not a uint number`);process.exit(1);}
2554
-
elseif(!Buffer.isBuffer(payloadMap.get(7))||payloadMap.get(7).length!=32){console.error(`Error: PayloadMap key 7 (update-public-key) is not a hex bytearray/buffer of length 32`);process.exit(1);}
2581
+
elseif(!Buffer.isBuffer(payloadMap.get(7))||payloadMap.get(7).length!=32){console.error(`Error: PayloadMap key 7 (calidus-public-key) is not a hex bytearray/buffer of length 32`);process.exit(1);}
2555
2582
2556
2583
//get the poolid from the scope=1 content and check that its a bytearray with the correct length
//generate the calidus-id in hex and bech format for the json-extended output
2654
+
varcalidusIdHex=`a1${getHash(calidusPubKeyHex,28)}`;//hash the calidus publicKey with blake2b_224 (28bytes digest length) and add the prebyte a1=CalidusPoolKey
2655
+
varcalidusIdBech=bech32.encode("calidus",bech32.toWords(Buffer.from(calidusIdHex,"hex")),128);//encode in bech32 with a raised limit to 128 words because of the longer hash (56bytes)
2656
+
2657
+
//generate the bech pool-id for the json-extended output
2658
+
varpoolIdBech=bech32.encode("pool",bech32.toWords(Buffer.from(scopePoolIdHex,"hex")),128);//encode in bech32 with a raised limit to 128 words because of the longer hash (56bytes)
Copy file name to clipboardexpand all lines: src/package.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "cardano-signer",
3
-
"version": "1.23.0",
3
+
"version": "1.24.0",
4
4
"description": "cardano-signer signs a given data(hex/text/file) with a signing key(hex/bech/file) or verify the signature via a public key(hex/bech/file). it can also produce a cip-8/cip-30/cip-36 conform payload signing/verification. can produce ed25519 keys from mnemonic for payment, staking, drep, constitutional commitee cold/hot keys, etc...",
0 commit comments