Code Monkey home page Code Monkey logo

metadata-offline-project's People

Contributors

slesarew avatar

Watchers

 avatar  avatar

metadata-offline-project's Issues

Milestone 1.1: Publish refined requirements for protocol

Milestone 1: Requirements specifications and latest metadata review
Owner Org: Alzymologist
Additional Context: Aligned with existing offline devices capabilities, current state of metadata, and runtime implementation requirements

Fix storage

Polkadot inherits severally really bone headed pessimizations from Ethereum, like the ecRecover stupidity for ECDSA. Among the worst, we have a trie that does radix 16 hashing, instead of sensible binary hashing, perhaps optimized like in Sphincs+ or whatever.

A proof in dense tree needs 15 copath elements per layer, due to radix 16 being used here. A proof in a binary tree needs 1 copath element per layer and 4x as many layers, so our tree wastes almost 4x the space, if dense. Also, binary trees could employ other optimizations if sparsity were expected.

I've complained about this repeatedly, but every time I convince someone to look at it, they run some half assed test on an artificially sparse tree, which does not reveal the problem as clearly. In fact, we should've semi-dense trees in production. Also, all trees should be better optimized to be denser in the first place.

Anyways, our storage makes PoV blocks around 4x larger than necessary. How does this impact wallets?

If you want chain metadata to be signed by the transaction, ala https://github.com/Alzymologist/metadata-offline-project/blob/ms1-draft/milestone_1.md, then

  1. you'd want this metadata to be checked by the chain too, not merely the block producer, and
  2. you'll likely access this metadata elsewhere in the transaction

In essence, your transactions look more like PoV witnesses than traditional blocks. Assuming all transactions work this way, then naively you've doubled your PoV blocksize, possibly more than doubled the original block size. As a solution, you should merge the PoV witnesses with this chain metadata.

Do we make the wallet metadata employ the same storage primitives as the chain storage? Ideally yes if they're the same, but no if different, with the no case requiring more witnesses in them metadata, again wasting some space. We'd thus prefer if wallet metadata and chain use exactly the same storage.

We cannot migrate wallets nearly as easily as we can migrate chain storage though, so..

We should replace this stupid radix 16 hashing with binary hashing before shipping a wallet which does this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.