Repository navigation
Description
Split out of #454. That PR introduced the context scope, could not make it effective, and has since removed it: Granted ships as all | storage, and a manifest naming context parses as an unrecognised value. This issue owns introducing the scope for real — the vocabulary and the behaviour together.
The problem
A manifest granting context behaves identically to one granting nothing.
manifest_grants_scope (truapi-server/src/runtime.rs) is consulted by
create_account_proof and ring_vrf_sign
(runtime/capabilities/account.rs). Every request the grant admits is then refused one
layer down by require_owned_ring_vrf_key, in both authority implementations:
// runtime/signing_host.rs, mirrored in runtime/pairing_host.rs
if caller != handle.dot_ns_identifier {
return Err(RingVrfError::NotAllowlisted);
}That maps to the same wire error the grant seam itself would have produced, so the two
outcomes are byte-identical. The scope is inert.
Why the authority must re-adjudicate
The capability layer has already checked the grant, so the obvious fix is to relay that
decision to the authority as a flag on CreateProofAuthorityRequest /
RingVrfSignAuthorityRequest. That is not safe: on a paired host the authority request
arrives over the wire from another host, and a flag the caller sets is exactly what
require_owned_ring_vrf_key exists to stop. The component holding the keys has to decide
for itself.
So require_owned_ring_vrf_key becomes "the caller owns the key, or the owner's
manifest grants the caller context, and the user has not already refused" — resolved
against the chain by the authority, not handed to it.
What blocks that
The signing role cannot resolve a manifest.
install_asset_hub_genesis_hashis called only fromruntime/pairing_host.rs.
SigningHostConfighas no Asset Hub field, andSigningHostRuntime::with_chat_platform
never installs one, soasset_hub_chain_genesis_hash()isNoneand every manifest
lookup bails. A signing host would deny every grant.PairingHostholdsplatformandchainbut noRuntimeServicesat all.
Adding the field means changing SigningHostConfig::new(...), which is constructed at the
UniFFI boundary (truapi-server/src/native.rs) and the JS boundary
(truapi-server/src/wasm.rs). That bumps the FFI checksum, so iOS, Android, the JS host
and the CLI all have to supply an Asset Hub genesis hash for the signing role and ship
regenerated bindings — which is why it is not part of #454.
Scope
-
SigningHostConfigcarries the Asset Hub genesis hash;SigningHostRuntimeinstalls it - Hosts supply it: iOS, Android, JS,
truapi-hostCLI - Regenerate and commit UniFFI bindings (
make uniffi+sync-bindings.sh) -
PairingHostcan reach manifest resolution - Reintroduce
Granted::ContextandGrantedScope::Context, and thecontextvalue indocs/rfcs/granted-scopes.md -
require_owned_ring_vrf_keyadmits a granted caller in both authorities - A grant never overrides a denial the user already gave: read the stored
AccountAccessdecision before the manifest, read-only, so a grant lookup never raises the prompt that would settle aNotDeterminedone. RFC: Scoped grants in trustedProducts #454 had this and removed it with the scope -
create_account_proofchecks the session before the grant, matchingring_vrf_sign - Amend
docs/rfcs/granted-scopes.md:contextcovers proof and signing on the
granting product's keys, replacing the line that says signing has no scope of its own
Ordering hazard
create_account_proof checks the grant before the session while ring_vrf_sign checks
the session first. With no session, a granting target answers Rejected and a non-granting
one NotAllowlisted — a probe for who granted whom, and the thing the storage path's
uniform refusal was designed to prevent. Relaxing the authority makes this reachable, so
the reorder has to land with it, not after.
Tests to add
- A cached
contextgrant, a live session, and a foreign key handle: must succeed. This
is the test whose absence let the dead path ship — the existing
a_cached_context_grant_lets_a_foreign_proof_throughassertsRejectedonly because it
has no session, so it proves the call reached the session guard and nothing more. - A persisted
AccountAccess = Deniedplus acontextgrant: still refused, at the runtime
seam and again at the authority. ring_vrf_signon the grant path at all — currently untested.allsatisfyingcontextat the runtime seam, not only in the parser.
Activity
fix(server): resolve a grantee to its product and honour a prior denial
filvecchiato commentedon Sep 9, 2026
Depends on #660. The authority re-adjudicating a grant runs on the signing role, which cannot resolve a manifest until the Asset Hub genesis hash is installed there. #660 is that half, and it stands alone:
storageis already merged and already dark on those hosts.peetzweg commentedon Sep 9, 2026
We are a concrete consumer of this:
dim2.<tld>(the personhood game) registering a lite person needs ring-VRF proofs made withpeopl.<tld>'s lite key inpeopl's score context — forPeopleLite.set_alias_accountbefore the game's sign-up, again on later sign-ups when the ring moved, and for recognised persons'Game.sign_up_with_alias. Today every such request fromdim2answersNotAllowlisted(truapi-host 0.13.1), so the person leaves forpeopl, binds there and comes back, with a window in which the ring can move and send them back again. With acontextgrant frompeopltodim2we would do bind → sign-up in one press.What we need to know: whether the fix here is planned for the manifest path (as RFC-0024 describes) rather than a per-proof prompt, and roughly when it reaches truapi-host.
refactor: drop the context scope, leaving storage
test(server): cover ring_vrf_sign on the grant path, which #655 lists…
test(server): cover ring_vrf_sign on the grant path, which #655 lists…
test(server): cover ring_vrf_sign on the grant path, which #655 lists…
test(server): cover ring_vrf_sign on the grant path, which #655 lists…
test(server): cover ring_vrf_sign on the grant path, which #655 lists…