ArweaveTeam / gateway

MIT License
30 stars 29 forks source link

Support discovery & peering with untrusted nodes #7

Open CDDelta opened 3 years ago

CDDelta commented 3 years ago

For my use case, I want to be able to discover and peer with untrusted Arweave nodes to retrieve data as opposed to defining my own list of trusted nodes.

To do so, the gateway will need to first discover nodes to peer with then it will need to verify that the data it receives from those nodes are correct.

samcamwilliams commented 3 years ago

Very nice idea. Would love to see this.

Blocks can be verified to be valid by checking that a majority of the peers agree on it (that's my understanding at least)

Not even necessary -- just validate the deephash of the block structure you are given matches its ID.

PRs welcome!!

CDDelta commented 3 years ago

Not even necessary -- just validate the deephash of the block structure you are given matches its ID.

Ahh, I phrased myself wrongly here. What I meant was the gateway needs to somehow check that the block it has is the longest chain/the one miners will extend.

I believe the only way to do this is to check with node peers?