Webnative-Filecoin Suggested Task-Breakdown for Phase 2
Task breakdown for epic transfer FIL natively in browser:
- demonstrate holding a Filecoin account non-custodially in the browser (starting from new user with empty Keychain)
- generate BLS key in webnative-filecoin in browser using noble-bls12-381
- generate random 32 bytes for private BLS key, generate random 32 bytes for
secretSeed
to send to Cosigner on requests - store both 32 byte secrets in
Keychain
dir on WNFS; either underpublicKeyUser.json
orfilecoinTestnetDefault.json
(assuming no path separation)
- generate random 32 bytes for private BLS key, generate random 32 bytes for
- request cosigner over API REST endpoint to generate BLS public key, and receive response from cosigner with its public key (opt. and signature of
publicKeyUser
signed withpublicKeyCosigner
to protect against Rogue Key attack - can be stretch goal)- this request to cosigner should have a UCAN for “keychain” resource; this can mimicked by the existing “WNFS” resource by assuming an implication on attenuation:
this way, it suffices to use the existing UCAN code, and wrap it in a check for the"att": [ { "wnfs": "alice.fission.name/private/Keychain", "cap": "APPEND" } ] => "att": [ { "keychain": "alice.fission.name/private/Keychain", "cap": "ADMIN" } ]
Keychain
directory.
More details on a proposal for UCAN flow on Talk forum.
This UCAN proves the ownership of DID of Alice; later improvements can narrow attenuation to specificPublicKeyUser
. - recommendation to reduce code: to bypass creating persistant storage in cosigner, it suffices for
privateKeyCosigner
to be calculated as
for production code, memCache can speed up short-lived subsequent requests, but onlyprivateKeyCosigner = Blake2b-256( RSASign(didUser + pubKeyUser + secretSeedUser, rsaPrivDidKeyCosigner))
rsaPrivDidKeyCosigner
needs to be backed up. - in browser (linearly) aggregate the two public BLS keys (using noble-bls12-381) and store cosigner details (did, public key) and aggregated public key in keystore file on WNFS on Keychain dir. (suggestion)
- this request to cosigner should have a UCAN for “keychain” resource; this can mimicked by the existing “WNFS” resource by assuming an implication on attenuation:
- generate BLS key in webnative-filecoin in browser using noble-bls12-381
- demonstrate sending FIL from user account to another account (on testnet)
- from
webnative.transfer(..)
create a Filecoin message with parameters, and sign with BLSprivateKeyUser
. - request cosigner to cosign this message, passing also
secretSeed
in request to allow cosigner to calculate its private key. - This request should be accompagnied with a new UCAN issued to
did:key:zCosigner
associated with this Filecoin account, but attentuated to
but this requires a translation between “WNFS” resources to “Keychain” resources. I put a proposal for that UCAN delegation flow here -same link- on Talk forum."att": [ { "keychain": "alice.fission.name/private/Keychain", "cap": "COSIGN" } ]
To keep things simple for Phase2, propose simply attentuating
to"att": [ { "wnfs": "alice.fission.name/private/Keychain", "cap": "APPEND" } ]
aud: did:key:zCosigner
but for a short duration, and if the AES key isn’t shared with Cosigner, then effectively it has neither read or write ability.
- from