@coordination-network/user-client 0.0.2 → 0.1.1

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.
package/dist/index.cjs CHANGED
@@ -196,9 +196,8 @@ function verifyRegistrationRequest(request, expected) {
196
196
  if (signature.hasHighS())
197
197
  return false;
198
198
  const recoveredPublicKey = signature.recoverPublicKey(hexToBytes(digest)).toBytes(false);
199
- // computeNetworkId is keccak256(X || Y); compare all 32 bytes. An address-style check over the
200
- // low 20 would leave the top 12 unauthenticated and let one key claim 2^96 ids. The contract
201
- // itself checks no signer at all.
199
+ // Compare all 32 bytes of the hash. A partial match would leave bytes unauthenticated and let
200
+ // one key claim many ids. The contract itself checks no signer at all.
202
201
  return identity.computeNetworkId(recoveredPublicKey).toLowerCase() === request.networkId.toLowerCase();
203
202
  }
204
203
  catch {
package/dist/index.js CHANGED
@@ -195,9 +195,8 @@ function verifyRegistrationRequest(request, expected) {
195
195
  if (signature.hasHighS())
196
196
  return false;
197
197
  const recoveredPublicKey = signature.recoverPublicKey(hexToBytes(digest)).toBytes(false);
198
- // computeNetworkId is keccak256(X || Y); compare all 32 bytes. An address-style check over the
199
- // low 20 would leave the top 12 unauthenticated and let one key claim 2^96 ids. The contract
200
- // itself checks no signer at all.
198
+ // Compare all 32 bytes of the hash. A partial match would leave bytes unauthenticated and let
199
+ // one key claim many ids. The contract itself checks no signer at all.
201
200
  return computeNetworkId(recoveredPublicKey).toLowerCase() === request.networkId.toLowerCase();
202
201
  }
203
202
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coordination-network/user-client",
3
- "version": "0.0.2",
3
+ "version": "0.1.1",
4
4
  "description": "Single-call onboarding and registration for the coordination network: derive device keys, encode the meta-stealth address, and register networkId -> metaStealthAddress on IdentityRegistry.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,16 +36,17 @@
36
36
  "build": "rimraf dist types && rollup -c rollup.config.mjs"
37
37
  },
38
38
  "dependencies": {
39
- "@coordination-network/identity": "^0.0.2",
39
+ "@coordination-network/identity": "^0.1.1",
40
40
  "@noble/curves": "^1.9.7",
41
41
  "@noble/hashes": "^1.8.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@coordination-network/network-member-client": "^0.0.2",
45
- "@coordination-network/network-member-proof": "^0.0.2",
44
+ "@coordination-network/network-member-client": "^0.1.1",
45
+ "@coordination-network/network-member-proof": "^0.1.1",
46
46
  "@rollup/plugin-typescript": "^12.3.0",
47
- "@semaphore-protocol/group": "4.14.3",
48
- "@semaphore-protocol/identity": "4.14.3",
47
+ "@semaphore-protocol/group": "4.14.5",
48
+ "@semaphore-protocol/identity": "4.14.5",
49
+ "ffjavascript": "0.3.1",
49
50
  "rimraf": "^6.1.3",
50
51
  "rollup": "^4.62.2",
51
52
  "rollup-plugin-cleanup": "^3.2.1",
package/src/request.ts CHANGED
@@ -79,9 +79,8 @@ export function verifyRegistrationRequest(request: RegistrationRequest, expected
79
79
 
80
80
  const recoveredPublicKey = signature.recoverPublicKey(hexToBytes(digest)).toBytes(false)
81
81
 
82
- // computeNetworkId is keccak256(X || Y); compare all 32 bytes. An address-style check over the
83
- // low 20 would leave the top 12 unauthenticated and let one key claim 2^96 ids. The contract
84
- // itself checks no signer at all.
82
+ // Compare all 32 bytes of the hash. A partial match would leave bytes unauthenticated and let
83
+ // one key claim many ids. The contract itself checks no signer at all.
85
84
  return computeNetworkId(recoveredPublicKey).toLowerCase() === request.networkId.toLowerCase()
86
85
  } catch {
87
86
  return false