Skip to content

Difficulty integrating with keplr (cosmos) #48

@xpt1x

Description

@xpt1x

I cant use this with keplr as i am seeing an error like: "unmatched chain id"

Keplr (most popular cosmos wallet) takes chain-id as a param to sign message which for this example let's say is local-mainnet because the signer signing this message has his address derived from this local-mainnet chain but i believe when creating a signDoc to be signed, aleph creates it with chain-id signed-message-v1 which creates conflict at time of signing and hence throws this above error

What i have tried till now

  1. tried to change CHAIN_ID from aleph-js source for testing to local-mainnet, so that chain-id stays same, after running submit fn, it provides me with item hash, like it succeeded but i don't see anything on explorer or aleph's server
  2. tried mocking actual chain with a chain which is similar in all aspects, just chain-id will be signed-message-v1 for it (using keplr's suggest chain) and signing messages from this chain, after running submit fn, it provides me with item hash, like it succeeded but i don't see anything on explorer or aleph's server

I haven't read how handling of these messages is done on aleph network itself so pardon me if i am doing something completely wrong, i was just trying to make it work with keplr. I also don't understand if something wrong happens after submit fn, why its generating a success result and providing me with a item hash at the end ?

Message that i sign at keplr

{
  "chain_id": "local-mainnet",
  "account_number": "0",
  "fee": {
    "gas": "0",
    "amount": [
      {
        "denom": "uiov",
        "amount": "0"
      }
    ]
  },
  "memo": "",
  "sequence": "0",
  "msgs": [
    {
      "type": "signutil/MsgSignText",
      "value": {
        "message": "CSDK\nstar1yark4kdrn29erxpnh3njy2756pmlgwn0sta5sf\nAGGREGATE\n64667490389d514e794373b59601a085e83f25abcea57f4e049f3bb368dc2ea8",
        "signer": "star1yark4kdrn29erxpnh3njy2756pmlgwn0sta5sf"
      }
    }
  ]
}

Result from aggregateSubmit

{
    "chain": "CSDK",
    "channel": "TEST",
    "sender": "star1yark4kdrn29erxpnh3njy2756pmlgwn0sta5sf",
    "type": "AGGREGATE",
    "time": 1659689807.291,
    "item_type": "inline",
    "item_content": "{\"address\":\"star1yark4kdrn29erxpnh3njy2756pmlgwn0sta5sf\",\"key\":\"do*iov\",\"content\":{\"biography\":\"i am do\",\"name\":\"\",\"photo\":null},\"time\":1659689807.29}",
    "item_hash": "64667490389d514e794373b59601a085e83f25abcea57f4e049f3bb368dc2ea8",
    "signature": "{\"pub_key\":{\"type\":\"tendermint/PubKeySecp256k1\",\"value\":\"AuWRwc/FteDNIeGTJ0gOXx7bPrNWBcnBuGDyETeApCSd\"},\"signature\":\"mqoIWiJy+bMTu3CPTmF9yGe6jaVFV618wwFHAiSEVFNn2SskKVVWIlpvxrxW9lz9W5tYSe5IYGz4n1HwmsHjOg==\",\"account_number\":\"0\",\"sequence\":\"0\"}"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions