From 2be38d6bd863ba22cf26f54535fe67a4594a9f9b Mon Sep 17 00:00:00 2001 From: Abdulrahim Al Methiab Date: Thu, 16 Nov 2023 21:46:27 +0100 Subject: [PATCH] update pages --- .../decentralized_identifiers/alias.mdx | 4 +- .../decentralized_identifiers/create.mdx | 2 +- .../decentralized_identifiers/update.mdx | 347 +++++++++++------- .../getting_started/create_and_publish.mdx | 2 +- .../1.0/docs/getting_started/install.mdx | 4 +- .../1.0/docs/getting_started/overview.mdx | 6 - 6 files changed, 222 insertions(+), 143 deletions(-) diff --git a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/alias.mdx b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/alias.mdx index 1e7dcdf10a4..5f1d2acf60a 100644 --- a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/alias.mdx +++ b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/alias.mdx @@ -27,6 +27,6 @@ The arbitrary data stored in the `State Metadata` of the Alias output must be co ### Alias Id -Each Alias Output has an `Alias ID`. This ID is assigned after a transaction creates a new Alias Output. The actual DID is derived from this `Alias ID`, hence it is be unknown before publishing the transaction. Consequently, the DID inside the `State Metadata` will be replaced by the placeholder `did:0:0` to indicate self. +Each Alias Output has an `Alias ID`. This ID is assigned after a transaction creates a new Alias Output. The actual DID is derived from this `Alias ID`, hence it will be unknown before publishing the transaction. Consequently, the DID inside the `State Metadata` will be replaced by the placeholder `did:0:0` to indicate self. -If a transaction has an Alias Output as input, its `Alias ID` can be kept by one of its outputs. This feature is necessary for updating the DID Documents since the DID itself is derived from the Alias Output. +If a transaction has an Alias Output as input, its `Alias ID` can be kept by one of its outputs. This feature is necessary for updating the DID Documents since the DID itself is derived from the `Alias ID`. diff --git a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/create.mdx b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/create.mdx index 9ec7285033a..cf7379a967e 100644 --- a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/create.mdx +++ b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/create.mdx @@ -37,7 +37,7 @@ https://github.com/iotaledger/identity.rs/blob/main/bindings/wasm/examples/src/0 This examples creates a new address with funds using the _faucet_ on a private network. Next, it creates a new DID Document with a verification method. This DID Document is then published in an Alias Output making the DID available in the ledger state and resolvable by any node. -Note that using the faucet is only possible on private networks or public testnets. Once the Stardust update is released on the Shimmer network or the IOTA network, an output with actual Shimmer or IOTA funds is required to create a new Alias Output that represents a DID. +Note that using the faucet is only possible on private networks or public testnets. For Mainnet or Shimmer networks, an output with actual Shimmer or IOTA funds is required to create a new Alias Output that represents a DID. Updating the identity is also possible, which will be discussed in the next section, but all previous states of the DID Document will still be stored in permanodes or any third party recording the network activity. diff --git a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/update.mdx b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/update.mdx index 598f8e8a0fd..02aa1ffca35 100644 --- a/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/update.mdx +++ b/docs/build/identity.rs/1.0/docs/concepts/decentralized_identifiers/update.mdx @@ -92,18 +92,24 @@ The example above starts by [creating an identity](./create.mdx). ```rust -// Create a new client to interact with the IOTA ledger. -let client: Client = Client::builder().with_primary_node(NETWORK_ENDPOINT, None)?.finish()?; - -// Create a new secret manager backed by a Stronghold. -let mut secret_manager: SecretManager = SecretManager::Stronghold( -StrongholdSecretManager::builder() - .password("secure_password") - .build(random_stronghold_path())?, -); - -// Create a new DID in an Alias Output for us to modify. -let (_, did): (Address, StardustDID) = create_did(&client, &mut secret_manager).await?; + // Create a new client to interact with the IOTA ledger. + let client: Client = Client::builder() + .with_primary_node(API_ENDPOINT, None)? + .finish() + .await?; + + // Create a new secret manager backed by a Stronghold. + let mut secret_manager: SecretManager = SecretManager::Stronghold( + StrongholdSecretManager::builder() + .password(Password::from("secure_password".to_owned())) + .build(random_stronghold_path())?, + ); + + // Create a new DID in an Alias Output for us to modify. + let storage: MemStorage = MemStorage::new(JwkMemStore::new(), KeyIdMemstore::new()); + let (_, document, fragment_1): (Address, IotaDocument, String) = + create_did(&client, &mut secret_manager, &storage).await?; + let did: IotaDID = document.id().clone(); ``` @@ -111,7 +117,24 @@ let (_, did): (Address, StardustDID) = create_did(&client, &mut secret_manager). ```js -const { didClient, secretManager, did } = await createIdentity(); + const client = new Client({ + primaryNode: API_ENDPOINT, + localPow: true, + }); + const didClient = new IotaIdentityClient(client); + + // Generate a random mnemonic for our wallet. + const secretManager: MnemonicSecretManager = { + mnemonic: Utils.generateMnemonic(), + }; + + // Creates a new wallet and identity (see "0_create_did" example). + const storage: Storage = new Storage(new JwkMemStore(), new KeyIdMemStore()); + let { document, fragment } = await createDid( + client, + secretManager, + storage, + ); ``` @@ -122,19 +145,27 @@ This creates and publishes an Alias Output containing a DID Document with one ve ```json { "doc": { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", "verificationMethod": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-1", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "z94fP8Vo6qJtejpycjUcYtiSTbLGuCNYUTrjQX9hT2gSv" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "crv": "Ed25519", + "x": "475CGLtezvySFMCHhx6hE9S97MIYMLb4B-pbVEHaCtY" + } } ] }, "meta": { - "created": "2022-09-12T21:58:06Z", - "updated": "2022-09-12T21:58:06Z" + "created": "2023-11-16T20:40:03Z", + "updated": "2023-11-16T20:40:03Z", + "governorAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd", + "stateControllerAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd" } } ``` @@ -146,25 +177,29 @@ This creates and publishes an Alias Output containing a DID Document with one ve ```rust // Insert a new Ed25519 verification method in the DID document. - let keypair: KeyPair = KeyPair::new(KeyType::Ed25519)?; - let method: IotaVerificationMethod = - IotaVerificationMethod::new(document.id().clone(), keypair.type_(), keypair.public(), "#key-2")?; - document.insert_method(method, MethodScope::VerificationMethod)?; + let fragment_2: String = document + .generate_method( + &storage, + JwkMemStore::ED25519_KEY_TYPE, + JwsAlgorithm::EdDSA, + None, + MethodScope::VerificationMethod, + ) + .await?; ``` ```js -// Insert a new Ed25519 verification method in the DID document. -let keypair = new KeyPair(KeyType.Ed25519); -let method = new IotaVerificationMethod( - document.id(), - keypair.type(), - keypair.public(), - '#key-2', -); -document.insertMethod(method, MethodScope.VerificationMethod()); + // Insert a new Ed25519 verification method in the DID document. + await document.generateMethod( + storage, + JwkMemStore.ed25519KeyType(), + JwsAlgorithm.EdDSA, + "#key-2", + MethodScope.VerificationMethod(), + ); ``` @@ -175,25 +210,39 @@ This creates a new verification method that includes a newly generated Ed25519 p ```json { "doc": { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", "verificationMethod": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-1", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "z94fP8Vo6qJtejpycjUcYtiSTbLGuCNYUTrjQX9hT2gSv" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "crv": "Ed25519", + "x": "475CGLtezvySFMCHhx6hE9S97MIYMLb4B-pbVEHaCtY" + } }, { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "zHiCj7kbZdWznNvBhqxXwgoEChYseKrArLFdi5kPKAVRq" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "crv": "Ed25519", + "x": "h8ndZ4_Urmzf4xN4emqS8r5q4pAQvAh0k2YHq5JLBBo" + } } ] }, "meta": { - "created": "2022-09-12T21:58:06Z", - "updated": "2022-09-12T21:58:06Z" + "created": "2023-11-16T20:40:03Z", + "updated": "2023-11-16T20:40:03Z", + "governorAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd", + "stateControllerAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd" } } ``` @@ -208,10 +257,10 @@ Verification relationship can be attached to a verification method by referencin ```rust -// Attach a new method relationship to the existing method. +// Attach a new method relationship to the inserted method. document.attach_method_relationship( - &document.id().to_url().join("#key-1")?, - MethodRelationship::Authentication, + &document.id().to_url().join(format!("#{fragment_2}"))?, + MethodRelationship::Authentication, )?; ``` @@ -219,11 +268,11 @@ document.attach_method_relationship( ```js -// Attach a new method relationship to the existing method. -document.attachMethodRelationship( - did.join('#key-1'), - MethodRelationship.Authentication, -); +// Attach a new method relationship to the inserted method. +document.attach_method_relationship( + &document.id().to_url().join(format!("#{fragment_2}"))?, + MethodRelationship::Authentication, +)?; ``` @@ -234,28 +283,42 @@ This will add `Authentication` relationship to the verification method with the ```json { "doc": { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", "verificationMethod": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-1", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "z94fP8Vo6qJtejpycjUcYtiSTbLGuCNYUTrjQX9hT2gSv" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "crv": "Ed25519", + "x": "475CGLtezvySFMCHhx6hE9S97MIYMLb4B-pbVEHaCtY" + } }, { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "zHiCj7kbZdWznNvBhqxXwgoEChYseKrArLFdi5kPKAVRq" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "crv": "Ed25519", + "x": "h8ndZ4_Urmzf4xN4emqS8r5q4pAQvAh0k2YHq5JLBBo" + } } ], "authentication": [ - "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2" + "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE" ] }, "meta": { - "created": "2022-09-12T21:58:06Z", - "updated": "2022-09-12T21:58:06Z" + "created": "2023-11-16T20:40:03Z", + "updated": "2023-11-16T20:40:03Z", + "governorAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd", + "stateControllerAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd" } } ``` @@ -266,28 +329,28 @@ This will add `Authentication` relationship to the verification method with the ```rust -// Add a new Service. -let service: StardustService = Service::from_json_value(json!({ + // Add a new Service. + let service: Service = Service::from_json_value(json!({ "id": document.id().to_url().join("#linked-domain")?, "type": "LinkedDomains", "serviceEndpoint": "https://iota.org/" -}))?; -assert!(document.insert_service(service)); -document.metadata.updated = Some(Timestamp::now_utc()); + }))?; + assert!(document.insert_service(service).is_ok()); + document.metadata.updated = Some(Timestamp::now_utc()); ``` ```js -// Add a new Service. -const service: StardustService = new StardustService({ - id: did.join('#linked-domain'), - type: 'LinkedDomains', - serviceEndpoint: 'https://iota.org/', -}); -document.insertService(service); -document.setMetadataUpdated(Timestamp.nowUTC()); + // Add a new Service. + const service: Service = new Service({ + id: did.join("#linked-domain"), + type: "LinkedDomains", + serviceEndpoint: "https://iota.org/", + }); + document.insertService(service); + document.setMetadataUpdated(Timestamp.nowUTC()); ``` @@ -300,35 +363,49 @@ The updated Document with the newly created service looks as follows. ```json { "doc": { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", "verificationMethod": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-1", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "z94fP8Vo6qJtejpycjUcYtiSTbLGuCNYUTrjQX9hT2gSv" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "HZ11e0XacuODQw5FcoMHtcdxl8oXHbSnIhQMUgVzWBE", + "crv": "Ed25519", + "x": "475CGLtezvySFMCHhx6hE9S97MIYMLb4B-pbVEHaCtY" + } }, { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "zHiCj7kbZdWznNvBhqxXwgoEChYseKrArLFdi5kPKAVRq" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "crv": "Ed25519", + "x": "h8ndZ4_Urmzf4xN4emqS8r5q4pAQvAh0k2YHq5JLBBo" + } } ], "authentication": [ - "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2" + "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE" ], "service": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#linked-domain", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#linked-domain", "type": "LinkedDomains", "serviceEndpoint": "https://iota.org/" } ] }, "meta": { - "created": "2022-09-12T21:58:06Z", - "updated": "2022-09-12T21:58:19Z" + "created": "2023-11-16T20:40:03Z", + "updated": "2023-11-16T20:40:08Z", + "governorAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd", + "stateControllerAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd" } } ``` @@ -340,8 +417,8 @@ The updated Document with the newly created service looks as follows. ```rust // Remove a verification method. -let original_method: DIDUrl = document.resolve_method("key-1", None).unwrap().id().clone(); -document.remove_method(&original_method).unwrap(); +let original_method: DIDUrl = document.resolve_method(fragment_1.as_str(), None).unwrap().id().clone(); +document.purge_method(&storage, &original_method).await.unwrap(); ``` @@ -349,8 +426,8 @@ document.remove_method(&original_method).unwrap(); ```js // Remove a verification method. -let originalMethod = document.resolveMethod("key-1") as IotaVerificationMethod; -document.removeMethod(originalMethod?.id()); +let originalMethod = document.resolveMethod(fragment) as VerificationMethod; +await document.purgeMethod(storage, originalMethod?.id()); ``` @@ -361,29 +438,37 @@ This removes the original verification method with the fragment `key-1`. ```json { "doc": { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", "verificationMethod": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2", - "controller": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483", - "type": "Ed25519VerificationKey2018", - "publicKeyMultibase": "zHiCj7kbZdWznNvBhqxXwgoEChYseKrArLFdi5kPKAVRq" + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "controller": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a", + "type": "JsonWebKey", + "publicKeyJwk": { + "kty": "OKP", + "alg": "EdDSA", + "kid": "yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE", + "crv": "Ed25519", + "x": "h8ndZ4_Urmzf4xN4emqS8r5q4pAQvAh0k2YHq5JLBBo" + } } ], "authentication": [ - "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#key-2" + "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#yJz-sPlCmd432JKqK_hkiPml2kj22Jv0aAFy_2jJ8nE" ], "service": [ { - "id": "did:iota:rms:0x6fdcc441ab461aaee2ec1837ea5068fe2bc643a9ac0729a055ef5df42a762483#linked-domain", + "id": "did:iota:tst:0x19ed80fbd2a644fc2347e27e46e09d42b89df9b1ba09ae41832a9d47d686776a#linked-domain", "type": "LinkedDomains", "serviceEndpoint": "https://iota.org/" } ] }, "meta": { - "created": "2022-09-12T21:58:06Z", - "updated": "2022-09-12T21:58:19Z" + "created": "2023-11-16T20:40:03Z", + "updated": "2023-11-16T20:40:08Z", + "governorAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd", + "stateControllerAddress": "tst1qrjsnlg6nqd2kdzx4q880nl74jtrcajm7ae57zazl0l7ye09ahh4x6z9gtd" } } ``` @@ -396,40 +481,40 @@ Publish the updated DID Document inside the Alias Output taking into account the ```rust -// Resolve the latest output and update it with the given document. -let alias_output: AliasOutput = client.update_did_output(document.clone()).await?; - -// Because the size of the DID document increased, we have to increase the allocated storage deposit. -// This increases the deposit amount to the new minimum. -let rent_structure: RentStructure = client.get_rent_structure().await?; -let alias_output: AliasOutput = AliasOutputBuilder::from(&alias_output) - .with_minimum_storage_deposit(rent_structure) - .finish()?; - -// Publish the updated Alias Output. -let updated: StardustDocument = client.publish_did_output(&secret_manager, alias_output).await?; + // Resolve the latest output and update it with the given document. + let alias_output: AliasOutput = client.update_did_output(document.clone()).await?; + + // Because the size of the DID document increased, we have to increase the allocated storage deposit. + // This increases the deposit amount to the new minimum. + let rent_structure: RentStructure = client.get_rent_structure().await?; + let alias_output: AliasOutput = AliasOutputBuilder::from(&alias_output) + .with_minimum_storage_deposit(rent_structure) + .finish()?; + + // Publish the updated Alias Output. + let updated: IotaDocument = client.publish_did_output(&secret_manager, alias_output).await?; ``` ```js -// Resolve the latest output and update it with the given document. -const aliasOutput: IAliasOutput = await didClient.updateDidOutput(document); - -// Because the size of the DID document increased, we have to increase the allocated storage deposit. -// This increases the deposit amount to the new minimum. -const rentStructure: IRent = await didClient.getRentStructure(); -aliasOutput.amount = TransactionHelper.getStorageDeposit( - aliasOutput, - rentStructure, -).toString(); - -// Publish the output. -const updated: StardustDocument = await didClient.publishDidOutput( - secretManager, - aliasOutput, -); + // Resolve the latest output and update it with the given document. + let aliasOutput: AliasOutput = await didClient.updateDidOutput(document); + + // Because the size of the DID document increased, we have to increase the allocated storage deposit. + // This increases the deposit amount to the new minimum. + const rentStructure: IRent = await didClient.getRentStructure(); + + aliasOutput = await client.buildAliasOutput({ + ...aliasOutput, + amount: Utils.computeStorageDeposit(aliasOutput, rentStructure), + aliasId: aliasOutput.getAliasId(), + unlockConditions: aliasOutput.getUnlockConditions(), + }); + + // Publish the output. + const updated: IotaDocument = await didClient.publishDidOutput(secretManager, aliasOutput); ``` diff --git a/docs/build/identity.rs/1.0/docs/getting_started/create_and_publish.mdx b/docs/build/identity.rs/1.0/docs/getting_started/create_and_publish.mdx index 811a538514a..f248dd39f81 100644 --- a/docs/build/identity.rs/1.0/docs/getting_started/create_and_publish.mdx +++ b/docs/build/identity.rs/1.0/docs/getting_started/create_and_publish.mdx @@ -17,7 +17,7 @@ If you want to benefit from Self-Sovereign Identity, you need to create a [Decen ## Identity Generation Process -1. The generation of an identity requires a address with funds to cover the [Storage Deposit](../concepts/decentralized_identifiers/alias.mdx#storage-deposit). In test networks, a faucet can be used to request funds. +1. The generation of an identity requires an address with funds to cover the [Storage Deposit](../concepts/decentralized_identifiers/alias.mdx#storage-deposit). In test networks, a faucet can be used to request funds. 2. Create the content of the DID Document, a minimal document contains one verification method. 3. Construct a new [Alias Output](../concepts/decentralized_identifiers/alias.mdx) that includes the DID Document in the [State Metadata](../concepts/decentralized_identifiers/alias.mdx). 4. Publish the generated Alias Output. diff --git a/docs/build/identity.rs/1.0/docs/getting_started/install.mdx b/docs/build/identity.rs/1.0/docs/getting_started/install.mdx index c6afa7e3838..ff1835ffc5b 100644 --- a/docs/build/identity.rs/1.0/docs/getting_started/install.mdx +++ b/docs/build/identity.rs/1.0/docs/getting_started/install.mdx @@ -29,7 +29,7 @@ This version is published to crates.io and is **stable**, following semantic ver ```toml [dependencies] -identity_iota = { version = "0.7.0-alpha" } +identity_iota = { version = "v1.0.0" } ``` #### Development Release @@ -59,7 +59,7 @@ You can install the WASM binding of the IOTA Identity Library using [npm](https: This version published to npm is **stable**, following semantic versioning. ```bash -npm install @iota/identity-wasm@alpha +npm i @iota/identity-wasm@1.0.0 ``` You can find detailed installation instructions in the [Getting Started With WASM](../libraries/wasm/getting_started.mdx) section. diff --git a/docs/build/identity.rs/1.0/docs/getting_started/overview.mdx b/docs/build/identity.rs/1.0/docs/getting_started/overview.mdx index 2220e3deca9..d2ba9bca7e7 100644 --- a/docs/build/identity.rs/1.0/docs/getting_started/overview.mdx +++ b/docs/build/identity.rs/1.0/docs/getting_started/overview.mdx @@ -32,9 +32,3 @@ The IOTA Identity framework is developed in the Rust programming language. We al - [Rust](../libraries/rust/getting_started.mdx) - [WASM](../libraries/wasm/getting_started.mdx) - -## Applications - -The following applications are currently utilizing the IOTA Identity framework: - -- [Selv app](https://selv.iota.org/)