Skip to content

Commit d7b492c

Browse files
committed
feat: add Message Signing and UPLC modules
- Add COSE (RFC 8152) message signing with CIP-30/CIP-8 support - Add UPLC (Untyped Plutus Lambda Calculus) implementation - Support Flat serialization and CBOR encoding/decoding - Include all Plutus V3 builtin functions - Add script parameter application with type safety
1 parent ca5178e commit d7b492c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.changeset/khaki-hounds-float.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
"@evolution-sdk/evolution": patch
3+
---
4+
5+
Add Message Signing and UPLC modules with comprehensive cryptographic and smart contract support.
6+
7+
## Message Signing Module
8+
9+
Added complete COSE (RFC 8152) message signing implementation for Cardano:
10+
11+
- **CIP-30 Wallet API Support**: Full implementation of `signData()` and verification APIs compatible with all major Cardano wallets
12+
- **CIP-8 Compliance**: COSE_Sign1 structures for single-signature messages
13+
- **COSE_Sign Support**: Multi-signature message support with separate signature headers
14+
- **COSE_Key Integration**: EdDSA-25519 key representation and management
15+
- **Protected/Unprotected Headers**: Flexible header management with algorithm ID, address, and custom parameters
16+
- **Cryptographic Operations**: Blake2b hashing and Ed25519 signature verification
17+
- **User-Facing Encoding**: Support for `cms_<base64url>` format
18+
19+
Key APIs:
20+
- `signData()`: Sign messages with private keys using COSE_Sign1
21+
- `verifyData()`: Verify signed messages with cryptographic validation
22+
- Complete header management with `HeaderMap` and `Headers` classes
23+
- Label support for both integer and text-based COSE parameters
24+
25+
## UPLC Module
26+
27+
Added comprehensive UPLC (Untyped Plutus Lambda Calculus) implementation:
28+
29+
- **Flat Serialization**: Complete encoder/decoder for Flat format used by Plutus Core
30+
- **CBOR Integration**: Support for single and double CBOR-encoded scripts with automatic detection
31+
- **Term System**: Full support for all UPLC term types including Var, Lambda, Apply, Constant, Builtin, Delay, Force, Constr, Case, and Error
32+
- **Data Types**: Complete type system for Integer, ByteString, String, Unit, Bool, Data, List, and Pair
33+
- **Builtin Functions**: Support for all 87 Plutus V3 builtin functions including BLS12-381 operations
34+
- **Semantic Versioning**: Full version support for UPLC programs (major.minor.patch)
35+
- **Effect Schema Integration**: Type-safe schemas with validation and transformation
36+
37+
Key APIs:
38+
- `fromFlatBytes()` / `fromFlatHex()`: Decode UPLC programs from Flat encoding
39+
- `toFlatBytes()` / `toFlatHex()`: Encode UPLC programs to Flat encoding
40+
- `fromCborHexToProgram()`: Auto-detect and decode CBOR-encoded scripts
41+
- `fromDoubleCborEncodedHex()`: Decode compiled Plutus scripts
42+
- `applyParamsToScript()`: Apply PlutusData parameters to scripts with Aiken-compatible encoding
43+
- `applyParamsToScriptWithSchema()`: Type-safe parameter application with schemas
44+
- `dataConstant()`: Create UPLC constants from PlutusData
45+
- `getCborEncodingLevel()`: Detect CBOR encoding level (none/single/double)
46+
47+
Both modules include comprehensive error handling, validation, and full Effect Schema integration for type safety.

0 commit comments

Comments
 (0)