Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.
This repository was archived by the owner on May 13, 2022. It is now read-only.

Some questions about getBalanceMessage() and verifyBalanceProof() #86

@LefterisJP

Description

@LefterisJP

I have a question for the micro-raiden architecture.

I noticed you have this function getBalanceMessage(). This is the only place where addressToString() is used.

Looking at getBalanceMessage() it seems like you can do without it. It just turns some fields to string and concatenates them. That can very easily be done on the client side and does not need a smart contract function.

Same goes for uintToString(), apart from the fact that it's also used in verifyBalanceProof().

Looking further it seems you use getBalanceMessage() in verifyBalanceProof() and then use verifyBalanceProof() in the close() functions.

So here one thing to note. You should undo the constant keyword from both getBalanceMessage() and verifyBalanceProof() as you are not using them as constants. You call them from `close(). This is confusing to read.

Furthermore I don't see why you need to concatenate string, and have to do string manipulation which is expensive. Why not play with an array of bytes and encode/decode them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions