Skip to content

"contributionDescription" type is too small to fit an IPFS hash #577

@jellegerbrandy

Description

@jellegerbrandy

At the moment, the "IPFS Hash" defined here: https://github.com/daostack/arc/blob/master/contracts/universalSchemes/ContributionReward.sol#L22 as bytes32

This is too small to contain the default IPFS hash. This stackoverflow answer explains it in detail https://ethereum.stackexchange.com/questions/17094/how-to-store-ipfs-hash-using-bytes (we need 34 bytes).

Note that this is only the defaut scheme for IPFS. In theory, ipfs supports different hashing schemes and variable hash lengths.

This is not just in theory. The current IPFS hashing scheme will be replaced: https://github.com/ipfs/ipfs/issues/337

So: bytes32 is no good. Two possible laternatives:

  • if we want to use a fixed-length schema, we can use the trick from the stackoverflow question (but note that this is not completely future proof either)
  • alternative, just make it a string and get it over with. We are not storing it in permanent storage anyway, so the costs argument is not so strong.

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