@qorechain/connect 0.2.0 → 0.2.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/README.md +6 -4
- package/package.json +3 -3
- package/src/index.js +3 -2
package/README.md
CHANGED
|
@@ -30,14 +30,16 @@ PQC tx committed **code 0** (ML-DSA accepted); SVM read OK.
|
|
|
30
30
|
*before* the wallet `signDirect`s it, so the wallet needs zero changes.
|
|
31
31
|
- **SVM** → reads native; `tx svm execute` is a cosmos tx → same PQC layer.
|
|
32
32
|
|
|
33
|
-
## Hybrid sign-bytes form (v1 / v2, chain v3.1.98)
|
|
33
|
+
## Hybrid sign-bytes form (v1 / v2, chain v3.2.0 / testnet v3.1.98)
|
|
34
34
|
|
|
35
35
|
The ML-DSA-87 signature covers one of two byte forms and a network accepts exactly
|
|
36
36
|
one at any height: v1 `BE32(len B0) ‖ B0 ‖ BE32(len A) ‖ A`, or v2, which prefixes
|
|
37
37
|
`"qorechain-pqc-hybrid-v2" ‖ BE64(len chainId) ‖ chainId`. `qorechain-vladi`
|
|
38
|
-
(mainnet) and `qorechain-diana` (testnet) verify v1 until the
|
|
39
|
-
applied on them and v2 afterwards; testnet is on v2, **mainnet stays
|
|
40
|
-
its own upgrade**. Other chains verify v2 from genesis.
|
|
38
|
+
(mainnet) and `qorechain-diana` (testnet) verify v1 until the upgrade that carries
|
|
39
|
+
the switch is applied on them and v2 afterwards; testnet is on v2, **mainnet stays
|
|
40
|
+
on v1 until its own upgrade**. Other chains verify v2 from genesis. The switch
|
|
41
|
+
ships under two plan names — mainnet applies `v3.2.0`, the testnet already applied
|
|
42
|
+
`v3.1.98` — and the resolver asks for both, so either one applied means v2.
|
|
41
43
|
|
|
42
44
|
```js
|
|
43
45
|
await QoreConnect.sendCosmos(keplr, { address, pubkey, mlsk, acct, seq, to, amount,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qorechain/connect",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "One universal wallet connector for QoreChain across all 3 VMs (EVM, Cosmos, SVM). Detects any wallet by its standard interface (EIP-1193, OfflineDirectSigner, Solana Wallet Standard) and auto-layers the FIPS-204 PQC signature only where the chain requires it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"url": "https://github.com/qorechain/qorechain-connect.git"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@qorechain/wallet-adapter": "^0.2.
|
|
23
|
+
"@qorechain/wallet-adapter": "^0.2.1",
|
|
24
24
|
"ethers": "^6",
|
|
25
25
|
"@cosmjs/proto-signing": "^0.32"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@qorechain/wallet-adapter": "^0.2.
|
|
28
|
+
"@qorechain/wallet-adapter": "^0.2.1",
|
|
29
29
|
"@noble/post-quantum": "^0.6.1",
|
|
30
30
|
"cosmjs-types": "^0.9.0"
|
|
31
31
|
}
|
package/src/index.js
CHANGED
|
@@ -9,8 +9,9 @@ const CHAIN=process.env.QORE_CHAIN_ID||'qorechain-diana', RPC=process.env.QORE_R
|
|
|
9
9
|
// Hybrid PQC sign-bytes come in two forms and a network accepts exactly one at a time:
|
|
10
10
|
// v1 (legacy): BE32(len b0) ‖ b0 ‖ BE32(len a) ‖ a
|
|
11
11
|
// v2: "qorechain-pqc-hybrid-v2" ‖ BE64(len chainId) ‖ chainId ‖ v1-layout
|
|
12
|
-
// qorechain-vladi / qorechain-diana verify v1 until
|
|
13
|
-
//
|
|
12
|
+
// qorechain-vladi / qorechain-diana verify v1 until the upgrade carrying the switch is applied
|
|
13
|
+
// (plan 'v3.2.0' on mainnet, 'v3.1.98' on the testnet — either one counts), v2 after; any other
|
|
14
|
+
// chain verifies v2. 'auto' asks the LCD (`rest`) for both names, see @qorechain/wallet-adapter.
|
|
14
15
|
const encExt=(id,sig)=>{const vi=n=>{const b=[];while(n>0x7f){b.push((n&0x7f)|0x80);n>>>=7;}b.push(n);return b;};return Uint8Array.from([0x08,...vi(id),0x12,...vi(sig.length),...sig]);};
|
|
15
16
|
|
|
16
17
|
export class QoreConnect {
|