diff --git a/docs/create-multisig.md b/docs/create-multisig.md new file mode 100644 index 0000000..0010967 --- /dev/null +++ b/docs/create-multisig.md @@ -0,0 +1,65 @@ +# Creation of ORGiD compatible with multisig ownership + +## Create Gnosis Safe multisig + +https://gnosis-safe.io/app + +Use network supported by ORGiD: + +- Gnosis Chain +- Polygon +- Goerli + +## Import multisig config into project + +```bash +orgid --operation keys:import --keyType multisig +``` + +> Adding this types of keys does not require encryption password because an only wallet address will be saved to the project file. + +## Generate keys in PEM format + +```bash +openssl ecparam -name secp256k1 -genkey -out ./key.pem +openssl pkcs8 -in ./key.pem -topk8 -nocrypt -out ./pkcs8.pem +openssl ec -in ./pkcs8.pem -pubout > ./key.pub +``` + +## Import keys into project + +```bash +orgid --operation keys:import --keyType pem --pubPem ./key.pub --privPem ./pkcs8.pem +``` + +> Important! You can import `pkcs8`-formatted private key only + +## Bootstrap a new ORGiD + +```bash +orgid --operation bootstrap --output ./rawMultisigOrgId.json +``` + +> Important! During bootstrap process you must select a key tag of `multisig` type, that you imported earlier + +## Add your PEM key as delegate + +```bash +orgid --operation keys:add --keyType pem --delegated true +``` + +## Create ORGiD VC + +```bash +orgid --operation orgIdVc --output ./temp/multisigOrgIdVc.json --deploy ipfs +``` + +## Create ORGiD using multisig + +```bash +orgid --operation create +``` + +> You will be prompted for private key of one of the multisig wallet owners account. This key will not be saved in the project and used for the transaction signing only. + +> In the Gnosis Safe transactions queue will be added two transactions that have to be executed. diff --git a/docs/create.md b/docs/create.md index 0010967..c9cb2de 100644 --- a/docs/create.md +++ b/docs/create.md @@ -1,32 +1,26 @@ -# Creation of ORGiD compatible with multisig ownership +# Creation of ORGiD with delegated key -## Create Gnosis Safe multisig +> ORGiD VC can be signed using delegated key (verification method). Here the steps of how to make it in the right way -https://gnosis-safe.io/app +## Generation and registration of keys -Use network supported by ORGiD: +### Registration of EOA key pair -- Gnosis Chain -- Polygon -- Goerli - -## Import multisig config into project +### Generate keys in PEM format ```bash -orgid --operation keys:import --keyType multisig +openssl ecparam -name secp256k1 -genkey -out ./key.pem +openssl pkcs8 -in ./key.pem -topk8 -nocrypt -out ./pkcs8.pem +openssl ec -in ./pkcs8.pem -pubout > ./key.pub ``` -> Adding this types of keys does not require encryption password because an only wallet address will be saved to the project file. - -## Generate keys in PEM format +### Import EOA keys into project ```bash -openssl ecparam -name secp256k1 -genkey -out ./key.pem -openssl pkcs8 -in ./key.pem -topk8 -nocrypt -out ./pkcs8.pem -openssl ec -in ./pkcs8.pem -pubout > ./key.pub +orgid --operation keys:import --keyType ethereum ``` -## Import keys into project +### Import PEM keys into project ```bash orgid --operation keys:import --keyType pem --pubPem ./key.pub --privPem ./pkcs8.pem @@ -45,6 +39,7 @@ orgid --operation bootstrap --output ./rawMultisigOrgId.json ## Add your PEM key as delegate ```bash +orgid --operation keys:add --keyType ethereum --delegated true orgid --operation keys:add --keyType pem --delegated true ``` @@ -59,7 +54,3 @@ orgid --operation orgIdVc --output ./temp/multisigOrgIdVc.json --deploy ipfs ```bash orgid --operation create ``` - -> You will be prompted for private key of one of the multisig wallet owners account. This key will not be saved in the project and used for the transaction signing only. - -> In the Gnosis Safe transactions queue will be added two transactions that have to be executed. diff --git a/docs/index.md b/docs/index.md index 5c9bd02..2a675b8 100644 --- a/docs/index.md +++ b/docs/index.md @@ -69,7 +69,7 @@ npx orgid --operation - [ORGiD creation](#orgid-creation) - [ORGiD update](#orgid-update) - [ORGiD DID resolve](#orgid-did-resolve) - - [ORGiD ownership transfer](#orgid-ownership-transfer) + - [Extended Docs](#extended-docs) ## CLI configuration @@ -91,13 +91,10 @@ This operation allows adding network providers with their JSON RPC APIs. When yo > Currently, `ethereum` and `EC PEM` keys pair type are the only supported. -The CLI is allows to add key pair in the following format: +The CLI is allows to add key pair in the PEM format: -- `publicKey`: account address (or EC PEM) -- `privateKey`: account private key. For example, you can export this key from Metamask wallet. When you add a private key you will be prompted to set a password to encrypt this sensitive data (or EC PEM) -- `tag`: unique key id that will be used across operations and verification methods - -> When you need to update a key data just use the same `tag` and a key pair record will be overwritten. +- `pubPem`: EC public key in PEM format +- `privPem`: EC private key in PEM format ## ORG.JSON bootstrap @@ -121,14 +118,14 @@ During the interaction, the CLI will prompt to fill mandatory or whole profile p Parameters: -- `--payload`: a path to ORG.JSON file +- `--payload`: a path to ORG.JSON file (optional) - `--output`: a path where to save an ORGID VC - `--deploy` (optional): deployment type. With an `ipfs` value means that created ORGiD VC will be deployed to IPFS right after creation Signing of the ORG.JSON using the defined verification method. Current version of the utility supports the following verification methods: - `EcdsaSecp256k1RecoveryMethod2020`: signature made with blockchain account -- `EcdsaSecp256k1VerificationKey2019`: (**not supported yet, will be added soon**) signature made with EC private key. This method type will be used for `capabilityDelegation` flow +- `EcdsaSecp256k1VerificationKey2019`: signature made with EC private key. This method type will be used for `capabilityDelegation` flow Verification method will be automatically loaded from the ORG.JSON file. @@ -174,8 +171,8 @@ Working the same way as for an ORGiD creation but send a transaction for the ORG Allows to make an ORGiD DID resolution. `` must be a valid DID that looks like `did:orgid:4:0xd6a429d09a197adafbe8c0d751e2e26711fe870f0ee126ae236481fc2b40895b`. The related network provider (`4`) must be registered before. If you have encrypted your provider URI you will be prompted for password during the resolution flow. -## ORGiD ownership transfer -**`--operation transfer --newOwner `** +## Extended Docs -Makes the transfer of the ORGiD to the new owner. During the interaction, a user will be prompted to choose an ORGiD from the list of registered ORGiDs. The related to the chosen ORGiD network provider must be registered before. If you have encrypted your provider URI you will be prompted for a password during the resolution flow. +- [Creation of ORGiD with delegated key](create.md) +- [Creation of ORGiD compatible with multisig ownership](create-multisig.md)