Repository navigation
Conversation
Collaborator
|
Closing: we're not accepting bulk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #481: CIP-30
signDatareturns aDataSignatureof{ signature, key }, wherekeyis the CBOR-encoded COSE_Key needed to verify the signature.SignData.signDataproduces both, but the wallet'ssignMessagereturned only{ payload, signature }and dropped the key, and the walletSignedMessageinterface had nokeyfield — so a consumer could not verify a message signed via the wallet API without obtaining the public key some other way.Fix
packages/evolution/src/sdk/wallet/Wallet.ts—SignedMessagegains akeyfield (hex-encoded COSE_Key), with the doc comment stating the CIP-30DataSignatureshape.packages/evolution/src/sdk/client/internal/Signing.ts— the seed/private-key wallet'ssignMessagereturnskey: Bytes.toHex(signed.key)alongside the signature; the key was already computed bySignData.signData, it was just discarded.packages/evolution/src/sdk/client/internal/Wallets.ts— the CIP-30 api wallet'ssignMessagecarries the extension'sresult.keythrough, so both wallet types return a completeDataSignature.Tests
New file
packages/evolution/test/SignMessage.DataSignature.test.ts(4 tests), each verified failing on main first:result.keyisundefinedon main (expected 'undefined' to be 'string'); after the fix it is a non-empty hex string that decodes as CBOR.SignData.verifyDataverifies using only the returned{ signature, key }(plus the address and the signer's key hash) — self-contained CIP-30 verification, exactly what was impossible before.SignData.signDataproduces for the signing key.{ signature: "deadbeef", key: "cafebabe" }— on main the key is dropped; after the fixsignMessagereturns it unchanged.Full suite: 1682 passed / 75 skipped / 0 failed, test files 102 passed / 1 skipped of 103 — exactly main's 1678 baseline + the 4 new tests.
tsc --noEmitclean, eslint clean, and the three touched source files carry exactly the same prettier diff-line counts as unmodified main (5 / 10 / 320 — they fail prettier on main too; no new formatting drift). A patch changeset is included.Independent builder — not affiliated with the Cardano Foundation, IOG or Intersect.
@Kshot9000 (https://x.com/kshot9000) · ADA donations: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
cc @cardano-foundation @IntersectMBO