<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-cose-bls-key-representations-01" submissionType="IETF" category="std" xml:lang="en" consensus="true">

<front>
<title>Barreto-Lynn-Scott Elliptic Curve Key Representations for JOSE and COSE</title><seriesInfo value="draft-ietf-cose-bls-key-representations-01" status="standard" name="Internet-Draft"/>
<author initials="T." surname="Looker" fullname="Tobias Looker"><organization>Mattr</organization><address><postal><street/>
</postal><email>tobias.looker@mattr.global</email>
</address></author>
<author initials="M." surname="Jones" fullname="Michael B. Jones"><organization>Microsoft</organization><address><postal><street/>
</postal><email>mbj@microsoft.com</email>
<uri>https://self-issued.info/</uri>
</address></author>
<date/>
<area>Internet</area>
<workgroup>COSE</workgroup>
<keyword>COSE</keyword>
<keyword>JOSE</keyword>

<abstract>
<t>This specification defines how to represent cryptographic keys for the pairing-friendly elliptic curves known as Barreto-Lynn-Scott (BLS), for use with the key representation formats of JSON Web Key (JWK) and COSE (COSE_Key).</t>
</abstract>

<note title="Discussion Venues" removeInRFC="true">
<t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/tplooker/draft-ietf-cose-bls-key-representations"/>.</t>
</note>
</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>This specification defines how to represent cryptographic keys for the pairing-friendly elliptic curves known as Barreto-Lynn-Scott <xref target="BLS"/>, for use with the key representation formats of JSON Web Key (JWK) and COSE_Key. This specification registers the elliptic curves in appropriate IANA JOSE and COSE registries.</t>
<t>There are a variety of applications for pairing based cryptography including schemes already published as RFCs, such as Identity-Based Cryptography <xref target="RFC5091"/> Sakai-Kasahara Key Encryption (SAKKE) <xref target="RFC6508"/>, and Identity-Based Authenticated Key Exchange (IBAKE) <xref target="RFC6539"/>. SAKKE is applied to Multimedia Internet KEYing (MIKEY) <xref target="RFC6509"/>.</t>
<t>This branch of cryptography has also been used to develop privacy-preserving cryptographic hardware attestations schemes, including the Elliptic Curve Direct Anonymous Attestation (ECDAA) in the Trusted Platform Modules <xref target="TPM"/> specified by the Trusted Computing Group. Further work on similar schemes has also occurred at the FIDO Alliance <xref target="ECDAA"/>. Similarly, Intel released <xref target="EPID"/> which provides a solution to remote hardware attestation for Intel Software Guard Extension (SGX) enabled environments.</t>
<t>More recently, applications of pairing based cryptography using the Barreto-Lynn-Scott curves include the standardization effort for BLS Signatures <xref target="id.draft.bls-signature-04"/>, which are used extensively in multiple blockchain projects due to their unique signature aggregation properties, including [Ethereum] [DFINITY] [Algorand]. Additionally, efforts are under way to standardize the general purpose short group signature scheme of BBS Signatures <xref target="BBS"/>, which features novel properties such as multi-message signing and selective disclosure alongside zero knowledge proving. It is intended that this draft will help with these efforts by standardizing the associated cryptographic key representation in the popular formats of JWK and COSE_Key.</t>
<t>Other relevant work to this draft includes <xref target="JWP"/> which is extending the JOSE family of specifications to provide support for representing a variety of new proof based cryptographic schemes such as <xref target="BBS"/> which as referred to above uses the Barreto-Lynn-Scott curves.</t>
<t>There are multiple different pairing-friendly curves in active use; however, this draft focuses on a definition for the Barreto-Lynn-Scott curves due to them being the most "widely used" and "efficient" whilst achieving 128-bit and 256-bit security (BLS12-381 and BLS48-581 respectively).</t>
<t>More extensive discussion on the broader application of pairing based cryptography and the assessment of various elliptic curves (including the BLS family) can be found in <xref target="id.draft.pairing-friendly-curves-10"/>.</t>
</section>

<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>

<section anchor="representation-definition"><name>Representation Definition</name>
<t>The following definitions apply to the pairing-friendly elliptic curves known as the Barreto-Lynn-Scott (BLS) curves.</t>

<section anchor="json-web-key-representation"><name>JSON Web Key Representation</name>
<t>When expressing a cryptographic key for these curves in JSON Web Key (JWK) form, the following rules apply:</t>

<ul>
<li>The parameter "kty" MUST be present and set to "OKP".</li>
<li>The parameter "crv" MUST be present and value MUST be one defined in <xref target="curve-parameter-registration"/>.</li>
<li>The parameter "x" MUST be present whose value represents the curve point for the public key. This value MUST be encoded using the serialization defined in <xref target="id.draft.pairing-friendly-curves-10"/> Appendix C and MUST be base64url encoded without padding as defined in <xref target="RFC7515"/> Appendix C.</li>
<li>The parameter "d" MUST be present for private key representations whose value MUST contain the little-endian representation of the private key base64url encoded without padding as defined in <xref target="RFC7515"/> Appendix C. This parameter MUST NOT be present for public keys.</li>
</ul>
</section>

<section anchor="cose-key-representation"><name>COSE_Key Representation</name>
<t>When expressing a cryptographic key for these curves in COSE_Key form, the following rules apply:</t>

<ul>
<li>The parameter "kty" (1) MUST be present and set to "OKP" (1).</li>
<li>The parameter "crv" (-1) MUST be present and value MUST be one defined in <xref target="curve-parameter-registration"/>.</li>
<li>The parameter "x" (-2) MUST be present whose value represents the curve point for the public key. This value MUST be encoded using the serialization defined in <xref target="id.draft.pairing-friendly-curves-10"/> Appendix C.</li>
<li>The parameter "d" (-4) MUST be present for private key representations whose value MUST contain the little-endian representation of the private key. This parameter MUST NOT be present for public keys.</li>
</ul>
</section>

<section anchor="curve-parameter-registration"><name>Curve Parameter Registration</name>
<table>
<thead>
<tr>
<th>JWK "crv" value</th>
<th>COSE_Key "crv" value</th>
<th>Description</th>
</tr>
</thead>

<tbody>
<tr>
<td>Bls12381G1</td>
<td>TBD (13 requested)</td>
<td>A cryptographic key on the Barreto-Lynn-Scott (BLS) curve featuring an embedding degree 12 with 381-bit p in the subgroup of G1 defined as <tt>E(GF(p))</tt> of order r</td>
</tr>

<tr>
<td>Bls12381G2</td>
<td>TBD (14 requested)</td>
<td>A cryptographic key on the Barreto-Lynn-Scott (BLS) curve featuring an embedding degree 12 with 381-bit p in the subgroup of G1 defined as <tt>E(GF(p^2))</tt> of order r</td>
</tr>

<tr>
<td>Bls48581G1</td>
<td>TBD (15 requested)</td>
<td>A cryptographic key on the Barreto-Lynn-Scott (BLS) curve featuring an embedding degree 48 with 581-bit p in the subgroup of G1 defined as <tt>E(GF(p))</tt> of order r</td>
</tr>

<tr>
<td>Bls48581G2</td>
<td>TBD (16 requested)</td>
<td>A cryptographic key on the Barreto-Lynn-Scott (BLS) curve featuring an embedding degree 48 with 581-bit p in the subgroup of G1 defined as <tt>E(GF(p^8))</tt> of order r</td>
</tr>
</tbody>
</table></section>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>See <xref target="id.draft.pairing-friendly-curves-10"/> for additional details on security considerations for the curves used.  Implementers should also consider the general guidance provided in Section 9 of <xref target="RFC7517"/> and Section 17 of <xref target="RFC8152"/> when using this specification.</t>
<t>Furthermore, because this specification only defines the cryptographic key representations and not the usage of these keys with specific algorithms, implementers should be aware to follow any guidance that may be provided around appropriate usage of the keys and or additional steps that may be required to validate the keys within the context of particular algorithms.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>

<section anchor="json-web-key-jwk-elliptic-curve-registrations"><name>JSON Web Key (JWK) Elliptic Curve Registrations</name>
<t>This section registers the following values in the IANA "JSON Web Key Elliptic Curve" registry <xref target="IANA.JOSE.Curves"/>.</t>
<t>Bls12381G1</t>

<ul>
<li>Curve Name: Bls12381G1</li>
<li>Curve Description: 381 bit with an embedding degree of 12 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E(GF(p))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="json-web-key-representation"/></li>
</ul>
<t>Bls12381G2</t>

<ul>
<li>Curve Name: Bls12381G2</li>
<li>Curve Description: 381 bit with an embedding degree of 12 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E'(GF(p^2))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="json-web-key-representation"/></li>
</ul>
<t>Bls48581G1</t>

<ul>
<li>Curve Name: Bls48581G1</li>
<li>Curve Description: 581 bit with an embedding degree of 48 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E(GF(p))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="json-web-key-representation"/></li>
</ul>
<t>Bls48581G2</t>

<ul>
<li>Curve Name: Bls48581G2</li>
<li>Curve Description: 581 bit with an embedding degree of 48 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E'(GF(p^8))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="json-web-key-representation"/></li>
</ul>
</section>

<section anchor="cose-elliptic-curve-registrations"><name>COSE Elliptic Curve Registrations</name>
<t>This section registers the following value in the IANA "COSE Elliptic Curves" registry <xref target="IANA.COSE.Curves"/>.</t>
<t>Bls12381G1</t>

<ul>
<li>Curve Name: Bls12381G1</li>
<li>Value: TBD (13 requested)</li>
<li>Key Type: OKP</li>
<li>Curve Description: 381 bit with an embedding degree of 12 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E(GF(p))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="cose-key-representation"/></li>
<li>Recommended: Yes</li>
</ul>
<t>Bls12381G2</t>

<ul>
<li>Curve Name: Bls12381G2</li>
<li>Value: TBD (14 requested)</li>
<li>Key Type: OKP</li>
<li>Curve Description: 381 bit with an embedding degree of 12 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E'(GF(p^2))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="cose-key-representation"/></li>
<li>Recommended: Yes</li>
</ul>
<t>Bls48581G1</t>

<ul>
<li>Curve Name: Bls48581G1</li>
<li>Value: TBD (15 requested)</li>
<li>Key Type: OKP</li>
<li>Curve Description: 581 bit with an embedding degree of 48 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E(GF(p))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="cose-key-representation"/></li>
<li>Recommended: Yes</li>
</ul>
<t>Bls48581G2</t>

<ul>
<li>Curve Name: Bls48581G2</li>
<li>Value: TBD (16 requested)</li>
<li>Key Type: OKP</li>
<li>Curve Description: 581 bit with an embedding degree of 48 Barreto-
Lynn-Scott pairing-friendly curve using the r-order subgroup of
E'(GF(p^8))</li>
<li>JOSE Implementation Requirements: Optional</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="cose-key-representation"/></li>
<li>Recommended: Yes</li>
</ul>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<reference anchor="BLS" target="">
  <front>
    <title>Constructing Elliptic Curves with Prescribed Embedding Degrees</title>
    <author fullname="Paulo S. L. M. Barreto" initials="P." surname="Barreto">
      <organization/>
    </author>
    <author fullname="Ben Lynn" initials="B." surname="Lynn">
      <organization/>
    </author>
    <author fullname="Michael Scott" initials="M." surname="Scott">
      <organization/>
    </author>
    <date year="2003"/>
  </front>
</reference>
<reference anchor="IANA.COSE.Curves" target="https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves">
  <front>
    <title>COSE Elliptic Curves</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date/>
  </front>
</reference>
<reference anchor="IANA.JOSE.Curves" target="https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve">
  <front>
    <title>JOSE Elliptic Curves</title>
    <author>
      <organization>IANA</organization>
    </author>
    <date/>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8152.xml"/>
<reference anchor="id.draft.bls-signature-04" target="https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04">
  <front>
    <title>BLS Signature</title>
    <author>
      <organization>IETF CFRG</organization>
    </author>
    <date/>
  </front>
</reference>
<reference anchor="id.draft.pairing-friendly-curves-10" target="https://www.ietf.org/archive/id/draft-irtf-cfrg-pairing-friendly-curves-10.html">
  <front>
    <title>Pairing-Friendly Curves</title>
    <author>
      <organization>IETF CFRG</organization>
    </author>
    <date/>
  </front>
</reference>
</references>
<references><name>Informative References</name>
<reference anchor="BBS" target="https://identity.foundation/bbs-signature/draft-bbs-signatures.html">
  <front>
    <title>The BBS Signature Scheme</title>
    <author>
      <organization>Decentralized Identity Foundation</organization>
    </author>
    <date/>
  </front>
</reference>
<reference anchor="ECDAA" target="https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-ecdaa-algorithm-v2.0-id-20180227.html">
  <front>
    <title>ECDAA Algorithm</title>
    <author>
      <organization>FIDO Alliance</organization>
    </author>
    <date year="2018"/>
  </front>
</reference>
<reference anchor="EPID" target="https://software.intel.com/en-us/download/intel-sgx-intel-epid-provisioning-and-attestation-services">
  <front>
    <title>Intel (R) SGX: Intel (R) EPID Provisioning and Attestation Services</title>
    <author>
      <organization>Intel Corporation</organization>
    </author>
    <date/>
  </front>
</reference>
<reference anchor="JWP" target="https://json-web-proofs.github.io/json-web-proofs/draft-jmiller-json-proof-algorithms.html#name-bls-curve">
  <front>
    <title>JSON Web Proof</title>
    <author fullname="Jeremie Miller" initials="J." surname="Miller"/>
    <author fullname="Michael B. Jones" initials="M." surname="Jones"/>
    <date/>
  </front>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5091.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6508.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6509.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6539.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<reference anchor="TPM" target="https://trustedcomputinggroup.org/">
  <front>
    <title>Trusted Platform Module</title>
    <author>
      <organization>Trusted Computing Group</organization>
    </author>
    <date/>
  </front>
</reference>
</references>

<section anchor="appendix"><name>Appendix</name>
<t>The following examples showcase JWKs for both the G1 and G2 subgroups of the Bls12381 curve. Note, the examples also include the corresponding private key, expressed through the inclusion of the “d” parameter.</t>
<t>An example JWK for the Bls12381 curve where the public key is in the G1 subgroup.</t>

<artwork>{
  "kty": "OKP",
  "crv": "Bls12381G1",
  "d": "Mt_OyD9IAsYvobHJ9NCipm6-G7zAu28FCc-saRnXhjQ",
  "x": "iXmOmxttBniHSpyoq-vBr82BexrqG7WDTsxCY4ngUOERVxwpwUT7yKqSKqJeIr7J"
}
</artwork>
<t>Another example of a different JWK for the Bls12381 curve where the public key is in the G1 subgroup.</t>

<artwork>{
  "kty": "OKP",
  "crv": "Bls12381G1",
  "d": "PV21Ysd3RNtDBzx94WOkIItSdMkMx0xdjtVFWen9xy8",
  "x": "jQb7AerHCU1Zf7oUCMYioqAkK_Q35-hDmg9cKhIJzGyZmQgb4saO376vjmGkvaLC"
}
</artwork>
<t>An example JWK for the Bls12381 curve where the public key is in the G2 subgroup.</t>

<artwork>{
  "kty": "OKP",
  "crv": "Bls12381G2",
  "d": "CUrC9Xp5pEonbFaykalWlbNYYwueJlcuoOexhEhpu0k",
  "x": "rvdKcdkxwlj0Y-XZsFpz1hDPJGjnLN27IJipbmaLlaKdYfICGG6dzakG6EkdcvW0AtVV6hXBSKtdFnKQKmmD759tMYYuvKYf5o2cZnROLN5iWQ2H6vp6FlLi71a_AE5I"
}
</artwork>
<t>Another example of a different JWK for the Bls12381 curve where the public key is in the G2 subgroup.</t>

<artwork>{
  "kty": "OKP",
  "crv": "Bls12381G2",
  "d": "oF2xFR6Iu3aWQARjHFdmNjeZBKuSO6q1DA1t2ucNHyc",
  "x": "pHufIAzbxDG-oaD0Kb1BcRsDpjw0JX3h6FHRJQpuYSpqQr_sZigCD3UOTrDO2YEvAxiC6GZXZvlwkqSIOVHRWAwRt2loaqAu6jFiL0L0r8LuXhBxX0tvfPX1UhYgcl3_"
}
</artwork>
</section>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>The authors would like to acknowledge the work of Kyle Den Hartog, which was used as the foundation for this draft.</t>
</section>

<section anchor="document-history"><name>Document History</name>
<t>-00</t>

<ul>
<li>Created draft-ietf-cose-bls-key-representations-00 from draft-looker-cose-bls-key-representations-00 following working group adoption.</li>
</ul>
</section>

</back>

</rfc>
