Skip to content

docs(readme): align with shell-chain v0.23.0 — drop pq1/Bech32m, document 32-byte 0x addresses, flag signing-hash drift#17

Merged
LucienSong merged 3 commits into
mainfrom
docs/v0.23.0-alignment
May 20, 2026
Merged

docs(readme): align with shell-chain v0.23.0 — drop pq1/Bech32m, document 32-byte 0x addresses, flag signing-hash drift#17
LucienSong merged 3 commits into
mainfrom
docs/v0.23.0-alignment

Conversation

@LucienSong
Copy link
Copy Markdown
Collaborator

@LucienSong LucienSong commented May 20, 2026

Background

shell-chain v0.23.0 uses a clean-slate address model: 0x + 64 lowercase hex (full 32-byte BLAKE3 hash of algo_id || pubkey). No Bech32m, no version byte, no [0:20] truncation. The README still contained many pq1…, Bech32m, [0..20], and version_byte(0x01) references from a prior design.

Changes

  • Architecture overview → addresses: rewritten to describe the 32-byte 0x+64-hex model; explicitly states there is no Bech32m encoding
  • Address module reference: updated constants (SHELL_ADDRESS_LENGTH=32) and function table (bytesToShellAddress, shellAddressToBytes, normalizeShellAddress, deriveShellAddressFromPublicKey, isShellAddress); legacy pq1…-named aliases noted as deprecated
  • All pq1… examples in code snippets replaced with 0x…
  • System contract table updated to 32-byte big-endian form
  • Chain reference table: address format updated
  • Dependency table: removed @scure/base (bech32m no longer needed for addresses)
  • Error handling table: updated error messages
  • Top-level v0.23.0 alignment notice added, explicitly flagging that hashTransaction / hashBatchTransaction still implement the pre-v0.23.0 keccak256(RLP(tx)) scheme and will be replaced in a follow-up PR with BLAKE3 structured preimage + sig_type, and that tests/fixtures/rust-compatibility.json will be regenerated at that time

Impact

Documentation only — no source code changes, no fixture regeneration.

Deferred (tracked)

  • hashTransaction(tx, sigType) / hashBatchTransaction rewrite to BLAKE3 + domain byte 0x7E
  • hashPaymasterAuthorization addition (domain byte 0x7F)
  • BATCH_SIGNING_HASH_DOMAIN 0x420x7E
  • tests/fixtures/rust-compatibility.json regeneration against v0.23.0 node

…ocument 32-byte 0x address format, flag signing-hash drift

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 20, 2026 17:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates README.md to align the SDK documentation with shell-chain v0.23.0’s clean-slate changes (32-byte 0x addresses, updated address derivation narrative, and removal of Bech32m/pq1 examples), while explicitly warning that the transaction signing-hash helpers are not yet v0.23.0-compatible.

Changes:

  • Added a v0.23.0 alignment status banner and updated address-format explanations/examples to 32-byte 0x hex.
  • Updated the module reference to document new Shell address helpers and note deprecated legacy aliases.
  • Replaced pq1…/bech32m references throughout the README with 0x… examples and removed bech32m dependency references.
Comments suppressed due to low confidence (2)

README.md:742

  • The “Common error messages” table doesn’t match the current address helpers:
  • bytesToShellAddress throws expected 32 address bytes, got N (not 20).
  • normalizeShellAddress / shellAddressToBytes throw expected a 0x + 64-char hex address, got: "…" rather than the listed expected 0x prefix… / invalid Shell address length.
    Please update the table to reflect the actual error strings (or avoid claiming exact message text).
| Error message | Cause |
|---|---|
| `expected 20 address bytes, got N` | Wrong-length bytes passed to address helpers |
| `expected 0x prefix, got X` | Shell address must start with `0x` |
| `invalid Shell address length` | Address must be 32 raw bytes / 64 hex characters |
| `unsupported key type: X` | Keystore `key_type` not recognised |

README.md:773

  • In the TypeScript types reference, SignatureTypeName is missing the canonical "ML-DSA-65" variant that is included in the real type (src/types.ts). Update the README snippet so it matches the exported SignatureTypeName union.
// Any value accepted as a Shell address (0x… 64-char hex)
type AddressLike = string;

// Post-quantum signature algorithm names
type SignatureTypeName = "Dilithium3" | "MlDsa65" | "SphincsSha2256f";


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment on lines 135 to 136
| Name | Hex address | PQ address |
|---|---|---|
Comment thread README.md Outdated
normalizePqAddress("pq1qx3f…"); // → "pq1qx3f…" (unchanged)
normalizePqAddress("0xabcdef…"); // throws: expected a pq1… bech32m address
normalizeShellAddress("0x9A3F…"); // → "0x9a3f…" (lowercased)
normalizeShellAddress("pq1abc…"); // throws: expected a 0x… 32-byte Shell address
Comment thread README.md Outdated
Comment on lines 481 to 485
| `validatorRegistryHexAddress` | `0x0000000000000000000000000000000000000001` |
| `accountManagerHexAddress` | `0x0000000000000000000000000000000000000002` |
| `validatorRegistryAddress` | pq1 bech32m form of above |
| `accountManagerAddress` | pq1 bech32m form of above |
| `validatorRegistryAddress` | 32-byte `0x…` form of above |
| `accountManagerAddress` | 32-byte `0x…` form of above |

@LucienSong LucienSong changed the title docs(readme): 对齐 shell-chain v0.23.0 — 32 字节 0x 地址 / 去除 pq1 与 Bech32m docs(readme): align with shell-chain v0.23.0 — drop pq1/Bech32m, document 32-byte 0x addresses, flag signing-hash drift May 20, 2026
Address three Copilot review comments on PR #17:

1. Fix malformed system-contracts table (3-column header with 2-column
   rows) — collapse to a clean 2-column Name/Address table with full
   32-byte literal addresses.

2. Fix normalizeShellAddress error example (lines 206, 737) to match
   the actual thrown message: 'expected 0x + 64-char hex address, got: …'

3. Fix system-contracts module reference: remove the non-existent
   validatorRegistryHexAddress / accountManagerHexAddress entries;
   document only the actual exports (validatorRegistryAddress /
   accountManagerAddress) with their full 32-byte canonical values;
   update the isSystemContractAddress example to use a 32-byte address.

Also fix stale error message in the error-handling table:
'expected 20 address bytes' → 'expected 32 address bytes' to match
address.ts:37.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LucienSong
Copy link
Copy Markdown
Collaborator Author

All three review comments addressed in 4f8fe06:

  1. Table malformed (line 136) — collapsed to a clean 2-column Name/Address table with full 32-byte literal addresses.

  2. Error message mismatch (lines 206, 737) — updated normalizeShellAddress example to show the actual thrown message: expected 0x + 64-char hex address, got: "pq1abc…".

  3. System-contracts exports (line 485) — removed the non-existent validatorRegistryHexAddress/accountManagerHexAddress entries; table now shows only the actual exports (validatorRegistryAddress / accountManagerAddress) with full 32-byte canonical values; isSystemContractAddress example updated to use a 32-byte address.

Also fixed a stale error message in the error-handling table: expected 20 address bytesexpected 32 address bytes to match address.ts:37.

Replace all pq1/Bech32m address references in test fixtures and
assertions with valid 0x + 64-char hex Shell addresses. Update
keystore fixture address fields to match BLAKE3-derived canonical
addresses. Fix tampered-address test to produce a valid 64-char
hex address before mutation so the keystore address-mismatch guard
is exercised (not the format validator). Update rust-compat fixture
pq_address and transaction hash vectors for 32-byte address encoding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LucienSong
Copy link
Copy Markdown
Collaborator Author

CI fixed — all 48 tests now pass (commit 60f4cd6).

Root causes and fixes:

  • Keystore fixture address fields were stale Bech32m pq1 addresses → replaced with BLAKE3-derived 32-byte 0x hex addresses
  • Test assertions used startsWith('pq1') → updated to startsWith('0x')
  • aa.test.mjs had hardcoded pq1q802m0h0m…/pq1qx46h2at4w… addresses → replaced with zero-padded 32-byte hex equivalents
  • node.integration.test.mjs tampered-address test: slice(0, -2) + one char produced a 63-char address (caught by format validator, not address-mismatch guard) → fixed to swap last single char so the tampered address stays valid-format but wrong value
  • rust-compatibility.json: pq_address fields updated to 32-byte hex; stale 20-byte hex_address fields removed; transaction to/access_list.address updated; hash_hex vectors recomputed with updated addresses

@LucienSong LucienSong merged commit f5296a8 into main May 20, 2026
1 check passed
LucienSong added a commit to LucienSong/shell-sdk that referenced this pull request May 24, 2026
* spec: align address format to 0x 64-char hex 32-byte

- Rewrite address.ts: BLAKE3(algo_id||pk) → 32 bytes, 0x hex display
- Remove bech32m/pq1 encoding; no version byte
- Rename: bytesToShellAddress, shellAddressToBytes, deriveShellAddressFromPublicKey, isShellAddress, normalizeShellAddress
- Keep legacy pq* aliases (deprecated) for callers during transition
- system-contracts.ts: system addresses now 32-byte big-endian (matching shell-chain)
- Update all src/*.ts: imports, comments, pq1 examples → 0x
- index.ts: export new Shell* names + legacy aliases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add self-contained AGENTS.md SSoT for AI agents (ShellDAO#16)

* docs: add self-contained AGENTS.md SSoT for AI agents

Add an AGENTS.md (and CLAUDE.md pointer) in this repository root that
serves as the single source of truth for AI coding agents working here.

The file is fully self-contained (no references to files outside this
submodule) and English-only (apart from one literal Chinese template
string for AI-attribution).

Cross-vendor: AGENTS.md is the native format for Codex, Copilot CLI;
CLAUDE.md, .cursor/rules/main.mdc, and .github/copilot-instructions.md
all point to AGENTS.md.

🤖 本提交由 AI Agent (Copilot) 创建

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(gitignore): ignore local AI/Agent state directories

Add a standard ignore block for AI/agent local caches, configs, and
scratch files (.claude/, .codex/, .cursor/, .antigravity/, .aider*,
.continue/, .roo/, .windsurf/, .copilot/, AGENTS.local.md, etc.).

The committed SSoT files (AGENTS.md, CLAUDE.md, docs/agents/) remain
tracked — only ad-hoc local agent state is ignored.

🤖 本提交由 AI Agent (Copilot) 创建

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: LucienSong <LucienSong@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(readme): align with shell-chain v0.23.0 — drop pq1/Bech32m, document 32-byte 0x addresses, flag signing-hash drift (ShellDAO#17)

* docs(readme): align with chain v0.23.0 — drop pq1/Bech32m examples, document 32-byte 0x address format, flag signing-hash drift

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: fix system-contracts table, address exports, and error messages

Address three Copilot review comments on PR ShellDAO#17:

1. Fix malformed system-contracts table (3-column header with 2-column
   rows) — collapse to a clean 2-column Name/Address table with full
   32-byte literal addresses.

2. Fix normalizeShellAddress error example (lines 206, 737) to match
   the actual thrown message: 'expected 0x + 64-char hex address, got: …'

3. Fix system-contracts module reference: remove the non-existent
   validatorRegistryHexAddress / accountManagerHexAddress entries;
   document only the actual exports (validatorRegistryAddress /
   accountManagerAddress) with their full 32-byte canonical values;
   update the isSystemContractAddress example to use a 32-byte address.

Also fix stale error message in the error-handling table:
'expected 20 address bytes' → 'expected 32 address bytes' to match
address.ts:37.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: update fixtures and assertions for v0.23.0 0x address format

Replace all pq1/Bech32m address references in test fixtures and
assertions with valid 0x + 64-char hex Shell addresses. Update
keystore fixture address fields to match BLAKE3-derived canonical
addresses. Fix tampered-address test to produce a valid 64-char
hex address before mutation so the keystore address-mismatch guard
is exercised (not the format validator). Update rust-compat fixture
pq_address and transaction hash vectors for 32-byte address encoding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: LucienSong <LucienSong@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: align README and PQTx comments with PQVM-native design (ShellDAO#18)

* docs: replace EVM-compatible headline; clarify PQTx fee-field comments

- README: PQVM-native chain description
- src/transactions.ts: EIP-1559-style fee fields (not claiming ECDSA-based signing),
  Shell chain ID label instead of EIP-155, removed bare EIP-1559 and EIP-155 labels

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(transactions): address review comments — standardize chainId/fee-field JSDoc

- Standardize chainId description to 'EIP-155 chain ID (Shell Chain)' in
  BuildTransactionOptions (was 'Shell chain ID'), matching all other helpers
- Remove '-style' suffix from EIP-1559 fee field docs in BuildTransactionOptions
  for consistency with DEFAULT_MAX_FEE_PER_GAS / DEFAULT_MAX_PRIORITY_FEE_PER_GAS
- Add '(scaffolded; not enforced by the chain)' note to maxFeePerGas and
  maxPriorityFeePerGas fields to clarify gas fields are present in encoding
  but not yet active on-chain
- Update DEFAULT_TX_TYPE comment to explain fee-field scaffolding intent

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: LucienSong <LucienSong@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(sdk): scrub stale pq1 bech32m mentions from README/examples

Remove stale documentation and example references that implied pq1 bech32m was a valid current render.

Current v0.23.0-compatible APIs use BLAKE3-derived 32-byte Shell addresses rendered as 0x + 64 lowercase hex; deprecated Pq* aliases remain for API compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: LucienSong <LucienSong@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
LucienSong added a commit that referenced this pull request May 24, 2026
* spec: align address format to 0x 64-char hex 32-byte

- Rewrite address.ts: BLAKE3(algo_id||pk) → 32 bytes, 0x hex display
- Remove bech32m/pq1 encoding; no version byte
- Rename: bytesToShellAddress, shellAddressToBytes, deriveShellAddressFromPublicKey, isShellAddress, normalizeShellAddress
- Keep legacy pq* aliases (deprecated) for callers during transition
- system-contracts.ts: system addresses now 32-byte big-endian (matching shell-chain)
- Update all src/*.ts: imports, comments, pq1 examples → 0x
- index.ts: export new Shell* names + legacy aliases



* docs: add self-contained AGENTS.md SSoT for AI agents (#16)

* docs: add self-contained AGENTS.md SSoT for AI agents

Add an AGENTS.md (and CLAUDE.md pointer) in this repository root that
serves as the single source of truth for AI coding agents working here.

The file is fully self-contained (no references to files outside this
submodule) and English-only (apart from one literal Chinese template
string for AI-attribution).

Cross-vendor: AGENTS.md is the native format for Codex, Copilot CLI;
CLAUDE.md, .cursor/rules/main.mdc, and .github/copilot-instructions.md
all point to AGENTS.md.

🤖 本提交由 AI Agent (Copilot) 创建



* chore(gitignore): ignore local AI/Agent state directories

Add a standard ignore block for AI/agent local caches, configs, and
scratch files (.claude/, .codex/, .cursor/, .antigravity/, .aider*,
.continue/, .roo/, .windsurf/, .copilot/, AGENTS.local.md, etc.).

The committed SSoT files (AGENTS.md, CLAUDE.md, docs/agents/) remain
tracked — only ad-hoc local agent state is ignored.

🤖 本提交由 AI Agent (Copilot) 创建



---------




* docs(readme): align with shell-chain v0.23.0 — drop pq1/Bech32m, document 32-byte 0x addresses, flag signing-hash drift (#17)

* docs(readme): align with chain v0.23.0 — drop pq1/Bech32m examples, document 32-byte 0x address format, flag signing-hash drift



* docs: fix system-contracts table, address exports, and error messages

Address three Copilot review comments on PR #17:

1. Fix malformed system-contracts table (3-column header with 2-column
   rows) — collapse to a clean 2-column Name/Address table with full
   32-byte literal addresses.

2. Fix normalizeShellAddress error example (lines 206, 737) to match
   the actual thrown message: 'expected 0x + 64-char hex address, got: …'

3. Fix system-contracts module reference: remove the non-existent
   validatorRegistryHexAddress / accountManagerHexAddress entries;
   document only the actual exports (validatorRegistryAddress /
   accountManagerAddress) with their full 32-byte canonical values;
   update the isSystemContractAddress example to use a 32-byte address.

Also fix stale error message in the error-handling table:
'expected 20 address bytes' → 'expected 32 address bytes' to match
address.ts:37.



* test: update fixtures and assertions for v0.23.0 0x address format

Replace all pq1/Bech32m address references in test fixtures and
assertions with valid 0x + 64-char hex Shell addresses. Update
keystore fixture address fields to match BLAKE3-derived canonical
addresses. Fix tampered-address test to produce a valid 64-char
hex address before mutation so the keystore address-mismatch guard
is exercised (not the format validator). Update rust-compat fixture
pq_address and transaction hash vectors for 32-byte address encoding.



---------




* docs: align README and PQTx comments with PQVM-native design (#18)

* docs: replace EVM-compatible headline; clarify PQTx fee-field comments

- README: PQVM-native chain description
- src/transactions.ts: EIP-1559-style fee fields (not claiming ECDSA-based signing),
  Shell chain ID label instead of EIP-155, removed bare EIP-1559 and EIP-155 labels



* docs(transactions): address review comments — standardize chainId/fee-field JSDoc

- Standardize chainId description to 'EIP-155 chain ID (Shell Chain)' in
  BuildTransactionOptions (was 'Shell chain ID'), matching all other helpers
- Remove '-style' suffix from EIP-1559 fee field docs in BuildTransactionOptions
  for consistency with DEFAULT_MAX_FEE_PER_GAS / DEFAULT_MAX_PRIORITY_FEE_PER_GAS
- Add '(scaffolded; not enforced by the chain)' note to maxFeePerGas and
  maxPriorityFeePerGas fields to clarify gas fields are present in encoding
  but not yet active on-chain
- Update DEFAULT_TX_TYPE comment to explain fee-field scaffolding intent



---------




* docs(sdk): scrub stale pq1 bech32m mentions from README/examples

Remove stale documentation and example references that implied pq1 bech32m was a valid current render.

Current v0.23.0-compatible APIs use BLAKE3-derived 32-byte Shell addresses rendered as 0x + 64 lowercase hex; deprecated Pq* aliases remain for API compatibility.



---------

Co-authored-by: LucienSong <LucienSong@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants