Tuesday, July 1, 2025
No Result
View All Result
Coin Digest Daily
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • Blockchain
  • NFT
  • Metaverse
  • Web3
  • DeFi
  • Analysis
  • Scam Alert
  • Regulations
Marketcap
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • Blockchain
  • NFT
  • Metaverse
  • Web3
  • DeFi
  • Analysis
  • Scam Alert
  • Regulations
No Result
View All Result
Coin Digest Daily
No Result
View All Result

Hyperledger Web3J: Bridging Decentralized Identity & EVM

23 July 2024
in Web3
Reading Time: 8 mins read
0 0
A A
0
Home Web3
Share on FacebookShare on Twitter


In in the present day’s panorama, the momentum behind Web3 is evident throughout varied industries. As we transfer into this new period, it is vital to replace our instruments and strategies to match the altering surroundings. Throughout Web1, one of many key modifications concerned utilizing authentication strategies to confirm customers on particular web sites for the primary time.

Web2 launched id suppliers, permitting customers to authenticate themselves utilizing their social accounts. Nonetheless, will this mannequin endure in a Web3 surroundings? Not fairly.

Enter Decentralized Identification, a trademark of Web3. This paradigm shift eliminates the reliance on central authorities for credential verification. As a substitute, customers have direct management over their credentials, deciding what info to share when proving their id. This basic change empowers people, remodeling the idea of digital id within the Web3 period.

The World Extensive Internet Consortium (W3C) units the usual for these identities, offering detailed details about Decentralized Identifiers (DID), Verifiable Credentials (VC), and Verifiable Shows (VP). For additional insights, readers can seek advice from our earlier articles on Decentralized Identification:

This text goes past idea to discover the sensible aspect, demonstrating how Decentralized Identification will be seamlessly built-in into present initiatives for efficient use.

We’ll showcase the method with the next steps:

Making a did:ethr DID.
Querying its standing on the Identification Registry inside the community.
Producing a Verifiable Credential.
Lastly, revoking the DID.

By these sensible examples, readers will achieve a deeper understanding of implementing Decentralized Identification in real-world situations.

Getting began

As a way to simply obtain the Decentralized Identification in your utility you want to ensure you have the next:

An Identification generator library for particular DID strategies, DID paperwork, Verifiable Credentials, Verifiable Shows, and on the identical time present the verification mechanism.
A registry that holds the Identities in a blockchain community.
A device that may generate the required key pairs for encryption to create the identifiers talked about earlier. This device must also allow interplay with the blockchain community talked about above.

For demonstrating this we’ll use the next tech stack:

SpruceID library for producing decentralized credentials.
The Ethereum Sepolia check community with ERC-1056 good contract which can symbolize the Identification Registry within the community.
Hyperledger Web3J to work together with the Identification Registry good contract and generate the Elliptic Curve SECP-256k1 key pair. SpruceID to create the credentials.

Setting Up the Surroundings

Generate a brand new Java challenge. You possibly can accomplish this utilizing any well-liked IDE or generate it as a brand new HelloWorld utility utilizing the Web3j-CLI. We advocate utilizing Gradle as a construct device for added duties, though Maven can be appropriate.

Combine SpruceID:

This library is written in Rust. To make use of it in our Java utility, we’ll must construct it domestically. For this use the next tutorial for Java on the documentation website. 

The steps are:

git clone https://github.com/spruceid/ssi –recurse-submodules
git clone https://github.com/spruceid/didkit
cd didkit/
cargo construct
From DIDKit root listing generate the Java Native Interfaces for to can work together from Java with SpruceID Rust library

make -C lib ../goal/didkit.jar

    6. From DIDKit root listing generate the entry level to the SpruceID Library which was              constructed on the native machine.

 

Notice: Please seek advice from the challenge’s documentation to construct the library to your platform, libdidkit.so on UNIX-like programs, didkit.dll on Home windows, libdidkit.dylib on MacOS.

make -C lib ../goal/launch/libdidkit.so

Add the generated libs from 5 and 6 to the classpath.

Combine Web3J:

If the Java utility was created utilizing Web3J-CLI, the Web3J Gradle plugin is robotically included. If not, you will want so as to add it manually to the construct.gradle file, as described beneath:

plugins {
id(“org.web3j”) model “4.9.8”
}

Notice: SpruceID will run solely on Java 11, on account of this Web3J is specified with model 4.9.8.

Combine with Ethereum check community:

 

For this we’ll use the Ethereum Sepolia check community to deploy and work together with the good contract ERC-1056. As talked about above, we’ll use Web3J for the deployment and interplay with the good contract. 

First Generate the contract wrapper:

Add the solidity file within the solidity folder underneath the fundamental module.

Run generateContractWrappers gradle activity

Deploy the good contract to the Sepolia check community by executing the tutorial steps right here. Now every thing is in place. 

did:ethr

The did:ethr refers primarily to an Ethereum public handle, which will be resolved to a DID doc utilizing a resolver entity. On this case, SpruceId supplies a resolveDID methodology that can be utilized for this function.

For producing a brand new did:ethr we’ll execute the next code:

//the Sepolia community ID 11155111 in hex
String EVM_CHAIN_ID = 0xaa36a7

public String createEthrIdentity(Machine gadget) throws Exception {
ECKeyPair ecKeyPair = Keys.createEcKeyPair();
String privateKey = Numeric.toHexStringWithPrefix(ecKeyPair.getPrivateKey());
String handle = Numeric.prependHexPrefix(Keys.getAddress(ecKeyPair));
String did = “did:ethr:” + EVM_CHAIN_ID + “:” + handle;
return did;
}

The code above demonstrates how the Keys class from the Web3J utility module is used to generate the SECP-256k1 key pair for the brand new handle. As soon as created, the brand new DID is fashioned by combining the prefix with the brand new key. 

Notice: EVM_CHAIN_ID specifies which community the resolver ought to verify to resolve the DID. 

The ensuing DID ought to have the next format:

did:ethr:0xaa36a7:0x19e03255f667bdfd50a32722df860b1eeaf4d635

If we had generated the DID for Ethereum Mainnet, it will be:

did:ethr:0xaa36a7:0x19e03255f667bdfd50a32722df860b1eeaf4d635

Notice: Bear in mind to retailer the non-public key generated above for later use. You will want it when producing Verifiable credentials. As a greatest apply, encrypt it with an RSA key and retailer it in a personal database till it’s wanted once more.

Test possession

Even when the DID was created off-chain utilizing Hyperledger Web3J, it capabilities on the community like some other SECP-256k1 handle by default. Subsequently, there isn’t a must take any extra steps so as to add it to the Identification Registry. The registry robotically resolves all queries for newly generated did:ethr addresses as a result of they’re already related to their respective homeowners.

public String checkOwner(String did) throws Exception {
Web3j web3j = Web3j.construct(new HttpService(NETWORK_RPC));
FastRawTransactionManager transactionManager = new FastRawTransactionManager(web3j, Credentials.create(id.getKeyUsed()), Numeric.toBigInt(DIDConstants.EVM_CHAIN_ID).longValue());

EthereumDIDRegistry registry = new EthereumDIDRegistry(REGISTRY_ADDRESS, web3j, transactionManager, new DefaultGasProvider());

String identityAddress = did.substring();

return registry.identityOwner(identityAddress).ship();
}

Within the above code, Hyperledger Web3J is querying the registry good contract to retrieve the proprietor of the present DID. 

Notice: the identityAddress is obtained by eradicating the DID prefix (did:ethr:EVM_CHAIN_ID), which represents the beforehand generated public handle. If the proprietor was not beforehand set, the tactic ought to return the saved handle worth as identityAddress by default. Which means each account is the proprietor of its personal DID.

Generate Verifiable Credentials

As soon as the DID is generated and the proprietor’s non-public secret is out there, entry to the Decentralized Identification Area turns into doable. Verifiable Credentials (VCs) function digital representations of bodily IDs within the Web3 area. For additional understanding of their use case, please seek advice from the articles talked about within the introduction part.

To generate VCs, we’ll make the most of SpruceID and Hyperledger Web3J together with the non-public key generated earlier.

public String issueVerifiableCredential(String did, KeyPair keys, DataObject knowledge){

last CredentialObject credential = new CredentialObject(did, did, knowledge);

last DIDKitOptions choices = new DIDKitOptions(PROOF_ASSERTION, id.getVerificationMethod(), null, null);

last String credentialJson = MAPPER.writeValueAsString(credential);
last String optionsJson = MAPPER.writeValueAsString(choices);

String jwk = generatePrivateJwk(keys);

last String verifiableCredential = DIDKit.issueCredential(credentialJson, optionsJson, jwk);
return verifiableCredential;
}

Within the above code, DIDKit is the JNI interface positioned within the jar file that we added to the category path. It exposes the issueCredential methodology which receives the next arguments:

credentialJson = is the physique of the VC. Created from the CredentialObject, it contains the specified knowledge that should conform to the VC schema. Check with the SpruceId instance for steerage.
optionsJson = this refers to the kind of assertions that Verifiable Credential might want to help throughout verification requests;
jwk = is the Json Internet Key format of the did:ethr’s key pair. Methodology generatePrivateJwk ought to include the Web3J code which returns the non-public JWK, documentation right here.

As soon as SpruceID receives the issueCredential request it can begin to do the next:

Test if credentialJson respects the VC schema talked about in @context;

Resolve the did:ethr so as to get the DID Doc to verify the JWK that was despatched. Relying on the check community 2 choices can happen:

If the SpruceId library resolve methodology is suitable with the community, the DID can be resolved.

If the library shouldn’t be suitable, the resolver must be overridden with this customized resolver. 

You possibly can obtain this by cloning the repository and executing the npm command to start out the resolver occasion. After occasion begins, redirect the SpruceId calls by overriding the DIDKit resolve actions to the brand new resolver.

    3. After finishing the primary two steps, the system returns the verifiable credential.

From right here, you need to use it in verification calls, issuing new Verifiable Shows, and extra.

Revoke DID

A DID is revoked when its DID Doc can now not be retrieved. For many DID strategies, this may be achieved by eradicating entry to it. Within the case of did:net, the entry URL to the DID doc is revoked. However what about did:ethrs when there may be an Identification Registry on the community?

On this case, revocation of the DID will consist of adjusting the proprietor handle to 0x0. By doing this, we point out that solely the handle 0x0 can use it. Nonetheless, as 0x0 shouldn’t be a legitimate handle that can be utilized, the DID is successfully revoked.

registry.changeOwner(identityAddress,”0x0″).ship();

Hyperledger Web3J connects Decentralized Identification (DID) programs with Ethereum Digital Machine networks, offering important help for creating decentralized identities. Its interfaces make it simpler to work together with the EVM community and generate essential JWK keys for id creation processes, corresponding to these utilized in Spruce ID.

 



Source link

Tags: BridgingDecentralizedEVMHyperledgeridentityWeb3j
Previous Post

Mitsubishi Corporation Gives Major Funding to AR Marketing Platform, STYLY – XR Today

Next Post

Moralis Adds Support for Moonbeam Network – Moralis Web3 | Enterprise-Grade Web3 APIs

Related Posts

Feds Charge Man With $1.7M Scheme to Convert Fake Checks Into Bitcoin – Decrypt
Web3

Feds Charge Man With $1.7M Scheme to Convert Fake Checks Into Bitcoin – Decrypt

1 July 2025
Metaplanet Adds $104M in BTC, Testing Limits of Bitcoin Treasury Plan – Decrypt
Web3

Metaplanet Adds $104M in BTC, Testing Limits of Bitcoin Treasury Plan – Decrypt

30 June 2025
Can China’s MiniMax-M1 AI Topple US Rivals? We Put It to the Test – Decrypt
Web3

Can China’s MiniMax-M1 AI Topple US Rivals? We Put It to the Test – Decrypt

29 June 2025
Trump Blames Biden for Banks Blocking Crypto: ‘There Is a Lot of Debanking’ – Decrypt
Web3

Trump Blames Biden for Banks Blocking Crypto: ‘There Is a Lot of Debanking’ – Decrypt

28 June 2025
Bitcoin ETFs Notch 13 Consecutive Days of Inflow—Why It Matters – Decrypt
Web3

Bitcoin ETFs Notch 13 Consecutive Days of Inflow—Why It Matters – Decrypt

27 June 2025
Meta and OpenAI Use of Copyrighted Books for Training AI Was Fair Use: Federal Judge – Decrypt
Web3

Meta and OpenAI Use of Copyrighted Books for Training AI Was Fair Use: Federal Judge – Decrypt

26 June 2025
Next Post
Moralis Adds Support for Moonbeam Network – Moralis Web3 | Enterprise-Grade Web3 APIs

Moralis Adds Support for Moonbeam Network - Moralis Web3 | Enterprise-Grade Web3 APIs

ECC’s position on the Zcash Dev Fund

ECC’s position on the Zcash Dev Fund

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest
Ethereum Reclaims $2,500 In Squeeze-Driven Rally – But Can It Hold?

Ethereum Reclaims $2,500 In Squeeze-Driven Rally – But Can It Hold?

28 June 2025
솔라나 레이어 2 코인 솔락시, 유니스왑 상장 출시… 지금 구매할 만한 유망 코인일까? | Bitcoinist.com

솔라나 레이어 2 코인 솔락시, 유니스왑 상장 출시… 지금 구매할 만한 유망 코인일까? | Bitcoinist.com

24 June 2025
$304M Raised, 20 Listings Locked – BlockDAG’s Plan Is Set, TAO and Pi Downtrend

$304M Raised, 20 Listings Locked – BlockDAG’s Plan Is Set, TAO and Pi Downtrend

16 June 2025
Why is Crypto Crashing? Dust Settles Over SOL and ETH After Musk Storm

Why is Crypto Crashing? Dust Settles Over SOL and ETH After Musk Storm

7 June 2025
Ethereum Price To Resume Downtrend? Market Expert Identifies Bearish Chart Setup | Bitcoinist.com

Ethereum Price To Resume Downtrend? Market Expert Identifies Bearish Chart Setup | Bitcoinist.com

23 June 2025
Altcoin Exchange Flows Dip Below $1.6B – History Points To Incoming Rally | Bitcoinist.com

Altcoin Exchange Flows Dip Below $1.6B – History Points To Incoming Rally | Bitcoinist.com

28 June 2025
Penis envy? 35-foot appendage at UK heritage site was almost covered up

Penis envy? 35-foot appendage at UK heritage site was almost covered up

1 July 2025
Feds Charge Man With $1.7M Scheme to Convert Fake Checks Into Bitcoin – Decrypt

Feds Charge Man With $1.7M Scheme to Convert Fake Checks Into Bitcoin – Decrypt

1 July 2025
Circle Proposed to Launch Federally Regulated Trust Bank

Circle Proposed to Launch Federally Regulated Trust Bank

1 July 2025
Supreme Court Rejects Crypto Privacy Case Against IRS

Supreme Court Rejects Crypto Privacy Case Against IRS

1 July 2025
Crypto Survey Reveals 7 in 10 South Koreans Want to Increase Holdings

Crypto Survey Reveals 7 in 10 South Koreans Want to Increase Holdings

1 July 2025
Cardano (ADA) Sideways — Support Intact, But No Spark for a Move Yet

Cardano (ADA) Sideways — Support Intact, But No Spark for a Move Yet

1 July 2025
Facebook Twitter Instagram Youtube RSS
Coin Digest Daily

Stay ahead in the world of cryptocurrencies with Coin Digest Daily. Your daily dose of insightful news, market trends, and expert analyses. Empowering you to make informed decisions in the ever-evolving blockchain space.

CATEGORIES

  • Altcoin
  • Analysis
  • Bitcoin
  • Blockchain
  • Crypto Exchanges
  • Crypto Updates
  • DeFi
  • Ethereum
  • Metaverse
  • NFT
  • Regulations
  • Scam Alert
  • Web3

SITEMAP

  • About us
  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2024 Coin Digest Daily.
Coin Digest Daily is not responsible for the content of external sites.

No Result
View All Result
  • Home
  • Bitcoin
  • Crypto Updates
    • General
    • Altcoin
    • Ethereum
    • Crypto Exchanges
  • Blockchain
  • NFT
  • Metaverse
  • Web3
  • DeFi
  • Analysis
  • Scam Alert
  • Regulations

Copyright © 2024 Coin Digest Daily.
Coin Digest Daily is not responsible for the content of external sites.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
  • bitcoinBitcoin(BTC)$106,562.00-1.27%
  • ethereumEthereum(ETH)$2,452.70-0.50%
  • tetherTether(USDT)$1.000.00%
  • rippleXRP(XRP)$2.200.81%
  • binancecoinBNB(BNB)$652.07-0.33%
  • solanaSolana(SOL)$148.88-1.27%
  • usd-coinUSDC(USDC)$1.000.00%
  • tronTRON(TRX)$0.2784890.47%
  • dogecoinDogecoin(DOGE)$0.161385-2.32%
  • staked-etherLido Staked Ether(STETH)$2,451.70-0.52%