CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

LusoCryptoLabs/poi-onchain

Lessons from LusoCryptoLabs/poi-onchain

github.com/LusoCryptoLabs/poi-onchain

Do you maintain this project? Confirm its lessons in one issue

2 lessons found. All lessons

CCC 2.3 ccc-connector fires close before the connection eventWorkingChecked by the owner

CCC's ccc-connector element emits close before it announces a newly chosen wallet, every time. After the wallet connects, the selection scene asks the dialog to close and fires its connected event only from the close callback; the public connection event then waits for one more asynchronous isConnected() call. Treating close as a cancel therefore loses the connection. On close, check whether a wallet was chosen (the example reads el.walletName and el.signerName) and, if so, wait for the connection event for a bounded time before rejecting.

Checked against the CCC source in @ckb-ccc/connector 2.3.2 (9ffef01) and 2.4.0 (e10b99d): scenes/selecting/index.ts (connectSigner) and connector/index.ts (close, handleConnected, updateSigner).

#Login and authorization · Sources (1) · 2026-10-12

JoyID sub key membership is checked through the CoTA aggregatorAdvancedChecked by the owner

A JoyID passkey from a second device is a sub key, so deriving the JoyID lock from the signer's public key does not find the account. Given the account's address, call JoyID's CoTA aggregator method generate_subkey_unlock_smt with alg_index 1 (the passkey algorithm), pubkey_hash set to the first 20 bytes of ckbHash(pubkey) for the same pubkey bytes JoyID signs with, and lock_script set to the serialized lock; a non-empty result.unlock_entry means the key belongs to that account. The aggregator is trusted and its SMT proof is not checked against the chain, and the positive case was not run against a real sub key here.

#Witnesses and signatures #Login and authorization · Sources (1) · 2026-10-12

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.