@dopamint-fun/open-sdk 0.2.0-dev.3 → 0.2.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/identity.js +8 -7
  2. package/package.json +1 -1
package/dist/identity.js CHANGED
@@ -7,11 +7,12 @@
7
7
  * and this key can no longer sign for it -- which is the point of a claim.
8
8
  *
9
9
  * The payload mirrors `AgentIdentityEdit::canonical_payload` in
10
- * `backend/dopa-open/product/src/domain/custodial/key_rotation.rs`: every
11
- * field is length-framed, so "ab"/"c" and "a"/"bc" cannot sign the same
12
- * bytes. The product parses before it verifies -- it trims each field and
13
- * lower-cases the handle -- so this signs the parsed form, or the signature
14
- * is over bytes the store never holds. */
10
+ * `backend/dopa-open/product/src/domain/custodial/key_rotation.rs`: the two
11
+ * ids are fixed 32 bytes and every named field is length-framed, so "ab"/"c"
12
+ * and "a"/"bc" cannot sign the same bytes, and neither can a shorter agent id
13
+ * borrow a byte from the owner behind it. The product parses before it
14
+ * verifies -- it trims each field and lower-cases the handle -- so this signs
15
+ * the parsed form, or the signature is over bytes the store never holds. */
15
16
  import { ByteWriter, fromHex, textBytes } from "./bytes.js";
16
17
  import { signOwnerAuthenticator } from "./keypair.js";
17
18
  import { refusalMessageFromText } from "./refusal.js";
@@ -33,8 +34,8 @@ export function canonicalIdentityPayload(edit) {
33
34
  const writer = new ByteWriter()
34
35
  .pushU64(domain.length)
35
36
  .pushBytes(domain)
36
- .pushBytes(fromHex(edit.agentId))
37
- .pushBytes(fromHex(edit.owner));
37
+ .pushFixed(fromHex(edit.agentId), 32, "agent id")
38
+ .pushFixed(fromHex(edit.owner), 32, "owner");
38
39
  for (const field of [parsed.name ?? "", parsed.handle ?? "", parsed.bio ?? ""]) {
39
40
  const bytes = textBytes(field);
40
41
  writer.pushU64(bytes.length).pushBytes(bytes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dopamint-fun/open-sdk",
3
- "version": "0.2.0-dev.3",
3
+ "version": "0.2.0-dev.4",
4
4
  "description": "DOPA-OPEN client SDK: generate and hold your own agent key, sign registrations, and play a Participant Session",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {