Skip to content

feat(individuality): withLiteAlias runs a call under a lite-person origin - #348

Merged
Imod7 merged 8 commits into
mainfrom
feat/individuality-with-lite-alias
Sep 1, 2026
Merged

feat(individuality): withLiteAlias runs a call under a lite-person origin#348
Imod7 merged 8 commits into
mainfrom
feat/individuality-with-lite-alias

Conversation

@peetzweg

@peetzweg peetzweg commented Aug 31, 2026

Copy link
Copy Markdown
Member

Second piece of the lite-personhood sign-up flow (#354): withLiteAlias(signer, info), the lite sibling of withAsPerson, filling the PeopleLiteAuth extension inside signTx.

Why: the two-transaction lite sign-up (unsigned PeopleLite.set_alias_account bind, then the signed, fee-free Game.sign_up_with_account_lite_invite) needs this extension on both legs, and dim2 hand-encodes it today.

How: three variants. AliasWithAccount reads the nonce back out of the CheckNonce slot PAPI filled, so the two cannot disagree. AliasWithProof forces VerifyMultiSignature=Disabled, so the host emits an unsigned general transaction with origin None. AliasWithAccountRevised builds the pallet's (implication, "revise", account, nonce) tuple. Every value round-trips through a codec built from the metadata being signed against, so devnet's shorter field list throws instead of emitting plausible wrong bytes. AsLitePerson is deliberately absent: it authenticates the host-custody canonical lite account, which no product-side signer can be.

Both signers now run one ordered signTx body through an internal withOriginExtension, each keeping its own buildValue; that order is the fragile part and was previously implemented and explained twice. buildImplication and implicationMessage now require the extension identifier instead of defaulting to AsPerson, which turned a silent wrong-slice hash into a compile error at 19 call sites. Neither is exported, so nothing changes for withAsPerson.

The individuality skill now documents the flow end to end: the ordering trap (Custom(175), NoAliasBinding, when the bind leg has not landed), the two contexts the chain allowlists for the bind (peopleLiteAuth and score, both peopl.<tld>), and that the proof therefore comes from the personhood product rather than from dim2.

489 package tests pass; workspace tests, typecheck and biome clean.

…ions

Pure helpers consolidating what dim2 and humanity each hand-roll:
productContext / contextSuffixBytes (the RFC-0024 Index/Raw expansion),
personhoodContext with the peopl context index map, ringCollectionId with
peopleRing / litePeopleRing, and readScoreContext, which checks that
Score.score_context is the product derivation of peopl.<Score.Suffix>/Index(0)
and reports a literal (non-host-mintable) context as NotProductDerived on the
ok channel. Product ids are always full DotNS ids; the TLD is never defaulted.

Pinned in-source against previewnet's published constants (spec 1000036),
both collection ids, and the dim2/game context vectors. Part of the lite
personhood sign-up flow (product-sdk#286).
…igin

The PeopleLiteAuth sibling of withAsPerson, on the same metadata-driven
machinery: AliasWithAccount for calls signed by an account bound to the
lite alias (the free Game.sign_up_with_account_lite_invite leg),
AliasWithProof for the unsigned ring-VRF-authorized
PeopleLite.set_alias_account bind leg, and AliasWithAccountRevised to
refresh a stale binding over the pallet's (implication, "revise",
account, nonce) tuple.

The slot patching, nonce read-back, proof-request guards and pipeline
cache that as-person-signer.ts kept file-private move to an internal
origin-extension.ts both signers share; the codec's context and proof
width guards are exported for the second encoder. Proof-variant bytes
are pinned against the encoding verified live on previewnet, and the
devnet blob - whose PeopleLiteAuthData predates the RevisionIndex
field - is the negative case proving the round-trip guard rejects a
field-list mismatch loudly. No behaviour change for withAsPerson.

@Imod7 Imod7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please update the individuality skill doc also.

In product-sdk/packages/individuality/src/as-person-implication.ts, lines 72 and 110, both:

    identifier: string = AS_PERSON,

Now that a second extension calls these, could the identifier become required?

Comment thread product-sdk/packages/individuality/src/as-lite-alias-signer.ts
Comment thread product-sdk/packages/individuality/src/as-lite-alias-signer.ts
Comment thread product-sdk/packages/individuality/src/origin-extension.ts
@Imod7
Imod7 changed the base branch from feat/individuality-lite-contexts to main September 1, 2026 15:34
@Imod7

Imod7 commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Please update the individuality skill doc also.

Fixed in 0f1efd1. The skill gained a lite-flow section, the frontmatter and the write-half bullet name withLiteAlias, the "ask for them to be exported" sentence is gone, and index.ts names both signers. One claim in that new section was itself wrong and was corrected in e7fcc22: the chain's context allowlist is the gate, not host-side identity.

In product-sdk/packages/individuality/src/as-person-implication.ts, lines 72 and 110, both:

    identifier: string = AS_PERSON,

Now that a second extension calls these, could the identifier become required?

Fixed in c7c9382. Making the parameter required flushed out 19 call sites that had been taking the AsPerson default silently, including in as-person-implication.ts's own tests.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

📦 Bundle size impact

Comparing 2026-09-01T16:20:26.660Z2026-09-01T16:20:06.742Z

Package Entry Bundled before Bundled after Δ Ship gzip Δ Shake ratio
🟢 @parity/product-sdk ./individuality 73.3 KB 74.6 KB +1.3 KB (+1.8%) 0 B

Thresholds — 🟡 ≥10% or ≥5.0 KB · 🟠 ≥20% or ≥15.0 KB (bundled). Percentage only applies once the baseline is ≥ 10 KB. Informational — this check never blocks merge.

@Imod7
Imod7 merged commit 1f58975 into main Sep 1, 2026
14 checks passed
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