feat(individuality): Score.register builders and withScoreParticipant - #349
Merged
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.
Full-personhood registration, the step after the score is in:
registerMessage pins the byte-exact proof-of-ownership contract (raw
"pop register using" ++ account, 50 bytes, never SCALE),
registerPersonhoodTx builds Score.register(Some((member_key, sig)))
from a caller-supplied, width-checked pair the SDK never mints — only
the personhood product's host session can — and
readRegistrationEligibility folds Score.Participants and the
session-scheduled Score.PersonhoodThreshold storage item at one pinned
block into readyToRegister, also exported as the pure predicate.
withScoreParticipant is the third signer on the shared origin-extension
machinery: RestrictOrigins true, nonce read back out of CheckNonce, and
ScoreAsParticipant(Some(nonce)) encoded through the chain's own
metadata — the newtype-over-Option-over-newtype unwraps to a bare
number, and the plausible { nonce } shape silently encodes Some(0),
which the round-trip guard turns into a thrown AsPersonError.
Mirrors the flow verified live on previewnet (spec 1000036,
individuality v0.12.1) on 2026-08-28.
5 tasks
Imod7
reviewed
Sep 1, 2026
Imod7
left a comment
Collaborator
There was a problem hiding this comment.
Please update the individuality skill doc in this PR. It has no registration section, so anyone building this flow from it hand-rolls the message, and the quoted line is now false since there are three exported signers.
Imod7
changed the base branch from
feat/individuality-with-lite-alias
to
main
September 1, 2026 16:36
Collaborator
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. |
Imod7
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #348, now merged. The registration piece of #354: what a product needs to turn a scored participant into a full person.
Why: dim2 hand-rolls the
Score.registermessage and theScoreAsParticipantextension today, and the personhood product needs the same builders for the cross-product handoff.How:
registerMessage(account)pins the byte-exact"pop register using" ++ accountcontract, a raw 50-byte concatenation, never SCALE.registerPersonhoodTxbuilds the call from a caller-supplied(memberKey, proofOfOwnership)pair, width-checked and opaque: only the personhood product's own host session can mint it, so the builder never tries, which lets the same code serve today's two-product handoff and a future single-product path.readRegistrationEligibilityfoldsScore.ParticipantsandScore.PersonhoodThresholdat one pinned block into areadyToRegisterverdict.withScoreParticipant(signer)is the third signer on the shared origin-extension machinery: fee-free dispatch from a 0-balance participant account.One judgment call: the proposal's caller-supplied nonce was dropped in favour of reading it back out of the
CheckNonceslot PAPI filled, since the chain rejects any disagreement with nothing local to read.From review: the two new chain contracts are asserted against the paseo, previewnet and devnet descriptors in
packages/sdk,registerMessagerethrows a malformed address asProductIndividualityErrorinstead of PAPI's bareInvalid checksum,readRegistrationEligibilitytakes the account arm only, and the individuality skill doc gains a registration section.Message bytes and flow verified live on previewnet (spec 1000036) on 2026-08-28. 520 package tests pass; workspace tests + typecheck + biome clean.