feat(individuality): withLiteAlias runs a call under a lite-person origin - #348
Conversation
…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
left a comment
There was a problem hiding this comment.
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?
Fixed in
Fixed in |
📦 Bundle size impactComparing
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. |
Second piece of the lite-personhood sign-up flow (#354):
withLiteAlias(signer, info), the lite sibling ofwithAsPerson, filling thePeopleLiteAuthextension insidesignTx.Why: the two-transaction lite sign-up (unsigned
PeopleLite.set_alias_accountbind, then the signed, fee-freeGame.sign_up_with_account_lite_invite) needs this extension on both legs, and dim2 hand-encodes it today.How: three variants.
AliasWithAccountreads the nonce back out of theCheckNonceslot PAPI filled, so the two cannot disagree.AliasWithProofforcesVerifyMultiSignature=Disabled, so the host emits an unsigned general transaction with originNone.AliasWithAccountRevisedbuilds 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.AsLitePersonis deliberately absent: it authenticates the host-custody canonical lite account, which no product-side signer can be.Both signers now run one ordered
signTxbody through an internalwithOriginExtension, each keeping its ownbuildValue; that order is the fragile part and was previously implemented and explained twice.buildImplicationandimplicationMessagenow require the extension identifier instead of defaulting toAsPerson, which turned a silent wrong-slice hash into a compile error at 19 call sites. Neither is exported, so nothing changes forwithAsPerson.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 (peopleLiteAuthandscore, bothpeopl.<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.