Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect address #67

Open
GeraldoMarques1 opened this issue Feb 7, 2024 · 9 comments
Open

Incorrect address #67

GeraldoMarques1 opened this issue Feb 7, 2024 · 9 comments

Comments

@GeraldoMarques1
Copy link

GeraldoMarques1 commented Feb 7, 2024

I’m a developer and just looked your excellent demo site.
But I have one question.
When I connect wallet using joyid, it shows incorrect address.
I attached screenshot. first image is from https://testnet.joyid.dev/ and I think it’s correct address.
What’s the reason? And how to mint spore on nervous main net work with correct address?
Thanks.
image (4)
image (3)

@GeraldoMarques1
Copy link
Author

@ahonn @ShookLyngs could you reply?

@ahonn
Copy link
Member

ahonn commented Feb 8, 2024

Hi @GeraldoMarques1, thanks for your feedback.

Spore-demo is integrated with JoyID through Omnilock for now, which means it follows the same approach as MetaMask.
So it is different from the address seen in JoyID (JoyID uses its own lock), you can understand that in the spore demo we are only using JoyID to sign transactions.

We plan to temporarily disable JoyID in the demo to avoid confusion. It will be re-added when we can fully support JoyID.
We will explain this situation in the README. At the same time, if you are developing Spore DApp, the Omnilock integration is not recommended.

@GeraldoMarques1
Copy link
Author

@ahonn thanks for your response.
I understand, and I'm trying to integrate 'Mint Spore' on my dApp using joyid and nervous network.
So I can get ethAddress and ckb address using '@joyid/ckb' but I want to get correct lock.
Could you tell me how can I mint spore?
thanks.

@ahonn
Copy link
Member

ahonn commented Feb 8, 2024

@ahonn thanks for your response. I understand, and I'm trying to integrate 'Mint Spore' on my dApp using joyid and nervous network. So I can get ethAddress and ckb address using '@joyid/ckb' but I want to get correct lock. Could you tell me how can I mint spore? thanks.

You can refer to #69. ckb-dao-cobuild-poc's demo showcasing the management of DAO deposits through the use of a new transaction building protocol named Cobuild. In the poc demo, we have implemented the use of JoyID to manage DAO. You can management spores at same way.

@GeraldoMarques1
Copy link
Author

ok, got it.
I wanted to know how to get joyid lock from ckb address

@ShookLyngs
Copy link
Contributor

ShookLyngs commented Feb 8, 2024

ok, got it. I wanted to know how to get joyid lock from ckb address

If you mean "get the lock script of a JoyID wallet address", you can use the parseAddress API from lumos:

import { helpers, config, Script } from '@ckb-lumos/lumos';

const joyIdWalletMainnetAddress = 'ckb...';
const lockScript: Script = helpers.parseAddress(joyIdWalletMainnetAddress, { 
  config: config.MAINNET,
});

console.log(lockScript); // { codeHash: ..., hashType: ..., args: ... }

@GeraldoMarques1
Copy link
Author

yes. so I tested.
my test ckb address:
ckt1qrfrwcdnvssswdwpn3s9v8fp87emat306ctjwsm3nmlkjg8qyza2cqgqqytg65tdzm9prtw3rkjlnk80dyt326sf9sawqks7

and lock is
args: "0x0001168d516d16ca11add11da5f9d8ef6917156a092c"
codeHash: "0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac"
hashType: "type"

but when I mint spore using this address and lock with createSpore from 'spore-sdk/core', I have error.
it's related to spore sdk? or any argument is wrong?

@ShookLyngs
Copy link
Contributor

ShookLyngs commented Feb 17, 2024

and lock is args: "0x0001168d516d16ca11add11da5f9d8ef6917156a092c" codeHash: "0xd23761b364210735c19c60561d213fb3beae2fd6172743719eff6920e020baac" hashType: "type"

but when I mint spore using this address and lock with createSpore from 'spore-sdk/core', I have error. it's related to spore sdk? or any argument is wrong?

This is a JoyID lock address, and I assume that when you try to construct a transaction and include this address in the fromInfos, it throws an error with a message similar to "not enough capacity in from infos!" If that's the case, the error is caused by Lumos, indicating that the JoyID lock is not officially supported by Lumos.

The cause of the error is that Lumos only collects capacity from known lock scripts (such as the default lock and the Omnilock). If you include a JoyID address in the fromInfos, Lumos doesn't recognize the JoyID lock script and the collection with the JoyID lock script is skipped. As a result, it cannot complete the capacity collection process. This is why the error is thrown.

As far as I know, the Lumos team is still working on supporting the JoyID lock, so a temp solution is to register a CustomLockScriptInfo in your dapp to handle capacity collection and witness-related fields for the JoyID lock script. However, it may present some difficulties. You can refer to the following example in Lumos on how to register a CustomLockScriptInfo : https://github.com/ckb-js/lumos/blob/ad483d9cb55ad38db9604fde456033b9513bc7f1/packages/common-scripts/examples/custom_lock_script_info/custom_lock_script_info.ts

@WhiteR4bbitt
Copy link

As far as I know, the Lumos team is still working on supporting the JoyID lock

Looks like it :) for reference: ckb-js/lumos#640

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

No branches or pull requests

4 participants