{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml","index-page-items":"/docs/tutorials/compliance-features/manage-credentials_index-page-items"},"props":{"metadata":{"markdoc":{"tagList":["amendment-disclaimer","repo-link","tabs","tab","code-snippet"]},"redocly_category":"Documentation","type":"markdown","indexPage":true},"seo":{"title":"Manage Credentials","siteUrl":"https://xrpl.org/","llmstxt":{"hide":false,"title":"XRPL Developer Portal & Documentation","description":"Explore XRP Ledger documentation, blogs, and other blockchain developer resources needed to start building and integrating with the ledger.","details":{"content":"XRP Ledger concepts, use cases, tutorials, references, and other blockchain developer resources. Also, stay up to date with release announcements and more through the XRPL Blog."},"sections":[{"title":"Introduction","description":"A high-level introduction to the XRP Ledger.","includeFiles":["docs/introduction/**/*.*","about/faq.md"],"excludeFiles":["docs/introduction/index.md"]},{"title":"Use Cases","description":"Real-world applications and business scenarios for the XRP Ledger.","includeFiles":["docs/use-cases/**/*.*"],"excludeFiles":["docs/use-cases/index.md","docs/use-cases/defi/index.md"]},{"title":"Concepts","description":"Core concepts including accounts, tokens, transactions, consensus, and more.","includeFiles":["docs/concepts/**/*.*"],"excludeFiles":["docs/concepts/index.md","docs/concepts/decentralized-storage/index.md","docs/concepts/payment-types/index.md"]},{"title":"Tutorials","description":"Step-by-step guides for building on the XRP Ledger in JavaScript, Python, Go, and more.","includeFiles":["docs/tutorials/**/*.*"],"excludeFiles":[]},{"title":"References","description":"Protocol specification, transaction types, ledger entries, and API methods.","includeFiles":["docs/references/**/*.*"],"excludeFiles":["docs/references/xrp-api.md","docs/references/data-api.md","docs/references/protocol/index.md","docs/references/protocol/ledger-data/ledger-entry-types/index.md","docs/references/protocol/transactions/index.md","docs/references/protocol/transactions/types/index.md","docs/references/http-websocket-apis/api-conventions/index.md","docs/references/http-websocket-apis/public-api-methods/*/index.md","docs/references/http-websocket-apis/admin-api-methods/*/index.md"]},{"title":"Infrastructure","description":"Install, configure, and troubleshoot rippled and Clio servers.","includeFiles":["docs/infrastructure/**/*.*"],"excludeFiles":["docs/infrastructure/index.md","docs/infrastructure/*/index.md","docs/infrastructure/installation/build-run-rippled-in-reporting-mode.md","docs/infrastructure/configuration/data-retention/index.md","docs/infrastructure/configuration/server-modes/index.md"]},{"title":"Blog (2023+)","description":"Recent XRPL Blog posts (showing 2023 and newer).","includeFiles":["blog/2023/**/*.*","blog/2024/**/*.*","blog/2025/**/*.*","blog/2026/**/*.*"],"excludeFiles":[]},{"title":"Resources","description":"Developer resources and contribution guidelines.","includeFiles":["resources/**/*.*"],"excludeFiles":["resources/index.md"]}],"excludeFiles":[]},"description":"Issue, accept, and delete a credential on the XRP Ledger."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"manage-credentials","__idx":0},"children":["Manage Credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This tutorial shows you how to manage the full lifecycle of ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/decentralized-storage/credentials"},"children":["Credentials"]}," on the XRP Ledger: issuing a credential to a subject, accepting the credential, and deleting it."]},{"$$mdtype":"Tag","name":"AmendmentDisclaimer","attributes":{"name":"Credentials","compact":false,"mode":""},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"goals","__idx":1},"children":["Goals"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By the end of this tutorial, you will be able to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Issue a credential to a subject account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Accept a credential as the subject."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Delete a credential from the ledger."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To complete this tutorial, you should:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Have a basic understanding of the XRP Ledger."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Have an XRP Ledger client library set up in your development environment. This page provides examples for the following:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Java"]}," with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/XRPLF/xrpl4j"},"children":["xrpl4j library"]},". See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/get-started/get-started-java"},"children":["Get Started Using Java"]}," for setup steps."]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"source-code","__idx":3},"children":["Source Code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can find the complete source code for this tutorial's examples in the ",{"$$mdtype":"Tag","name":"RepoLink","attributes":{"path":"_code-samples/credential/","github_fork":"https://github.com/XRPLF/xrpl-dev-portal","github_branch":"master"},"children":["code samples section of this website's repository"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"steps","__idx":4},"children":["Steps"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"1-install-dependencies","__idx":5},"children":["1. Install dependencies"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["From the code sample folder, use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mvn"]}," to install dependencies."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"mvn install\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"2-set-up-client-and-fund-accounts","__idx":6},"children":["2. Set up client and fund accounts"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get started, import the necessary libraries and instantiate a client to connect to the XRPL Testnet. This example imports:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["xrpl4j"]},": Used for XRPL client connection, transaction submission, and wallet handling."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OkHttp"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Guava"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Jackson"]},": Used for HTTP URL construction, unsigned integer arithmetic, and JSON serialization."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["java.util.concurrent"]},": Used for async operations."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"package com.example.xrpl;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.google.common.primitives.UnsignedInteger;\nimport okhttp3.HttpUrl;\nimport org.xrpl.xrpl4j.client.JsonRpcClientErrorException;\nimport org.xrpl.xrpl4j.client.XrplClient;\nimport org.xrpl.xrpl4j.client.faucet.FaucetClient;\nimport org.xrpl.xrpl4j.client.faucet.FundAccountRequest;\nimport org.xrpl.xrpl4j.crypto.keys.KeyPair;\nimport org.xrpl.xrpl4j.crypto.keys.PrivateKey;\nimport org.xrpl.xrpl4j.crypto.keys.Seed;\nimport org.xrpl.xrpl4j.crypto.signing.SignatureService;\nimport org.xrpl.xrpl4j.crypto.signing.SingleSignedTransaction;\nimport org.xrpl.xrpl4j.crypto.signing.bc.BcSignatureService;\nimport org.xrpl.xrpl4j.model.client.Finality;\nimport org.xrpl.xrpl4j.model.client.FinalityStatus;\nimport org.xrpl.xrpl4j.model.client.accounts.AccountInfoRequestParams;\nimport org.xrpl.xrpl4j.model.client.accounts.AccountInfoResult;\nimport org.xrpl.xrpl4j.model.client.common.LedgerSpecifier;\nimport org.xrpl.xrpl4j.model.client.fees.FeeUtils;\nimport org.xrpl.xrpl4j.model.client.ledger.LedgerRequestParams;\nimport org.xrpl.xrpl4j.model.client.transactions.SubmitResult;\nimport org.xrpl.xrpl4j.model.client.transactions.TransactionRequestParams;\nimport org.xrpl.xrpl4j.model.client.transactions.TransactionResult;\nimport org.xrpl.xrpl4j.model.jackson.ObjectMapperFactory;\nimport org.xrpl.xrpl4j.model.transactions.Address;\nimport org.xrpl.xrpl4j.model.transactions.CredentialAccept;\nimport org.xrpl.xrpl4j.model.transactions.CredentialCreate;\nimport org.xrpl.xrpl4j.model.transactions.CredentialDelete;\nimport org.xrpl.xrpl4j.model.transactions.CredentialType;\nimport org.xrpl.xrpl4j.model.transactions.Transaction;\nimport org.xrpl.xrpl4j.model.transactions.TransactionResultCodes;\nimport org.xrpl.xrpl4j.model.transactions.XrpCurrencyAmount;\n\nimport java.util.concurrent.CompletableFuture;\nimport java.util.concurrent.CompletionException;"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"/**\n * This code sample demonstrates the Credential lifecycle on the XRPL.\n * It issues a credential to a subject, accepts the credential, and then deletes it.\n */\npublic class ManageCredentials {\n\n  private static final HttpUrl NETWORK_URL = HttpUrl.get(\"https://s.altnet.rippletest.net:51234/\");\n  private static final HttpUrl FAUCET_URL = HttpUrl.get(\"https://faucet.altnet.rippletest.net\");\n  private static final String EXPLORER_BASE = \"https://testnet.xrpl.org/transactions/\";\n\n  private static final CredentialType CREDENTIAL_TYPE = CredentialType.ofPlainText(\"kyc-trader\");\n\n  public static void main(String[] args) {\n    try {\n      run();\n    } catch (Exception e) {\n      // Unwrap CompletionException so async failures print the same clean message\n      // as sync failures. CompletableFuture.join() wraps exceptions in CompletionException\n      Throwable cause = (e instanceof CompletionException && e.getCause() != null)\n        ? e.getCause() : e;\n      System.err.println(\"Error: \" + cause.getMessage());\n      System.exit(1);\n    }\n  }\n\n  private static void run() {\n\n    // ----- Connect to Testnet and fund accounts -----\n    XrplClient xrplClient = new XrplClient(NETWORK_URL);\n    System.out.println(\"\\n=== Funding issuer and subject accounts on Testnet ===\\n\");\n\n    CompletableFuture<KeyPair> issuerFuture = CompletableFuture.supplyAsync(\n      () -> createAndFundWallet(xrplClient));\n    CompletableFuture<KeyPair> subjectFuture = CompletableFuture.supplyAsync(\n      () -> createAndFundWallet(xrplClient));\n    CompletableFuture.allOf(issuerFuture, subjectFuture).join();\n\n    KeyPair issuer = issuerFuture.join();\n    KeyPair subject = subjectFuture.join();\n    Address issuerAddress = issuer.publicKey().deriveAddress();\n    Address subjectAddress = subject.publicKey().deriveAddress();\n    System.out.println(\"Issuer:  \" + issuerAddress);\n    System.out.println(\"Subject: \" + subjectAddress);\n\n    "},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createAndFundWallet()"]}," helper generates an Ed25519 keypair, funds it from the Testnet faucet, and polls Testnet until the account is visible on a validated ledger."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"  // Generates a new Ed25519 keypair, funds it from the Testnet faucet, and\n  // returns the keypair once the account is visible on a validated ledger.\n  private static KeyPair createAndFundWallet(XrplClient xrplClient) {\n    KeyPair keyPair = Seed.ed25519Seed().deriveKeyPair();\n    Address address = keyPair.publicKey().deriveAddress();\n    FaucetClient faucetClient = FaucetClient.construct(FAUCET_URL);\n    faucetClient.fundAccount(FundAccountRequest.of(address));\n\n    for (int attempt = 0; attempt < 20; attempt++) {\n      try {\n        xrplClient.accountInfo(AccountInfoRequestParams.builder()\n          .account(address)\n          .ledgerSpecifier(LedgerSpecifier.VALIDATED)\n          .build());\n        return keyPair;\n      } catch (JsonRpcClientErrorException notYetVisible) {\n        try {\n          Thread.sleep(1_000L);\n        } catch (InterruptedException e) {\n          Thread.currentThread().interrupt();\n          throw new RuntimeException(\"Account polling interrupted for \" + address + \". \" + e.getMessage(), e);\n        }\n      }\n    }\n    throw new IllegalStateException(\"Faucet funding for \" + address + \" did not confirm in time.\");\n  }\n\n  "},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"3-prepare-credentialcreate-transaction","__idx":7},"children":["3. Prepare CredentialCreate transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialcreate"},"children":["CredentialCreate transaction"]}," object."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Prepare CredentialCreate transaction -----\n    System.out.println(\"\\n=== Preparing CredentialCreate transaction ===\\n\");\n\n    CredentialCreate createTx = CredentialCreate.builder()\n      .account(issuerAddress)\n      .subject(subjectAddress)\n      .credentialType(CREDENTIAL_TYPE)\n      .sequence(accountSequence(xrplClient, issuerAddress))\n      .fee(recommendedFee(xrplClient))\n      .lastLedgerSequence(lastLedgerSequence(xrplClient))\n      .signingPublicKey(issuer.publicKey())\n      .build();\n    printTransactionJson(createTx);\n\n    "},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The credential is identified by the issuer, subject, and credential type (written as a hexadecimal string)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"4-submit-credentialcreate-transaction","__idx":8},"children":["4. Submit CredentialCreate transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sign and submit the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CredentialCreate"]}," transaction to the XRP Ledger."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Sign, submit, and wait for CredentialCreate validation -----\n    System.out.println(\"\\n=== Submitting CredentialCreate transaction ===\\n\");\n\n    TransactionResult<CredentialCreate> createResult = signSubmitAndWait(\n      xrplClient, issuer, createTx, CredentialCreate.class);\n\n    requireSuccess(createResult);\n\n    "},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["signSubmitAndWait()"]}," helper signs a transaction, submits it, and polls Testnet until it reaches a validated ledger."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"  // Signs and submits a transaction, then polls the network until\n  // the transaction reaches a validated state.\n  private static <T extends Transaction> TransactionResult<T> signSubmitAndWait(\n    XrplClient xrplClient,\n    KeyPair signer,\n    T transaction,\n    Class<T> transactionType\n  ) {\n    SignatureService<PrivateKey> signatureService = new BcSignatureService();\n\n    UnsignedInteger lastLedgerSequence = transaction.lastLedgerSequence()\n      .orElseThrow(() -> new IllegalArgumentException(\n        \"Must set LastLedgerSequence for polling expiration\"));\n\n    try {\n      SingleSignedTransaction<T> signed = signatureService.sign(signer.privateKey(), transaction);\n      SubmitResult<T> submit = xrplClient.submit(signed);\n\n      if (!TransactionResultCodes.TES_SUCCESS.equals(submit.engineResult())) {\n        throw new IllegalStateException(\n          \"Submission rejected. \" + submit.engineResult() + \" — \" + submit.engineResultMessage());\n      }\n\n      Finality finality;\n      do {\n        Thread.sleep(1_000L);\n        finality = xrplClient.isFinal(\n          signed.hash(),\n          submit.validatedLedgerIndex(),\n          lastLedgerSequence,\n          transaction.sequence(),\n          signer.publicKey().deriveAddress()\n        );\n      } while (finality.finalityStatus() == FinalityStatus.NOT_FINAL);\n\n      if (finality.finalityStatus() != FinalityStatus.VALIDATED_SUCCESS) {\n        throw new IllegalStateException(\n          \"Transaction failed with status \" + finality.finalityStatus()\n            + \". Result code: \" + finality.resultCode().orElse(\"unknown\"));\n      }\n\n      // Retrieve the transaction result; isFinal() only returns finality status\n      return xrplClient.transaction(\n        TransactionRequestParams.of(signed.hash()), transactionType);\n\n    } catch (InterruptedException e) {\n      Thread.currentThread().interrupt();\n      throw new RuntimeException(\"Transaction polling interrupted. \" + e.getMessage(), e);\n    } catch (JsonRpcClientErrorException | JsonProcessingException e) {\n      throw new RuntimeException(\"Transaction processing failed. \" + e.getMessage(), e);\n    }\n  }\n\n  "},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["requireSuccess"]}," helper verifies that the transaction succeeded with a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tesSUCCESS"]}," result code and posts a link to the transaction metadata on the XRPL Explorer."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"  // Checks for a tesSUCCESS result code. If true, prints an explorer\n  // link. Otherwise, throws an error.\n  private static void requireSuccess(TransactionResult<?> result) {\n    String code = result.metadata().get().transactionResult();\n    String txType = result.transaction().transactionType().value();\n    if (!TransactionResultCodes.TES_SUCCESS.equals(code)) {\n      throw new IllegalStateException(txType + \" failed with error code \" + code);\n    }\n    System.out.println(txType + \" succeeded!\");\n    System.out.println(\"Explorer: \" + EXPLORER_BASE + result.hash());\n  }\n}\n"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"5-prepare-credentialaccept-transaction","__idx":9},"children":["5. Prepare CredentialAccept transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialaccept"},"children":["CredentialAccept transaction"]}," object. The subject account must accept the credential to make it valid."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Prepare CredentialAccept transaction -----\n    System.out.println(\"\\n=== Preparing CredentialAccept transaction ===\\n\");\n\n    CredentialAccept acceptTx = CredentialAccept.builder()\n      .account(subjectAddress)\n      .issuer(issuerAddress)\n      .credentialType(CREDENTIAL_TYPE)\n      .sequence(accountSequence(xrplClient, subjectAddress))\n      .fee(recommendedFee(xrplClient))\n      .lastLedgerSequence(lastLedgerSequence(xrplClient))\n      .signingPublicKey(subject.publicKey())\n      .build();\n    printTransactionJson(acceptTx);\n\n    "},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"6-submit-credentialaccept-transaction","__idx":10},"children":["6. Submit CredentialAccept transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sign and submit the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CredentialAccept"]}," transaction to the XRP Ledger."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Sign, Submit, and wait for CredentialAccept validation -----\n    System.out.println(\"\\n=== Submitting CredentialAccept transaction ===\\n\");\n\n    TransactionResult<CredentialAccept> acceptResult = signSubmitAndWait(\n      xrplClient, subject, acceptTx, CredentialAccept.class);\n\n    requireSuccess(acceptResult);\n\n    "},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"7-prepare-credentialdelete-transaction","__idx":11},"children":["7. Prepare CredentialDelete transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialdelete"},"children":["CredentialDelete transaction"]}," object. Either the issuer or the subject can delete a credential."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Prepare CredentialDelete transaction -----\n    System.out.println(\"\\n=== Preparing CredentialDelete transaction ===\\n\");\n\n    CredentialDelete deleteTx = CredentialDelete.builder()\n      .account(subjectAddress)\n      .issuer(issuerAddress)\n      .credentialType(CREDENTIAL_TYPE)\n      .sequence(accountSequence(xrplClient, subjectAddress))\n      .fee(recommendedFee(xrplClient))\n      .lastLedgerSequence(lastLedgerSequence(xrplClient))\n      .signingPublicKey(subject.publicKey())\n      .build();\n    printTransactionJson(deleteTx);\n\n    "},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"8-submit-credentialdelete-transaction","__idx":12},"children":["8. Submit CredentialDelete transaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Sign and submit the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CredentialDelete"]}," transaction to the XRP Ledger."]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"label":"Java","disable":false},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/_code-samples/credential/java/src/main/java/com/example/xrpl/ManageCredentials.java","language":"java","header":{"controls":{"copy":{}}},"lang":"java","source":"    // ----- Sign, Submit, and wait for CredentialDelete validation -----\n    System.out.println(\"\\n=== Submitting CredentialDelete transaction ===\\n\");\n\n    TransactionResult<CredentialDelete> deleteResult = signSubmitAndWait(\n      xrplClient, subject, deleteTx, CredentialDelete.class);\n\n    requireSuccess(deleteResult);\n  }\n\n  "},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"see-also","__idx":13},"children":["See Also"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Concepts"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/decentralized-storage/credentials"},"children":["Credentials"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tutorials"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/tutorials/compliance-features/verify-credentials"},"children":["Verify Credentials"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["References"]},":"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialcreate"},"children":["CredentialCreate transaction"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialaccept"},"children":["CredentialAccept transaction"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/references/protocol/transactions/types/credentialdelete"},"children":["CredentialDelete transaction"]}]}]}]},"headings":[{"value":"Manage Credentials","id":"manage-credentials","depth":1},{"value":"Goals","id":"goals","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Source Code","id":"source-code","depth":2},{"value":"Steps","id":"steps","depth":2},{"value":"1. Install dependencies","id":"1-install-dependencies","depth":3},{"value":"2. Set up client and fund accounts","id":"2-set-up-client-and-fund-accounts","depth":3},{"value":"3. Prepare CredentialCreate transaction","id":"3-prepare-credentialcreate-transaction","depth":3},{"value":"4. Submit CredentialCreate transaction","id":"4-submit-credentialcreate-transaction","depth":3},{"value":"5. Prepare CredentialAccept transaction","id":"5-prepare-credentialaccept-transaction","depth":3},{"value":"6. Submit CredentialAccept transaction","id":"6-submit-credentialaccept-transaction","depth":3},{"value":"7. Prepare CredentialDelete transaction","id":"7-prepare-credentialdelete-transaction","depth":3},{"value":"8. Submit CredentialDelete transaction","id":"8-submit-credentialdelete-transaction","depth":3},{"value":"See Also","id":"see-also","depth":2}],"frontmatter":{"seo":{"description":"Issue, accept, and delete a credential on the XRP Ledger.","title":"Manage Credentials"},"metadata":{"indexPage":true},"labels":["Credentials"]},"editPage":{"to":"https://github.com/XRPLF/xrpl-dev-portal/tree/master/docs/tutorials/compliance-features/manage-credentials.md"},"lastModified":"2026-04-29T22:45:29.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/tutorials/compliance-features/manage-credentials","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}