Comments (4)
By Merkle Proof, you mean the hash of the path? I'm happy to add that, we just need to consider the two scenarios: a) when the path leads to an object; b) path leads to a value of the object.
The answer for a) is just returning the hash of that object, however, what should we do for b)? Return the hash of the whole object? Hash that value? Open to suggestions.
from js-ipld.
Return the hash of the whole object?
yes, i think.
I'm going to walk through an example so i can get i straight in my brain :P
Lets say we have something like
{
'/': {
one : {
{
'/' : {
'two' : {
'/': {
three: {
val: 'value i want',
somethingelse : {
'/' : <cid>
}
}
}
'dontwant': {
'/': <cid>
}
}
}
}
}
}
and we want the proof for a given root for the path 'one/two/three/val'. The most compact form of the proof would be the json above. ipld-graph-builder generates these proofs by looking up the objects individual and replacing the '/' link with the object they resolve to. But it might make sense to do it at a low low level at of the stack so a node can send a single query and retrieve the entire proof.
But I don't see anywhere in the current stack that would allow you to retrieve such a proof. So a stepping stone would be for resolver.resolve
to return an array of merkle nodes it traversed through to follow a given path. So in the above example it might return something like
[
{'one' : {'/': <cid>}},
{'two' : {'/': <cid>}, {'dontwant': {'cid': '/'}}}.
{'three': {val: 'value i want'}, {somethingelse : { '/' : <cid>}},
{val: 'value i want'},
'value i want'
]
from js-ipld.
//cc @alanshaw & @olizilla who are exploring this with ipfs-inactive/interface-js-ipfs-core#125
from js-ipld.
The resolver now returns all nodes from the root to the destination node when resolve()
is called.
from js-ipld.
Related Issues (20)
- An in-range update of ipfs-repo is breaking the build 🚨 HOT 2
- An in-range update of multicodec is breaking the build 🚨 HOT 3
- An in-range update of multicodec is breaking the build 🚨 HOT 2
- An in-range update of ipld-raw is breaking the build 🚨 HOT 2
- An in-range update of ipld-ethereum is breaking the build 🚨 HOT 2
- An in-range update of aegir is breaking the build 🚨 HOT 2
- An in-range update of aegir is breaking the build 🚨 HOT 5
- Enhancement: Remove dependency on IPFS Blockservice HOT 7
- An in-range update of multicodec is breaking the build 🚨 HOT 2
- An in-range update of aegir is breaking the build 🚨 HOT 7
- An in-range update of aegir is breaking the build 🚨 HOT 2
- An in-range update of ipld-in-memory is breaking the build 🚨 HOT 2
- An in-range update of ipld-in-memory is breaking the build 🚨 HOT 2
- An in-range update of ipfs-repo is breaking the build 🚨 HOT 3
- An in-range update of aegir is breaking the build 🚨 HOT 2
- IPLD with multithreading constraints HOT 1
- Usage instructions fail when run in jest. HOT 2
- TypeError: Cannot read property 'length' of undefined
- Examples of connecting js-ipld to a local IPFS node? HOT 4
- Typings for typescript users? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-ipld.