gofractally / psibase

Open source protocol enabling communities to easily self-host web applications
https://docs.psibase.io
MIT License
28 stars 7 forks source link

Claims & Proofs: cleanup args and terminology #243

Open tbfleming opened 2 years ago

tbfleming commented 2 years ago

Current verifier args (e.g. verifyec-sys):

struct Claim
{
    AccountNumber     service;
    std::vector<char> rawData;
};

struct VerifyArgs
{
   Checksum256       transactionHash;
   Claim             claim;
   std::vector<char> proof;
};

The transactionHash arg forces use of sha256, which hurts upgradeability since the native code fills it.

Claim and Proof aren't standard terminology. The current use case is Public Key and Signature, but we plan to define more uses in the future (e.g. Antelope Action and Merkle Proof) and it's possible for independent service authors to define their own uses.

tbfleming commented 2 years ago

Here's one possible solution for the terminology problem:

swatanabe commented 2 years ago
* Abuse those terms for the minority use cases. e.g. an Antelope action is a psibase public key and a Merkle proof is a psibase signature.

A merkle tree can be seen as a signature scheme if you squint at it right. In fact, a slightly different breakdown would make this seem almost normal:

Then, a Claim can be defined as a public key + either a tag indicating the whole transaction or an octet-string.