Skip to content

Commit 5459ad1

Browse files
committed
docs: update docs
1 parent 5175d87 commit 5459ad1

File tree

2 files changed

+48
-30
lines changed

2 files changed

+48
-30
lines changed

docs/content/docs/modules/core/SignData.mdx

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,10 @@ parent: Modules
66

77
## SignData overview
88

9-
COSE (RFC 8152) message signing for Cardano (CIP-0030).
9+
COSE (RFC 8152) message signing for Cardano.
1010

11-
This module provides a TypeScript implementation of @emurgo/cardano-message-signing-nodejs,
12-
offering the complete CSL message signing API surface including:
13-
14-
- COSESign1Builder: Builder for creating COSE_Sign1 structures
15-
- COSESign1: Signed message representation
16-
- COSEKey: COSE key representation
17-
- Headers: Protected and unprotected headers
18-
- HeaderMap: Map of header labels to values
19-
- Label: Header label representation
20-
- EdDSA25519Key: Ed25519 key operations
11+
Implements CIP-30 wallet API and CIP-8 message signing using COSE_Sign1 structures.
12+
Compatible with all major Cardano wallets.
2113

2214
Added in v2.0.0
2315

@@ -130,7 +122,13 @@ Added in v2.0.0
130122
## signData
131123

132124
Sign data with a private key using COSE_Sign1.
133-
Compatible with lucid-evolution's sign_data implementation.
125+
126+
Implements CIP-30 `api.signData()` specification. Creates a COSE_Sign1 structure with:
127+
128+
- Protected headers: algorithm (EdDSA), address
129+
- Unprotected headers: hashed (false)
130+
- Payload: NOT pre-hashed
131+
- Returns CBOR-encoded COSE_Sign1 and COSE_Key
134132

135133
**Signature**
136134

@@ -147,7 +145,14 @@ Added in v2.0.0
147145
## verifyData
148146
149147
Verify a COSE_Sign1 signed message.
150-
Compatible with lucid-evolution's verifyData implementation.
148+
149+
Validates CIP-30 signatures by verifying:
150+
151+
- Payload matches signed data
152+
- Address matches protected headers
153+
- Algorithm is EdDSA
154+
- Public key hash matches provided key hash
155+
- Ed25519 signature is cryptographically valid
151156
152157
**Signature**
153158
@@ -937,7 +942,7 @@ Added in v2.0.0
937942
## COSEKeyFromCBORBytes
938943

939944
CBOR bytes transformation schema for COSEKey.
940-
Encodes COSEKey as a CBOR Map compatible with CSL/lucid-evolution.
945+
Encodes COSEKey as a CBOR Map compatible with CSL.
941946

942947
**Signature**
943948

@@ -1071,6 +1076,8 @@ Added in v2.0.0
10711076

10721077
Payload type - raw binary data to be signed.
10731078

1079+
The payload is NOT pre-hashed before signing (per CIP-8).
1080+
10741081
**Signature**
10751082

10761083
```ts
@@ -1081,7 +1088,9 @@ Added in v2.0.0
10811088

10821089
## SignedMessage (type alias)
10831090

1084-
Signed message result.
1091+
Signed message result (CIP-30 DataSignature format).
1092+
1093+
Contains CBOR-encoded COSE_Sign1 (signature) and COSE_Key (public key).
10851094

10861095
**Signature**
10871096

packages/evolution/docs/modules/core/SignData.ts.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,10 @@ parent: Modules
66

77
## SignData overview
88

9-
COSE (RFC 8152) message signing for Cardano (CIP-0030).
9+
COSE (RFC 8152) message signing for Cardano.
1010

11-
This module provides a TypeScript implementation of @emurgo/cardano-message-signing-nodejs,
12-
offering the complete CSL message signing API surface including:
13-
14-
- COSESign1Builder: Builder for creating COSE_Sign1 structures
15-
- COSESign1: Signed message representation
16-
- COSEKey: COSE key representation
17-
- Headers: Protected and unprotected headers
18-
- HeaderMap: Map of header labels to values
19-
- Label: Header label representation
20-
- EdDSA25519Key: Ed25519 key operations
11+
Implements CIP-30 wallet API and CIP-8 message signing using COSE_Sign1 structures.
12+
Compatible with all major Cardano wallets.
2113

2214
Added in v2.0.0
2315

@@ -130,7 +122,13 @@ Added in v2.0.0
130122
## signData
131123

132124
Sign data with a private key using COSE_Sign1.
133-
Compatible with lucid-evolution's sign_data implementation.
125+
126+
Implements CIP-30 `api.signData()` specification. Creates a COSE_Sign1 structure with:
127+
128+
- Protected headers: algorithm (EdDSA), address
129+
- Unprotected headers: hashed (false)
130+
- Payload: NOT pre-hashed
131+
- Returns CBOR-encoded COSE_Sign1 and COSE_Key
134132

135133
**Signature**
136134

@@ -147,7 +145,14 @@ Added in v2.0.0
147145
## verifyData
148146
149147
Verify a COSE_Sign1 signed message.
150-
Compatible with lucid-evolution's verifyData implementation.
148+
149+
Validates CIP-30 signatures by verifying:
150+
151+
- Payload matches signed data
152+
- Address matches protected headers
153+
- Algorithm is EdDSA
154+
- Public key hash matches provided key hash
155+
- Ed25519 signature is cryptographically valid
151156
152157
**Signature**
153158
@@ -937,7 +942,7 @@ Added in v2.0.0
937942
## COSEKeyFromCBORBytes
938943

939944
CBOR bytes transformation schema for COSEKey.
940-
Encodes COSEKey as a CBOR Map compatible with CSL/lucid-evolution.
945+
Encodes COSEKey as a CBOR Map compatible with CSL.
941946

942947
**Signature**
943948

@@ -1071,6 +1076,8 @@ Added in v2.0.0
10711076

10721077
Payload type - raw binary data to be signed.
10731078

1079+
The payload is NOT pre-hashed before signing (per CIP-8).
1080+
10741081
**Signature**
10751082

10761083
```ts
@@ -1081,7 +1088,9 @@ Added in v2.0.0
10811088

10821089
## SignedMessage (type alias)
10831090

1084-
Signed message result.
1091+
Signed message result (CIP-30 DataSignature format).
1092+
1093+
Contains CBOR-encoded COSE_Sign1 (signature) and COSE_Key (public key).
10851094

10861095
**Signature**
10871096

0 commit comments

Comments
 (0)