GRPC mismatch v1 vs v2?

Trying to implement my python SDK based on GRPV v2.

http://developer.concordium.software/concordium-grpc-api/#concordium.v2.NormalCredentialValues

Specifically, this property:

ar_data	NormalCredentialValues.ArDataEntry	repeated	

In Concordium-Client, which is still on GRPC v1, ar_data is filled:

concordium-client raw GetAccountInfo 3X6GrcepiHLbXttZLG2jk6sVY3ybu5vMiDASLy5DoVJMCrKrx9 9c89b7b3cd65d3f5a96b1b9112c66530a0cea4dc831ba9b6c9dfddbeafbd8813
"arData": {
                        "2": {
                            "encIdCredPubShare": "91d6f01e54148cd30b1c3da0388f3b69a961f92d1109a5821131a81e19e9939c0d5efe5274bccd569ec7206fd5c68ef78f02acb366dd9ceddf06044404c9b298b8b94cf82b85fbeca3a47e75b7dbdcf0afe73979e3534a294ba2216efb5f9b8f"
                        },
                        "3": {
                            "encIdCredPubShare": "80536c334c1845644329e20a7f1b51d8c6ffedb213c7ce8705cb79f22a015fdc1c022e5e11b4e0a0f07ed0988c6e7715aea5f25ac08e5d3a4dc2c974cbe299b173a5c576729df513a073d425e2a63eabb76805978bcb9527fb458dc04eb1b470"
                        },
                        "4": {
                            "encIdCredPubShare": "83a603b9235dddb882a7355399f1d9660804aab7753c466c0cadd7e1e7dd4b49bfdab0747ba0409478f97b0979656678a83fc5bbe3aee52477f6f4987efa10ec01b9c01cbd5b501744b668db5234e11a643f0b0a10b53727c62e2dd4f80e7eee"
                        }
                    },

In GRPC v2 (using this in python), however, it’s empty. I’ve checked with the Rust SDK implementation and there ar_data is also empty.

This is a bug in older node versions that is fixed in 5.1.3

2 Likes

Continuing the thread, I have trouble decoding the AccountVerifyKey keys and ChainArData keys. They are listed are bytes, but my normal bytes conversion ( base64.b64decode(value).hex() ) yields the following error:

Invalid base64-encoded string: number of data characters (9) cannot be 1 more than a multiple of 4

The following also doesn’t work:

bytes.decode(value).hex()

UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 1-2: invalid continuation byte

Do you have a hint on how I can decode the keys in Python?

Why are you attempting to decode it? If you want to display it as hex then you should encode the byte array as hex.

I guess encoding / decoding language doesn’t match well with my brain. Yes, I only want to show the hex version to the user. But that is the same for the other bytes types as well.

Never mind, found it. Thanks.

1 Like