{"assessments":[],"deployments":[],"fuzz":[],"identity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"interpretation":"Records acceptance and evidence. Neither completion nor an AI assessment establishes correctness, safety, or independent review.","jobId":"8a993c60-141a-49e4-aea6-73b79304bf25","kind":"skill:research-report","nodes":[{"acceptedSubmissionHash":"0ac87f02bf5e8451c4e9fceb88a0b163160384441a81b2cdde949eb626dbcaee","dependsOn":[],"execution":{"network":true,"profile":"none","requires":["network"],"skillHash":"3ddca93330036359dd721585e58e67820336a0398b7927b3c89369d6134f30f6","skillId":"research-report","tools":[]},"key":"research_report","kind":"code","role":"implement","skillHash":"3ddca93330036359dd721585e58e67820336a0398b7927b3c89369d6134f30f6","skillId":"research-report","state":"accepted"}],"objective":"Research question: in the FLOP devnet runtime (tzkv-runtime, spec 1014014), exactly how does pallet FlopSessionKeys decide what a session's delegate may call and how much it may spend, and how are ComputeChannel payments counted by it? As far as we know the pallet source is not published, so the answer has to be read out of the runtime code that the chain itself serves.\nWhy: uxp-labs/flop-devnet-lab builds a daily cap for an IMD worker's FLOP spend that the chain enforces. The design: the seat owner's account S creates a session for the worker's device key D with ComputeChannel as the only allowed pallet, and D opens and funds compute channels through execute_via_session. Your earlier report (https://github.com/Identity-md/research/tree/main/jobs/7350b953-b817-4a46-bc2c-a38eab44de55) described the pallet from the metadata and left the points below unknown. We then tested on devnet (https://github.com/uxp-labs/flop-devnet-lab/tree/main/research/2026-11-11-session-probe): a session with allowed_pallets [\"ComputeChannel\"] let ComputeChannel.timeout through to the pallet (ChannelNotFound) and refused System.remark (PalletNotAllowed); a failed inner call left the session nonce and counters unchanged and the delegate still paid the fee. FLOP Labs has not answered our questions. Our code will implement what you find and we will send real devnet transactions on the strength of it, so be exact. Label every statement [code] (read from the runtime code: give the function index or data offset and how you found it), [RPC] (read from the node or its metadata), [source] (public source or docs, with URL and commit), [inference] or [unknown]. \nThe input:\n- RPC wss://rpc.devnet.flop.network (public archive node, zkVerify 1.1.0, genesis 0x99c172c095340ace980631f9123544c6bebd4839f3437e463533422d8be2d631). Read only. Do not send transactions and do not use the faucet.\n- The runtime code: state_getStorage(\"0x3a636f6465\"). At finalized block 0xbb72c32265f39382b97e3b438c6cda181cf64fdb4015534457259d43a5b139ab it is 2538890 bytes, state_getStorageHash gives 0x6d47bb492fb404e33d7ea8feedf4ddf5a04ffbc9d5d3a64235641cd06144c1df, and it starts with the 8 bytes 52bc537646db8e05 followed by a zstd frame (28b52ffd). Check the hash, strip the prefix, decompress, and treat the result as WebAssembly. State the sha256 of the decompressed module.\n- Metadata V14 from state_getMetadata: 482132 bytes, sha256 f4fd2addba7fff1129483d0e66b8e6bc69141292f56443e201d3f073aab03444. Pallet indexes: System 0, Balances 4, Utility 30, Multisig 31, Proxy 32, FlopSessionKeys 94, AgentWallet 95, MinerStaking 97, ModelRegistry 101, ComputeChannel 103, AgentIdentity 106.\n- FlopSessionKeys calls: 0 create_session(delegate, spending_cap, per_tx_limit, daily_cap, duration_blocks, allowed_pallets), 1 revoke_session, 2 execute_via_session(owner, call, spend_amount, nonce), 3 force_revoke, 4 force_reset_circuit_breaker, 5 update_session_limits. Errors: 4 SpendingCapExceeded, 5 PerTxLimitExceeded, 6 DailyCapExceeded, 7 PalletNotAllowed, 15 InvalidSessionNonce, 18 SpendExceedsDeclared. Constants: SessionEpochLength 86400, MaxSessionDuration 864000, MaxAllowedPallets 16, CircuitBreakerPeriod 60, MaxTxs 100, MaxSpend 250 FLOP, MaxSessionRotationsPerHour 3.\n- ComputeChannel calls: 0 open_channel, 1 top_up_escrow, 2 settle, 3 force_settle, 4 finalize, 5 timeout(channel_id), 9 force_open(miner, model_hash, measured_root, decode_policy_hash, precision, agent_key, sla, escrow, nonce), 10 force_ack(channel_id, enclave_key), 11 expire_force_open(channel_id). Constants: AckWindow 600 blocks, MinForceOpenEscrowForFailedAck 0.05 FLOP, RefundPenalty 20 percent, EscrowPerReservationSlot 50 FLOP, pallet account \"modlflop/chn\". Events: 20 ForceOpenRequested(channel_id, agent, miner, escrow, ack_deadline), 21 ForceOpenExpired(channel_id, miner, refunded, failed_acks), 25 TimedOutRefunded(channel_id, refunded).\n- Public material that may help: github.com/flop-labs (yellowpaper, network, sdk, cli), docs.flop.network (for example /docs/send-to-specific-miner), the zkVerify runtime source, Substrate FRAME. If any FLOP pallet source is public after all, cite it at a commit and show that it matches the code on chain.\nQuestions.\nA. The deny list. Which pallets or single calls can execute_via_session never dispatch, whatever allowed_pallets says? Give the full list as it sits in the code. How is the inner call's pallet matched against allowed_pallets (the metadata pallet name as bytes, case, an index)? What happens to wrapping calls: Utility batch, batch_all, force_batch, as_derivative, Proxy.proxy, Multisig, Sudo, and a nested execute_via_session? Are the inner calls of a batch checked one by one, or is the wrapper refused, or let through unchecked? Can a session call create_session, update_session_limits or revoke_session for its owner?\nB. The spend meter. What does execute_via_session measure as spent: the owner's free balance before and after, free plus reserved, total issuance moves, or the declared spend_amount alone? Whose account is measured, the owner's or the delegate's? Which origin does the inner call run under? Are reserves and holds counted, or only transfers out? Is the transaction fee of the outer call counted, and who pays it? When the declared spend_amount is larger than the real fall, which of the two is added to the lifetime, daily and per call counters and to the circuit breaker? When the real fall is larger than declared, is the whole call rolled back (SpendExceedsDeclared)? When the owner's balance rises during a call, what happens? Does money that comes back later (a refund from expire_force_open, timeout or settle) ever lower the session's counters?\nC. The order of checks in execute_via_session and what each failure leaves behind: expiry, revoked, nonce, allowed pallet, per call limit, daily cap, lifetime cap, circuit breaker (per delegate, MaxTxs and MaxSpend per CircuitBreakerPeriod), then the dispatch and the check after it. Which storage changes survive a failed inner call? How does the daily window reset (lazy, from which block, on which call)? What trips the circuit breaker, what does a tripped breaker block, and how does it clear?\nD. ComputeChannel money, because this is what a session will pay. For open_channel, top_up_escrow and force_open: which account pays the escrow, is it a transfer to the pallet account or a reserve on the payer, and so would the meter in B see it? What must be true for force_open to succeed: must the miner be registered or staked, must model_hash, measured_root, decode_policy_hash and precision match a registered model or the miner's attestation, is there a smallest escrow, how is the channel id derived, what does nonce guard? What exactly does expire_force_open pay back and to whom: the full escrow, or the escrow less RefundPenalty? What does RefundPenalty apply to? What does MinForceOpenEscrowForFailedAck gate: is an expired force open with a smaller escrow accepted but not counted as a failed ack against the miner? What does a failed ack do to a miner (a counter, a penalty, a suspension, a slash) and where is it stored? Who may call expire_force_open and timeout, and when? We want to test a session on a real channel without harming a miner: say what the smallest harmless test is.\nE. A test plan. For each answer in A to D that you could not read with certainty, name the smallest devnet transaction or read that would settle it, with the expected outcome for each possible answer.\nThe deliverable: report.md with a short answer table first (question, answer, label, confidence), then the evidence per question. Put beside it the scripts you used (fetch, check the hash, decompress, find the functions) so that we can run them again, and the function indexes and data offsets you relied on. If the module has a name section or debug strings, use them. Where the code does not answer, say [unknown] and what you tried.","parentJobId":null,"planHash":"a5684b4b68d3fcb5b69f65063c2514353bb53fa1d8c35b4c9f55cad57c1940d2","previousHash":"052b8696f5d3d3c2a06c0ca934b196c843e00643e9ba4872dafd4798bff09c47","projectId":"8a993c60-141a-49e4-aea6-73b79304bf25","publication":{"commit":"f0ff3c24af5afe7876d323002379fe66d31f9a0d","deliveredAt":"2026-11-11T19:17:46.253Z","repoUrl":"https://github.com/Identity-md/research/blob/main/jobs/8a993c60-141a-49e4-aea6-73b79304bf25/_identitymd/README.md"},"receiptIdentity":{"adapter":"0xde152afb7db5373f34876e1499fbd893a82dd336","chainId":1,"collection":"0x0000ec93127baa929e58e97dd0095a2bfb38ec1d","registry":"0x8004a169fb4a3325136eb29fa0ceb6d2e539a432"},"registry":"0xb6d0a187b050fa5bb0b87033a203f37becf4a775","research":[],"schema":"identitymd-work-v1","signals":[],"site":null,"snapshotHash":"04c3f508bb7a87b9c6d153a8136d43869064863199570ac9e7d16c0bb37dd739","state":"completed","submissions":[{"artifacts":[{"bytes":14734,"hash":"a7c51bf4c390d5ce3f8e9bce23d34af3cdf3ae869d552c3b2e70f31de8752054","mediaType":"text/markdown","name":"report","path":"artifacts/report.md"}],"attempt":1,"bundleHash":"7ffa3f47ad662cca6f6da8c20099d31f25812e102e2786a12215ce0276d4fdbc","device":"1eba9b0f789fcc77","findings":[],"hash":"0ac87f02bf5e8451c4e9fceb88a0b163160384441a81b2cdde949eb626dbcaee","nodeId":"1446298c-8445-457d-bbe6-16111f61788e","outcome":"completed","summary":"I've written `artifacts/report.md` and `artifacts/README.md`, but only questions A, B, C and the plan in E are answered from the runtime code. **Question D (ComputeChannel money) is unanswered:** I ran out of time before reading those functions, so it is marked [unknown]. The scripts in `scripts/` are not committed, because git has no author identity on this machine and I didn't set one.\n\n**Checks:** the runtime code's hash matches what the node reports. The decompressed module has sha256 `bb19074278e9e14e1a30a8be3399ae5fdb7b5cafbe57e297b49b150502aba2f0`, and the metadata matches the brief. The module carries a table of function names (12,176), so every function cited in the report is named as well as numbered. `execute_via_session` is function 5182.\n\n**What the code shows:**\n- **A. Pallets a session can never call:** Utility, Proxy, Multisig, Sudo, Scheduler, EmergencyOverride and FlopSessionKeys. They are refused as whole pallets with PalletNotAllowed, so:\n  - batch, batch_all, force_batch, as_derivative, proxy, multisig and nested sessions are refused at the wrapper; the calls inside are never looked at;\n  - a session can't create, update or revoke sessions for its owner.\n- **A. Matching `allowed_pallets`:** the code compares the pallet's metadata name, ignoring case. That last point is fairly but not fully certain; test E1 settles it cheaply.\n- **B. Spend meter:** the code reads the owner's free and total balance before and after the inner call.\n  - If either falls by more than `spend_amount`, the call fails with SpendExceedsDeclared and everything is rolled back.\n  - The counters always add the declared `spend_amount`, not the real fall: the session record and the nonce are written before the inner call runs.\n  - Holds and reserves count, because they lower the free balance. A rise in balance counts as zero.\n- **C. Order of checks:** session exists → not revoked → nonce → not expired → per-call limit → daily cap → lifetime cap → deny list → `allowed_pallets` → circuit breaker → write the session and nonce → measure → run the inner call → measure → compare.\n  - The daily window is 86,400 blocks.\n  - The whole call is one storage transaction, so a failed inner call leaves no changes except the fee the delegate pays. This agrees with your devnet test.\n\n**Inferences rather than direct reads:** these are labelled as such in the report.\n- The measured account and the inner call's origin are the owner.\n- The outer fee is not counted.\n- Refunds never lower the counters.\n- The daily window resets lazily from the first call after it ends.\n- How the circuit breaker works inside: I didn't read its function, only its constants from the metadata.\n\n**What this means for your design:** set `spend_amount` to at least the escrow you expect. Declaring more is safe but uses up cap.\n\n**E. Test plan:** there is a devnet test for each open point. The smallest harmless one available now is `ComputeChannel.timeout(<an id that doesn't exist>)` with `spend_amount = 0`. Don't run the `force_open` test until D has been read from the code, because it may count a failed ack against a miner. The report says how to find the ComputeChannel functions and disassemble them.\n\nNo public FLOP pallet source was looked for, so every code claim comes from the on-chain module alone.\n\nThree scripts re-run the work: `scripts/fetch.sh` (fetch, check the hash, decompress), `scripts/wasm_sections.py` (list sections, dump function names) and `scripts/disasm.py` (disassemble chosen functions).\n\nThere are also untracked files in the repo root that I didn't create (`.bashrc`, `.gitmodules`, `.claude/`, …). I left them alone.\n\nNot delivered: artifacts/README.md. Under artifacts/, only this step's named outputs leave the machine.","treeHash":"dd03621dd5a6050e99fd10f8ea4751b20c199ba9","usage":{"cachedInputTokens":681819,"cost":{"source":"runtime","usdMicros":1184072},"inputTokens":30,"model":"claude-opus-5-5","outputTokens":23792,"runtime":"claude","turns":19,"wallClockMs":287266}}],"verification":[{"checks":[],"detail":"paths and tree verified; no suite was run for this kind of work","evaluation":"structural","profile":"none","status":"accepted","submissionHash":"0ac87f02bf5e8451c4e9fceb88a0b163160384441a81b2cdde949eb626dbcaee","verifiedTreeHash":"dd03621dd5a6050e99fd10f8ea4751b20c199ba9","verifierVersion":"0.1.0+34df1ac6"}]}