Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Add DidSolProgram feature #53

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chongkan
Copy link

Add DidSolProgram class to interact with DidSolProgram Accounts, containing 3 static methods:

  • DidSolProgram::getDidDataAcccountInfo($client, $base58SubjectPk, $onlyAccData = true)
  • DidSolProgram::getDidDataAccountId($base58SubjectPk)
  • DidSolProgram::deserializeDidData($dataBase64)

Add Accounts/DidData Struct/SCHEME + Accounts/DidData/ServiceStruct + Accounts/DidData/class VerificationMethodStruct, based on the DidSol Program IDL.

References:

DID Spec: https://w3c.github.io/did-core/
DID Method Spec: The did:sol Method v3.0 - A DID Method on the Solana Blockchain
GitHub: https://github.com/identity-com/sol-did
DidSolProgram: didso1Dpqpm4CsiCjzP766BGY89CAdD6ZBL68cRhFPc


  • Adjust the Readme.md to add bit of documentation on how to use the Borsch serialize/deserialize methods.

Copy link

what-the-diff bot commented Apr 23, 2024

PR Summary

  • Addition of New Files
    New files were added for different functionalities:
    • .env: This file is typically used for setting environment variables, which can influence the behaviour of the software.
    • .DS_Store: This is a system file used by Mac operating systems.
    • .history: Likely tracks historical versions of files.
    • .vscode: Folder used by the Visual Studio Code editor for workspace-specific settings.
    • coverage: Typically used to record test coverage statistics for a code repository.
    • The files under src directory are a part of the main code while files under tests are used for testing those code files.
  • Updates to the README file
    A line was added which talks about how an EndPoint can be replaced with a custom RPC endpoint. Further, a new section was introduced titled "Borsh Derialize & Deserialize" to offer an example of a specific coding technique.
  • Creation of Service for Decentralized Identifier Account
    In ServiceStruct.php file, a new service has been created for dealing with Decentralized Identifier (DID) accounts. This helps provide a standard way for users to manage their unique, digital identifiers.
  • Adding Verification Method for Decentralized Identifier Account
    In VerificationMethodStruct.php file, a new verification method has been developed specifically for Decentralized Identifier (DID) accounts, providing a more secure way for users to access their accounts.
  • Representation of a Decentralized Identifier Account
    The new DidData.php file is a representation of a Decentralized Identifier (DID) account, allowing for more efficient handling of these types of accounts in the system.
  • Interacting with the Solana blockchain using the DID Protocol
    In DidSolProgram.php, a new program has been constructed for communicating with the Solana blockchain – a type of cryptocurrency ledger – through a Decentralized Identifier (DID) protocol. This can increase the safety, security, and speed of transactions.
  • Creation of a New Test File for DidSolProgram Class
    In DidSolProgramTest.php, a test file was added to ensure that the functionality within the DidSolProgram class is running smoothly and efficiently.

@neverything
Copy link
Contributor

Hi there @chongkan and thank you for this PR. I haven't touched this project in a long long time and moved on to other projects. Would you like to take it over?

@chongkan
Copy link
Author

Hi @neverything! - I would be really happy to do so. :-)

@chongkan
Copy link
Author

@neverything funny how we are both interested in about the same stuff. -> https://silvanhagen.com/writing/passwordless-login-with-laravel-breeze/

I have a similar setup using either Email or SMS for OTPs + WebAuthn or Web3 after confirming a phone number or email. Except I ended up using the Vue+Inertia stack. The reason for me wanting to continue with this project is because I have my BE in Laravel 11.

I made a new package: https://github.com/Attestto-com/solana-php-sdk

Added you in the list of credit and will be editing the readme and references to Verze this week. ( removing them )

@neverything
Copy link
Contributor

@chongkan cool, if you want I can make you the owner of this project, so you don't need to continue using the fork or I can link from this package to use your fork instead and archive it publicly. Let me know what works for you?

I remember doing auth using web3 on verze and it was so much fun nowadays I'm building other stuff, but processing large amounts of background jobs helps with all the new projects I'm working on.

@chongkan
Copy link
Author

@neverything I think that linking to the new repo would be better because to be honest, I am not quite sure of what I am doing :-p

I made a new Repo and have been refactoring a lot, sometimes with errors and somewhat disorganized. e.g. Never used GitActions in the past and made a lot of commits in the main branch on day one just to get that working.

I am now getting more organized and maybe I will later do a fresh repo or not.

I have refactored the Borsh Implementation to get rid of the Dynamic Properties deprecation warnings, added some more coverage and something I am still not quote sure about is a refactor of the RPC client to enable Dep. Injection to be able to mock the HTTP client responses without calling the real RPCs. -- Not sure if there is a reason for doing so, or if I should later test the real RPC calls separately ( I think that is the right path but haven't discussed it with anyone )

I just changed the main README.md a lot, and added a docs folder where I am planning to put diverse docs as I go.


Not sure if I understand this right: "but processing large amounts of background jobs helps with all the new projects I'm working on."


I am understanding that you are interested in the PHP SDK because it helps a lot with BG Jobs for projects you have?

That is one of the reasons why I insisted on looking, trying and continuing with this project, because I am leveraging Laravel to handle a lot of Jobs (queues) and the DB + VUE to produce a faster UX for my project. I still feel uncertain but it seems to me that it is really possible, I think the most difficult part was the BORSH Serialization/Deserialization process because the rest is pretty much based on RPC calls.

If you could link my Repo from yours, I would really appreciated, beyond the chance to get some help, this is my very first real project and if my personal project doesn't go thru, I am thinking on looking for web3 related jobs etc, so, having some exposure would be really good.

I have no team since 2018, which is also why I like laravel ( being one person, it is easier for me to mainatain the entire stack with Laravel )

Take a look at the readme, I included you in the bottom : https://github.com/Attestto-com/solana-php-sdk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants