This repository is to be used with the GitHub Pages. Please visit https://alastria.github.io/
Any suggestion for improving the site must be sent to [email protected]
Alastria ID truffle Smart Contracts
License: MIT License
This repository is to be used with the GitHub Pages. Please visit https://alastria.github.io/
Any suggestion for improving the site must be sent to [email protected]
similar to Mithrill
Check if the Upgradeability functionality works in the Smart Contracts in the B network.
For this task, it is needed to perform the following steps:
update_logic
script.
If timeToLive is declared without constant, prepareAlastriaID method does not add the time to "now". I will make a pull request soon.
develop
, with last commitnode v14.16.0
npm install
geth --miner.gasprice 0 --http --http.corsdomain="https://remix.ethereum.org" --http.api web3,eth,debug,personal,net --vmdebug --datadir /tmp/geth --dev console
npm run migrateLocal
Running the last command will return the following error (geth on the left and deploy on the right):
Before, publishing this issue, I've talked with @VictorNS69 which gave me a patch to solve this issue:
You can see those changes in this PR in my own repository
Probably, there is a better way of addressing this issue but we don't know how
As shown in the images, the public key of the first identity created when deploying, is not storing in the public key registry Smart Contract.
I think the issue is that the initialize
function in the PublicKeyRegistry must have 2 more arguments, "proxyAddress" and "publicKey", so when we initialize for the first time the contracts, we can pass as an arguments both data.
This change will also imply changing the migrations file (4_initialize_contracts.js
)
Use Truffle environment
It has been decided from the architecture team to migrate the truffle repository to hardhat and continue to support the hardhat repository instead of the truffle repository.
The truffle repository will be dropped, once we have the unit tests for the publicKeyRegistry.
Good afternoon.
We were studying the implementation of the repository and reading the code we have found a point that we don't uderstand.
In the implementation of the AlastriaIdentityManager.sol there is this a line of code that calls the PublicKeyRegistry function addKey.
We have understood the overall process, but we don't understand how it is possible for the forward to call the specific "addKey" function.
The function signature is the following function addKey(string memory publicKey)
so we need to pass a string as a parameter.
The forward is called into the following function of AlastriaIdentityManager
function createAlastriaIdentity(bytes memory addPublicKeyCallData) public validAddress(msg.sender) isPendingAndOnTime(msg.sender) { AlastriaProxy identity = new AlastriaProxy(); identityKeys[msg.sender] = address(identity); pendingIDs[msg.sender] = 0; identity.forward(address(alastriaPublicKeyRegistry), 0, addPublicKeyCallData);//must be alastria registry call }
So our question is: what are we effectively passing with the parameter bytes memory addPublicKeyCallData
and what does the 0 mean in the call identity.forward(address(alastriaPublicKeyRegistry), 0, addPublicKeyCallData)
? Is the 0 a selector for the first function in the smart contract declaration?
Can you provide us a concrete example of what we are passing as the function parameter value?
Thanks in advance,
Andrea Vendrame.
Check if the Upgradeability functionality works in the Smart Contracts in the T network.
For this task, it is needed to perform the following steps:
update_logic
script.
Add return ABI encoded data to AlastriaProxy's fordward method and to AlastriaIdentityManager's delegateCall method so calls can be made in addition to send.
Create truffle unittests
Apparently, the function updateReceiverPresentation is not working.
It has not yet been identified whether the issue is in the SC, the library or the examples.
We need a new deploy for the AlastriaIdentityEntity smart contract (upgradeable version)
Update of the publicKeyRegistry to make the functions work with the hashes (keccak256) of the public keys instead of the public keys in the clear (bytes32)
For example,
However, reviewing the whole implementation of the smart contract.
Add needed documentation
Hello all,
In AlastriaPublicKeyRegistry.sol (located here), I have a question regarding the line 88 (here), the function getPublicKeyStatus accepts type bytes32 data of publicKey and makes the assumption that you already know the keccak256 of the input. As in every position within the contract the publicKey is passed as string and the keccak256 is computed within the function, wouldn't it more appropriate if we transform it accordingly, as presented in the code block below or there is a reason behind that?
function getPublicKeyStatus(address subject, string memory publicKey) view public validAddress(subject) returns (bool exists, uint status, uint startDate, uint endDate)
PublicKey storage value = publicKeyRegistry[subject][getKeyHash(publicKey)];
return (value.exists, value.status, value.startDate, value.endDate);
}
Thank you.
It is necessary to study the forward function to determine whether it is necessary to create a new function by changing the input parameter from bytes memory to bytes32.
Create a new module to recover identities.
This module should manage all the actions that identity recovery needs.
This includes:
Fail to compile
/AlastriaIdentityManager.sol:14:1: TypeError: Derived contract must override function "_initialize". Two or more base classes define function with same name and parameter types.
Deploy Upgradeable Smart Contract in Besu Network.
Modify trufle-config.json
if needed.
It should be atLeastLow (with a "t" instead of "l")
Review the createAlastriaID function that is currently being passed memory addPublicKeyCallData bytes and probably need to make a new function that passes as parameter the hash of the public key instead of the public key in clear.
The code can be viewed at the following link
Only the "firstIdentityWallet" can recover any account in the following version.
This means to set a new variable in the initialize
and a new modifier in the recoverAccount
The second parameter is supposed to be the hash of the public key, but it is the encodedPacked hash of the string, witch is not standard outside solidity. The other methods are computing this hash internally and the parameter is the public key as string memory.
It's odd to have to manually convert the string to bytes, then the bytes to string, add the "0x" and then hash it.
Allow revocation directly (no need to go through the previous states)
The IdentityManager Contract never uses the event IdentityCreated
.
It should be used in this function:
It is necessary to create a series of tests to verify that the behaviour of the AlastriaPublicKeyRegistry.sol smart contract works as expected.
These tests need to be created in the following folder:
https://github.com/alastria/alastriaID-truffle-contracts/tree/develop/tests/registry
with the following name: AlastriaPublicKeyRegistry.ts
Currently there are unit tests for the AlastriaCredentialRegistry.sol and AlastriaPresentationRegistry.sol smart contracts that test all the functionality of these smart contracts including the optional anchoring of credentials and presentations. (the latest functionality included in these smart contracts)
This smart contract will unify the AlastriaCredentialRegistry.sol and AlastriaPresentationRegistry.sol smart contracts.
It will store only the hash and the state of the objects without distinguishing which object is being talked about.
For this it is also necessary to unify the states of both smart contracts and change them from an enum to a numeric value. Later, in comments, we will mark the meaning of each state for credentials and presentations.
Allow revocation directly (no need to go through the previous states)
We should add a new section called "How To" to explain the deployment and the upgrade process of the Smart Contracts.
Some important aspects in this documentation are:
Also, it would be a good idea to explain the proxy pattern we are using (openzeppeling) and how we are using it in Alastria.
Update Eidas contract, and it's usage in the rest of SCs
Review events emitted in the smart contracts:
Create the base structure needed for testing in truffle
Review the AlastriaCredentialRegistry and AlastriaPresentationRegistry unit tests as they were developed on hardhat and this repository is truffle.
These already developed tests must be saved for reuse in the new alastriaID-hardhat-contracts repository that is pending to be created. (https://github.com/alastria/alastriaID-truffle-contracts/tree/develop/tests/registry)
In order not to work from scratch, you can take the unit tests of the old smart contracts and adapt them. (https://github.com/alastria/alastria-identity/tree/master/test/registry)
Migrate project to hardhat (instead of truffle).
We can also, keep 2 versions (if we want to), one with truffle, other with hardhat.
Hello all,
When the DeleteSubjectCredential smart contract function (located here is used, the credential is marked as DeletedBySubject (assigning the status of the credential equals to 3), but it is not removed from the subjectCredentialList. After a successful deletion by the subject, the subjectCredentialList retains the removed credential. Shouldn't the removed credentials also been removed from the list too?
Thank you very much
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.