Notes from @Dfinity-Bjoern and @dprats
Background context
- Node providers were given bonus neurons with ICP from the Foundation (not NNS) few months ago
- Node providers have been asking how to get access to unlock them, because they do not know how
- Node providers for help asking has reached fever pitch where Josh asked Bjorn, Luis, Andrew K and me what is a good path forward to start to help them
Proposed solution we gave Josh:
- Someone from RD make some updates to
quill
(which @Björn Tackmann can explain). We asked Sam and he said you would be best Candidate. Bjorn believes it’s a 1-2 day kind of simple changes.
- Bjorn, Kendall, and me QA The
quill
improvements and write docs for the node providers
- We demo this work this coming Thursday
Timeline
- This is urgent at the level that we need help outside regular COM, but we would not give anything to node providers until we are satisfied with the docs and experience
- Our goal is to demo something this Thursday to Josh. If it turns out it’s “good enough”, we’ll polish it and tell node providers that we have a plan for them. If it’s not good enough for Josh, we will try again.
Notes
NPs have NitroHSMs, just like the ones we use internally. agent-rs
and dfx
support those -- using PKCS#11 which is supported by the HSMs. NPs received a bonus neuron, locked up for 4 years, which they can control via the HSM. The problem is: doing this via dfx is somewhere between hard for some and impossible for others.
- it requires users to write/change textual Candid
- the PIN handling via environment variables is nice for pros but not for rookies
- it does not run on Windows.
The core idea of the ask is that quill
does what the NPs need (basic neuron handling) with better user experience. The obvious problem: quill
does not support the HSMs. But that should not be too hard to add, since agent-rs
does all the heavy lifting already. The code needed in (a fork of) quill
is more or less:
- get the path for the
opensc-pkcs11.{so,dylib}
-- that may be different on different platforms
- get some other parameters: slot (almost always 0 if we ask people to remove Yubikeys), key id (we had them all set it to 01), and PIN,
- initialize the Agent object using the PKCS#11 interface instead of loading the key from a file -- just like dfx or the now-defunct icx-nns do it.
Most NPs would probably not use the air-gapped mode, but I could also see a few of them appreciating it. So maybe it makes sense to just have a shorthand for send&sign.
That should be it -- for the first iteration.
Also, one reason I think forking quill
instead of just extending it is that I see one possible extension we may want to add: a "backup option". That would be a slightly bigger effort, and it may not be something we want to build into the general quill
, since being simple and easy to understand is a great feature for a tool like quill
. That's why I feel we may want to fork rather than extend -- but that's just my personal opinion and both seem plausible options.
Regarding the parameters, my intuitive starting point would be having the path of the library, the slot, and the key id in a config file -- they are likely pretty predictable in all cases. (Just if someone installs opensc on a Mac via brew instead of via DMG, they may want to change the path, or different Linux distros may use different paths.) And we could use the typical read-but-do-not-show-on-screen for the PIN input.