From 84ff3bbb60140bb5c4324cf01f40e64f07da0dce Mon Sep 17 00:00:00 2001 From: Freddie Coleman Date: Mon, 21 Mar 2022 21:02:58 +0000 Subject: [PATCH 1/3] add bls12-381 to rosetta spec --- models/CurveType.yaml | 2 ++ models/SignatureType.yaml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/models/CurveType.yaml b/models/CurveType.yaml index 0900a26..8db3012 100644 --- a/models/CurveType.yaml +++ b/models/CurveType.yaml @@ -20,6 +20,7 @@ description: | * edwards25519: `y (255-bits) || x-sign-bit (1-bit)` - `32 bytes` (https://ed25519.cr.yp.to/ed25519-20110926.pdf) * tweedle: 1st pk : Fq.t (32 bytes) || 2nd pk : Fq.t (32 bytes) (https://github.com/CodaProtocol/coda/blob/develop/rfcs/0038-rosetta-construction-api.md#marshal-keys) * pallas: `x (255 bits) || y-parity-bit (1-bit) - 32 bytes` (https://github.com/zcash/pasta) + * bls12381: `G1 Point in compressed Zcash format (48 bytes)` (https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/04/) type: string enum: @@ -28,3 +29,4 @@ enum: - edwards25519 - tweedle - pallas + - bls12381 diff --git a/models/SignatureType.yaml b/models/SignatureType.yaml index a983b0a..6d0eebe 100644 --- a/models/SignatureType.yaml +++ b/models/SignatureType.yaml @@ -20,6 +20,8 @@ description: | * ed25519: `R (32-byte) || s (32-bytes)` - `64 bytes` * schnorr_1: `r (32-bytes) || s (32-bytes)` - `64 bytes` (schnorr signature implemented by Zilliqa where both `r` and `s` are scalars encoded as `32-bytes` values, most significant byte first.) * schnorr_poseidon: `r (32-bytes) || s (32-bytes)` where s = Hash(1st pk || 2nd pk || r) - `64 bytes` (schnorr signature w/ Poseidon hash function implemented by O(1) Labs where both `r` and `s` are scalars encoded as `32-bytes` values, least significant byte first. https://github.com/CodaProtocol/signer-reference/blob/master/schnorr.ml ) + * bls12381_basic_mpl: G2 Point in compressed Zcash format (96 bytes) - Basic Scheme + * bls12381_basic_mpl: G2 Point in compressed Zcash format (96 bytes) - Aug Scheme type: string enum: - ecdsa @@ -27,3 +29,5 @@ enum: - ed25519 - schnorr_1 - schnorr_poseidon + - bls12381_basic_mpl + - bls12381_aug_mpl From ae31b6bcec4f90ccff7e93c0199a54166579bcd7 Mon Sep 17 00:00:00 2001 From: Freddie Coleman Date: Mon, 21 Mar 2022 21:10:04 +0000 Subject: [PATCH 2/3] add bls12381 to api.json --- api.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api.json b/api.json index 4ea8e44..9309590 100644 --- a/api.json +++ b/api.json @@ -1370,14 +1370,15 @@ } }, "CurveType": { - "description":"CurveType is the type of cryptographic curve associated with a PublicKey. * secp256k1: SEC compressed - `33 bytes` (https://secg.org/sec1-v2.pdf#subsubsection.2.3.3) * secp256r1: SEC compressed - `33 bytes` (https://secg.org/sec1-v2.pdf#subsubsection.2.3.3) * edwards25519: `y (255-bits) || x-sign-bit (1-bit)` - `32 bytes` (https://ed25519.cr.yp.to/ed25519-20110926.pdf) * tweedle: 1st pk : Fq.t (32 bytes) || 2nd pk : Fq.t (32 bytes) (https://github.com/CodaProtocol/coda/blob/develop/rfcs/0038-rosetta-construction-api.md#marshal-keys) * pallas: `x (255 bits) || y-parity-bit (1-bit) - 32 bytes` (https://github.com/zcash/pasta)", + "description":"CurveType is the type of cryptographic curve associated with a PublicKey. * secp256k1: SEC compressed - `33 bytes` (https://secg.org/sec1-v2.pdf#subsubsection.2.3.3) * secp256r1: SEC compressed - `33 bytes` (https://secg.org/sec1-v2.pdf#subsubsection.2.3.3) * edwards25519: `y (255-bits) || x-sign-bit (1-bit)` - `32 bytes` (https://ed25519.cr.yp.to/ed25519-20110926.pdf) * tweedle: 1st pk : Fq.t (32 bytes) || 2nd pk : Fq.t (32 bytes) (https://github.com/CodaProtocol/coda/blob/develop/rfcs/0038-rosetta-construction-api.md#marshal-keys) * pallas: `x (255 bits) || y-parity-bit (1-bit) - 32 bytes` (https://github.com/zcash/pasta) * bls12381: `G1 Point in compressed Zcash format (48 bytes)` (https://datatracker.ietf.org/doc/draft-irtf-cfrg-bls-signature/04/)", "type":"string", "enum": [ "secp256k1", "secp256r1", "edwards25519", "tweedle", - "pallas" + "pallas", + "bls12381" ] }, "SigningPayload": { From fc9af944bf7aa4c14a2e674be27e9ddcb6930425 Mon Sep 17 00:00:00 2001 From: Freddie Coleman Date: Mon, 21 Mar 2022 21:13:46 +0000 Subject: [PATCH 3/3] add bls12381 signature types to api.json --- api.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api.json b/api.json index 9309590..e38a4d9 100644 --- a/api.json +++ b/api.json @@ -1429,14 +1429,16 @@ } }, "SignatureType": { - "description":"SignatureType is the type of a cryptographic signature. * ecdsa: `r (32-bytes) || s (32-bytes)` - `64 bytes` * ecdsa_recovery: `r (32-bytes) || s (32-bytes) || v (1-byte)` - `65 bytes` * ed25519: `R (32-byte) || s (32-bytes)` - `64 bytes` * schnorr_1: `r (32-bytes) || s (32-bytes)` - `64 bytes` (schnorr signature implemented by Zilliqa where both `r` and `s` are scalars encoded as `32-bytes` values, most significant byte first.) * schnorr_poseidon: `r (32-bytes) || s (32-bytes)` where s = Hash(1st pk || 2nd pk || r) - `64 bytes` (schnorr signature w/ Poseidon hash function implemented by O(1) Labs where both `r` and `s` are scalars encoded as `32-bytes` values, least significant byte first. https://github.com/CodaProtocol/signer-reference/blob/master/schnorr.ml )", + "description":"SignatureType is the type of a cryptographic signature. * ecdsa: `r (32-bytes) || s (32-bytes)` - `64 bytes` * ecdsa_recovery: `r (32-bytes) || s (32-bytes) || v (1-byte)` - `65 bytes` * ed25519: `R (32-byte) || s (32-bytes)` - `64 bytes` * schnorr_1: `r (32-bytes) || s (32-bytes)` - `64 bytes` (schnorr signature implemented by Zilliqa where both `r` and `s` are scalars encoded as `32-bytes` values, most significant byte first.) * schnorr_poseidon: `r (32-bytes) || s (32-bytes)` where s = Hash(1st pk || 2nd pk || r) - `64 bytes` (schnorr signature w/ Poseidon hash function implemented by O(1) Labs where both `r` and `s` are scalars encoded as `32-bytes` values, least significant byte first. https://github.com/CodaProtocol/signer-reference/blob/master/schnorr.ml ) * bls12381_basic_mpl: G2 Point in compressed Zcash format (96 bytes) - Basic Scheme * bls12381_basic_mpl: G2 Point in compressed Zcash format (96 bytes) - Aug Scheme", "type":"string", "enum": [ "ecdsa", "ecdsa_recovery", "ed25519", "schnorr_1", - "schnorr_poseidon" + "schnorr_poseidon", + "bls12381_basic_mpl", + "bls12381_aug_mpl" ] }, "CoinAction": {