thanks, real receipts are exactly what was missing.
you read it right. slots16 says “every authority may authorize every frame”, and the security section already admits any authority can remove all others. your run shows why that’s not ok: a device key should not be able to drop the phrase key.
on where it goes, i agree with @liamwilliams that the permission belongs in the leaf predicate, and the scheme only says what the predicate means. where i’d differ is when it’s checked. after VERIFY is too late, your run shows it: the rogue tx is included, pays and spends the nonce, only the management frame reverts. sender frames run as the account and its code may not run again, so the limit has to be checked in VERIFY.
so the change i’d make to slots16: one bit in the slot word, above the 20-byte signer. if it is set, validate refuses any tx that has a sender frame targeting the account itself. i check the target, not the selector, because a selector check misses a code change, and a code change can bring back an old root. this closes the path slots16 itself opens to setAuthorities, an account with its own entry points has to guard those too. the bit is in the leaf, so a wallet that rebuilds the set also sees who can manage it (@chugarchugarr’s point in the magicians thread). bit clear means today’s behaviour, so the test vector root stays the same. setAuthorities would refuse a set where no slot can manage. one side effect: a key with the bit also can’t do a batch call through the account itself.
cost should be small, FRAMEPARAM is 2 gas per call and there are at most 64 frames, so maybe ~2k on top of your 75,100. richer scopes like transfer-only or a target list i’d keep out of slots16, every extra field is more VERIFY gas and more for the signer to show. a scheme that needs them can put them in its own predicate.
for your signer: under slots16 the setAuthorities frame data is the whole new set, all 16 words, and the signature hash covers it. so the device can recompute the root and show every slot with its bit from what it signs. a diff against the old set needs a proof of the current root, the full set doesn’t.
would you be up for trying the bit in your daisugi account, with the check in VERIFY instead of the management target? curious if the gas matches.
spec change: Add ERC: Account Authority Lifecycle by AnkushinDaniil · Pull Request #1979 · ethereum/ERCs · GitHub