Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 22 05:33
    xpepermint assigned #695
  • Sep 21 21:15
    fulldecent opened #695
  • Aug 29 11:53

    xpepermint on master

    Create FUNDING.yml (compare)

  • Aug 12 14:00

    xpepermint on master

    Bump version Merge pull request #694 from xp… (compare)

  • Aug 12 14:00
    xpepermint closed #694
  • Aug 12 13:56
    codecov-commenter commented #694
  • Aug 12 13:55
    codecov-commenter commented #694
  • Aug 12 13:34
    codecov-commenter commented #694
  • Aug 12 12:46
    xpepermint opened #694
  • Aug 12 12:17
    MoMannn closed #693
  • Aug 12 12:17
    MoMannn commented #693
  • Aug 12 12:13
    xpepermint commented #693
  • Aug 12 11:58
    MoMannn commented #693
  • Aug 12 11:53
    xpepermint labeled #693
  • Aug 12 11:53
    xpepermint assigned #693
  • Aug 12 11:53
    xpepermint opened #693
  • Aug 12 11:21
    xpepermint closed #691
  • Aug 12 11:21

    xpepermint on master

    Update wanchain testnet url. Update eslint config. Fix line length. and 4 more (compare)

  • Aug 12 11:21
    xpepermint closed #692
  • Aug 12 09:41
    codecov-commenter commented #692
Javier Montesinos
@fjmontesinos
I don't understand the Fill data option, how can retrieve the data schema json, asset metadata json and asset metadata evidence json from the blockchain?
Mugdha Patil
@PatilMugdha
@MoMannn I deleted node_modules and package-lock.json file but no effect. All modules are 2.x version
Azlan
@azizazlan

@fjmontesinos schema(.json), asset's metadata(.json) and its corresponding evidence (.json) can be stored on a conventional web server (or on IPFS node) and make it available publicly.

For example:
https://yourwebsite.com/yourDapp/schema.json
https://yourwebsite.com/yourDapp/assets/1.json
https://yourwebsite.com/yourDapp/assets/1-evidence.json

So when an arbitrator (or third party) want to authenticate an asset, a claimant (owner of the asset) will have to give the arbitrator the asset ledger id and of course the asset id too.

You probably need to build a special app that retrieves the schema, metadata and evidence (as hosted above at https://yourwebsite.com) so that it can calculate an imprint and compare it with the ones on the network.

You can get the uri by running the code below:

const asset = await assetLedger.getAsset(assetId)
const uri = asset.uri;
// https://yourwebsite.com/yourDapp/assets/1.json

If the calculated imprint is equal to the network(imprint), then it may concluded that the asset is authenticated.

Azlan
@azizazlan

You can create a QR code that represent the following link, for example:

https://yourwebsite.com/yourDApp?assetId=1&ledgerId=0xcddsfds43242...fsdfs4342

(Refer https://verify.0xcert.org/)

Of course there are other creative ways ;)

Azlan
@azizazlan

Hi, i want to place the metadata on IPFS, say:

https://ipfs.infura.io/ipfs/Qmaisz6NMhDB51cCvNWa1GMS7LU1pAxdF4Ld6Ft9kZEP2a

and assuming the metadata will be in JSON.

So in this case when deploying an asset ledger, I don't need to set the uriPostfix value. Is this the "correct" way?

The uriPrefix value will be https://ipfs.infura.io/ipfs/.

Azlan
@azizazlan
...sorry also for Asset id the value should be Qmaisz6NMhDB51cCvNWa1GMS7LU1pAxdF4Ld6Ft9kZEP2a
Javier Montesinos
@fjmontesinos
@azizazlan Thanks!! I already have all the puzzle pieces. Now I need to code, I will explore ipfs to store json files but for the moment I will use your initial purpose
Azlan
@azizazlan
Bummer! Asset id must be uint256 so I cannot set Ipfs hash value as the asset Id!
Azlan
@azizazlan

I don't quite understand the following passage in your documentation at (https://docs.0xcert.org/framework/v2/guides/certification.html#certifying-assets):

This ID must be stored as a part of the immutable storage and identifies storage context

I know we can get the id from:

const schemaId = await cert.identify();

But in your explanation you just mention of calculating imprint and match to that retrieve from network. So where
does the schema id play in the certification?

Kristijan Sedlak
@xpepermint
@fjmontesinos In most cases, NFTs will be own by a central authority that you trust. Using IPFS might be overkill for such cases. Use IPFS for 100% decentralized solutions only.
@azizazlan SchemaID unique identifies a schema. This ID is permanently stored in the asset ledger on the blockchain. When someone interacts with the ledger he can verify that the schema is legit and has not been changed. SchemaId is basically an imprint of a schema that defines metadata.
Azlan
@azizazlan
Thanks @xpepermint ! Understood.
Azlan
@azizazlan

I did not get the schemaId key and its value when retrieved an AssetLedgerInfo:

const assetLedgerInfo = await assetLedger.getInfo();

I console log the assetLedgerDefinition and all keys are according to the documentation. Below is my generator function (using redux-saga) for deploying a ledger:

export function* gfDeployAssetLedger(action) {
    const provider = store.getState().zero.provider;

    var capabilities = []; 
    if (action.data.destroy) {
    ¦   capabilities = [...capabilities, AssetLedgerCapability.DESTROY_ASSET];
    }   
    if (action.data.update) {
    ¦   capabilities = [...capabilities, AssetLedgerCapability.UPDATE_ASSET];
    }   
    if (action.data.revoke) {
    ¦   capabilities = [...capabilities, AssetLedgerCapability.REVOKE_ASSET];
    }   
    if (action.data.transfers) {
    ¦   capabilities = [ 
    ¦   ¦   ...capabilities,
    ¦   ¦   AssetLedgerCapability.TOGGLE_TRANSFERS
    ¦   ];  
    }   

    const assetLedgerDefinition = { 
    ¦   name: action.data.name,
    ¦   symbol: action.data.symbol,
    ¦   uriPrefix: action.data.uriPrefix,
    ¦   uriPostfix: action.data.uriPostfix ? action.data.uriPostfix : "", 
    ¦   schemaId: action.data.schemaId,
    ¦   capabilities: capabilities
    };  

    console.log(assetLedgerDefinition);

    try {
    ¦   const mutation = yield AssetLedger.deploy(
    ¦   ¦   provider,
    ¦   ¦   assetLedgerDefinition
    ¦   );  
    ¦   yield mutation.complete();
    ¦   const transactionHash = mutation.id;
    ¦   const assetLedgerId = mutation.receiverId;

    ¦   if (assetLedgerId && transactionHash) {
    ¦   ¦   yield put({
    ¦   ¦   ¦   type: ACTIONS.DEPLOY_ASSET_LEDGER_OK,
    ¦   ¦   ¦   data: {
    ¦   ¦   ¦   ¦   assetLedgerId: assetLedgerId,
    ¦   ¦   ¦   ¦   transactionHash: transactionHash
    ¦   ¦   ¦   }   
    ¦   ¦   }); 
    ¦   }   
    } catch (err) {
    ¦   yield put({
    ¦   ¦   type: ACTIONS.DEPLOY_ASSET_LEDGER_ERR,
    ¦   ¦   data: {
    ¦   ¦   ¦   errMsg: err.toString()
    ¦   ¦   }   
    ¦   }); 
    }   
}

I am using the latest version 2.0.1 and deployed on rinkeby network.

Kristijan Sedlak
@xpepermint
What's the address of your contract? Did you also deploy the latest asset ledger contract (not just updated the library)?
Azlan
@azizazlan

Contract address
0x8A5c40F29DEE17024b2146F4d7161B0fe85C9d34

I deployed the contract using the latest library.

Javier Montesinos
@fjmontesinos

@xpepermint Hi, I have used TOGGLE TRANSFERS and then disabled Transfers. But this disables the transfers to all users. If I want to issue a certificate first to the owner of the asset because I don't have the address of the certificate user and when the user requests the token by providing their address, how can I transfer it? I have other options? Can I transfer the token without active pause in the general ledger and disable transfers to the user's address?

Thank you so much!

Abhi K
@abkumbar_gitlab
Hello, I'm using emberjs and trying to test some certification functionalities. I installed 0xcert-cert as npm package and when I try to import { Cert } in one of the router sections to create an action, I get the below error. Any ideas on how to solve this? It looks like sha.js references 'crypto' module and webpack is erring out trying to import it? I tried to update webpack config, but that did not help. Using 0xcert/cert 2.0.0 version. I imported Metamask provider and that works without issues.
image.png
Tadej Vengust
@MoMannn
@azizazlan With 2.0 version 0xcert is eip 2477 compliant. ethereum/EIPs#2483 That means that schema is returned when checking info on an individual asset and not on the ledger
@fjmontesinos Toggle transfer stops all transfers. It would make sense not to create the token until you know the recipient or use atomic actions for asset creation where anyone can become the recipient or you specify it beforehand.
Kristijan Sedlak
@xpepermint
@abkumbar_gitlab Looks like missing node devDependency @types/node needed to compile Typescript (not FW related).
Azlan
@azizazlan
@MoMannn thank you!
Abhi K
@abkumbar_gitlab
@xpepermint Thanks! Yeap not a FW issue, turned out emberjs polyfill issue. Appreciate it.
Javier Montesinos
@fjmontesinos
Thanks!!! @azizazlan
Abhi K
@abkumbar_gitlab
@xpepermint qq: I'm trying to deploy an asset ledger, via inputs from a simple form. When I try to deploy ledger, I get below invalid bytes4 value error. Any ideas on what I might be missing? asset ledger definition included in the console output.
image.png
Abhi K
@abkumbar_gitlab
image.png
Tadej Vengust
@MoMannn
@abkumbar_gitlab Can you check your capabilities? It looks like you have 2 duplicated and 16 is not an existing capability.
Also check this working live example: https://codesandbox.io/s/github/0xcert/example-asset-management?module=%2FREADME.md it may help you.
Abhi K
@abkumbar_gitlab
@MoMannn Updating asset capabilities resolved it. I guess I'm a little confused on where to set Super/General Asset Ledger Abilities. I was setting all three abilities during ledger creation, which is why you saw duplicate Ids as SuperAssetLedgerAbility.ALLOW_MANAGE_ABILITIES and AssetLedgerCapability.UPDATE_ASSET have Id 2, and GeneralAssetLedgerAbility.CREATE_ASSET has id 16. Any ideas on how/where I can set super/geneal ledger abilities?
Tadej Vengust
@MoMannn
Ones are capabilities of an ledger ones are abilities of a user for that ledger.
Abhi K
@abkumbar_gitlab
Thanks @MoMannn that's helpful. Can you recommend any resources on how to use bitski or Metamask to sign into an dapp, like you guys do for logging into 0xcert api dashboard?
Kristijan Sedlak
@xpepermint
@abkumbar_gitlab search the web for "login with signature". The process is super simple. A user signes an arbitrary message with a private key (e.g. Metamask) and sends it to the server. The server extracts user's wallet address (a public key) from the received signature which represents a unique id of a user. It's similar to JWT authentication but here a user generates the token.
Abhi K
@abkumbar_gitlab
Awesome, will give it a try. Thanks!
Karega McCoy
@karega
Hello. If I want to interact with a smart contract does this framework provide that functionality?
Kristijan Sedlak
@xpepermint
Yes but depends on your use case. Please explain.
Karega McCoy
@karega
I just want to call functions on a smart contract through a provider.
Kristijan Sedlak
@xpepermint
0xcert is optimized for NFTs. If you work with NFTs then this is the framework for you. You can also use any 0xcert provider to perform a direct call to any contract but you should be familiar with how things actually work in Ethereum to be able to do that.
Karega McCoy
@karega
Ahh so there's no API that does it. I was looking through the documentation trying to find it.
Tadej Vengust
@MoMannn
 const functionSignature = '0x6e553f65';
        const inputTypes = ['uint256', 'address'];
        const attrs = {
          from: 'address',
          to: 'address'
          data: functionSignature + provider.encoder.encodeParameters(inputTypes, ['uint256', 'address']).substr(2)
        };
        const res = await provider.post({
          method: 'eth_sendTransaction',
          params: [attrs]
        });
        const mutation = new Mutation(provider, res.result);
here is an example of how you do it
provider has post opction where you can directly make a call
and .encoder option do encode / decode params for smart contracts
but you need to know how to make rpc call
Karega McCoy
@karega
Thanks
Azlan
@azizazlan

Hi, I had the following codes and it was working fine all along. I have the current version 2.0.2. Version 1.9.0 also works fine last time.

    var options = { 
        sandbox: false,
        network: "rinkeby",
        clientId: "xxx",
        credentialsId: "yyy,
        credentialsSecret:
            "zzz"
    };  
    var bitskiBackEndProvider = new BitskiProvider(options);
    const availableAccounts = await bitskiBackEndProvider.getAvailableAccounts();

with the following error:

(node:54968) UnhandledPromiseRejectionWarning: ProviderError: GenericProvider error [issue: 0]
    at /Users/azlan/Projects/myapp/node_modules/@0xcert/ethereum-generic-provider/dist/core/provider.js:194:23
Tadej Vengust
@MoMannn
That is weird
Can you set in options verbose: true
and try again