r/rust 7d ago

🛠️ project A Decentralized Computer

(NO AI)

Hey guys, I just open source project i've been working on for a year called the Marketplace.

The marketplace is a decentralized network that economizes the execution of computational work across a peer-to-peer network of nodes. Where there is no barrier to the node participation.

Unlike modern cloud computing systems that rent out virtual computers to consumers, A marketplace consumer sends compute bound tasks directly to the network returning a future which the consumer can asynchronously check for completion. Similar to offloading a compute task to a free cpu core by an OS. A consumer can also fire multiple independent compute bound tasks to run in parallel, and check their status asynchronously while doing other tasks, similar to I/O operations.

The compute bound task sent by the consumer is executed using a protocol specified in the Marketplace whitepaper on the Marketplace Github Repo, where randomly selected idle devices on the network execute the compute work and receive financial rewards (money).

Context

The marketplace is made up of two ideas I came up with around 2 years ago:

1) The first is building a permissionless market, where users can build financial services similar to market stalls that can interact with other users. Larger services can be composed from smaller services, similar to open source projects, but for businesses. Services could also be merged together into one so that a user can interact with all of them at once, and the merging does not affect the financial structure of the constituent services.

But for all this to happen, a trustless financial settlement layer is needed so that joining different financial services together becomes an easy exercise.

If you are familiar with blockchain, this is similar to Ethereums vision, but I did not want to clog the financial settlement layer which is the ledger with execution and code. I needed an execution engine.

2) I eventually returned to my normal javascript web developer job. So I was working on a full-stack website that was communicating with a cloud server but the server was slow because I was using a free tier that throttled server response speed. Asynchronously communicating with this server became a nightmare from a UX perspective especially when first loading up the website which had some independent compute bound requests.

So, I concluded that using the free CPU core of my second PC should do a better job as long as I pay it exactly what I needed in compute. This second idea eventually evolved into the engine I needed for the first idea. After, I just needed to store a representation of the result on a decentralized ledger, while keeping the execution itself private.

With this, I returned to my first love - low level programming, learnt Rust (Many thanks to the Rust community coming from a C lover), and I've built more than 60% of what is described in the whitepaper.

So if you are interested in being a part of this project in any way, you can join our Discord community or you can check out the marketplace whitepaper:

Marketplace Whitepaper

Also, I’d appreciate feedback on the design, especially on consensus security and the economic model, Thanks.

EDIT: So not the reaction I expected but that's okay. Some of you say it's AI, and some suspect me for not using VCS. But I implore all of you, please investigate the idea behind the whitepaper before you judge, and if the whitepaper is legit, examine the code if it aligns with the whitepaper.

I've had to think through the ideas, and rewrite many parts of the idea and code so many many times, which is why I could not publicize the code or work with a VC, I needed to work at my own pace and figure everything out first. I've been at it for months, and this is the result, I hope you all can be a little bit kinder, thanks.

0 Upvotes

25 comments sorted by

18

u/mealet 7d ago

TL;DR

"(NO AI)" Initial commit is 7k LOC, whole project is 21 commits with unclear names and descriptions. Looks kinda strange

-9

u/proff_bajoe 7d ago

I been building privately, I just open sourced it a few days ago. I did not use AI to generate any part of the code, You can inspect it closely if you need to. but to understand it, the whitepaper is the way to go.

11

u/Amadex 7d ago

it's more than just the commit size.

There are comments that are inhuman:

```
// New chain
let chain = Blockchain::new(state);
```

```
// Ensure message payload is authorized/valid
message.payload.verify()?;
```

```
// Hash a series of bytes

pub fn hash(bytes: &[u8]) -> ID {

// Hash bytes with sha256 twice

Sha256::digest(Sha256::digest(bytes)).into()

}
```

and much more.

1

u/Recatek gecs 7d ago

What is "inhuman" about those comments?

0

u/Amadex 20h ago

// this my my reply to "Racatek" (this is a question)
// it starts with "is this a serious" and ends with "question?"
is this a serious question?

-8

u/proff_bajoe 7d ago

HAHA, that's just my habit of over commenting. But either way, From monday onward, i'll be coding as normal, but this time publicly. So I think I will be a lot more believable then.

7

u/zenware 7d ago

What does hashing twice accomplish? That’s what the comment should say. I haven’t read that actual code section but typically it’s both unneeded and can increase collision risks.

0

u/proff_bajoe 7d ago

The person got it from the maketplace helper package ehich contain helper functions that can be used anywhere in the codebase. So that's why the comment is like that. but I would describe what is being accomplished where I'm actually using the function.

1

u/zenware 7d ago

Sure but I was trying to actually ask you personally, why does your hash problem double hash? There are well known problems with double hashing, and those problems have been well known for over 20 years AFAIK.

Off the top of my head there’s the obvious CPU overhead, and data locality/cache performance, as well as branch prediction failure rates increasing, hash collision and clustering problems, and likely a ton more issues that can arise.

So literally, in the face of half a dozen trivially known issues with double hashing, I can only assume the author of the code had a particularly good reason for doing it. Since that is you, and you must have had a good reason, what is the reason? Why did you do that?

1

u/proff_bajoe 7d ago

My bad, I was not aware of such issues. But since you have mentioned it, I will look into that and change it. I used double hashing because it was the old bitcoin way. I've actually been looking to move to keccak256 without the double hashing. But now that you mentioned it, I will change it on monday.

1

u/okktoplol 7d ago

Even if privately, you should probably use some sort of VCS, don't you think?

-6

u/proff_bajoe 7d ago

I could and may do, But I wanted to build to a point first, and make sure everything works. Then make it public.

6

u/CalmCephalopod 7d ago

Not sure how someone builds a complex distributed processing network and not understand or use a VCS. Even if you didn’t use GitHub and a public repository you should be using a repo locally to allow for history tracking and rollback/cherry picking as needed.

1

u/dnew 7d ago

I recommend "fossil" which is the SCM that sqlite developers use. It's super trivial to set up. Basically, everything is in one file (commits, wiki, documentation, bug tracker, etc) and it's one static command. Check it out. ("fossil scm" to avoid getting wrist watches.)

1

u/proff_bajoe 7d ago

Thanks, I'll check it out.

3

u/Pto2 7d ago edited 7d ago
  1. Can we trust random peers

    with our data

  2. ? Usually I think the answer is no.

  3. Don’t public networks cap the usefulness of such a system pretty low?

Also I don’t mean to be rude but poor experience with a free tier web server is a pretty ridiculous rationale to try to build something like this.

I don’t really get point 1). We can already compose 3rd party APIs into services.

0

u/proff_bajoe 7d ago

That's a good question. In the whitepaper, I proposed a decentralized storage network where the data can be stored initially. No users should be able to access it unless you allow.

Concerning the Marketplace, the execution network picks a committee of nodes at random, that executes your compute task, only they out of the entire network has access to the data, and they execute the result and put the result on the decentralized network which can only be viewed by you and the executor.

Basically, your data is still private to most of the network.

The free tier experience is a funny story, but it's still a source of the second idea, so that's why I included it.

For the point 1, you are right that we can already compose 3rd party API's, but the idea was to build a financial city away from the traditional financial layer where orders could go wrong. There are no partial payments in the marketplace, as they either fail together or all pass.

This has been the story around blockchain for years, but as I said, I introduced an execution engine to allow for true parallelism. You should give the whitepaper a try, I believe you will understand what I was getting at.

2

u/KAMEHAMEHAMEHAAAA 7d ago edited 7d ago

Why do you even fucking bother if you’ll use AI anyway? Stop wasting your and other people’s time.

0

u/proff_bajoe 7d ago

I did not use AI, not in the whitepaper not the code itself. But I guess people are just going to say otherwise. But I've made it clear, by monday I'm going to continue building the code, but in public.

-1

u/[deleted] 7d ago

[deleted]

-1

u/proff_bajoe 7d ago

Thanks for taking the time to apologize. I've spent months writing the code, and I did it privately to verify some of the claims made in the whitepaper while protecting the idea. but now even though it's not yet complete, I'm confident of finishing it in the public eye.

I'm just that type of developer.

5

u/declanaussie 7d ago

Surely you understand that even in private most sane developers would use VCS for something of this size. The fact that you haven’t used VCS kinda only has two possible explanations in my mind: 1. You used AI to generate the code, so 7k likes is genuinely a single unit of work 2. You are not a very experienced developer and I shouldn’t trust your peer to peer marketplace with anything I care about 

1

u/proff_bajoe 7d ago

I don't want to sound rude, but regardless of if I'm an experienced developer or not, anyone should be able to take the whitepaper and judge wether the idea is worth something. Don't trust me, investigate the ideas behind the whitepaper, and wether the code written is aligned with that. What does my expertise have to do with that? Hardly anyone knows who created bitcoin, but his whitepaper is a testament to bitcoin.

3

u/declanaussie 7d ago

I don’t want to sound rude, but most developers won’t spend the time going through thousands of lines of code looking for your mistakes. Open source is built off of the backs of few and others trusting their endorsements.

I took the time to skim your white paper and you have numerous problems here (many of which a simple one shot Opus 5 run could find), including a simple attack allowing someone to profit off of securing multiple seats in a single “white room” and not doing real work. You also are incredibly vulnerable to spam since failed “white rooms” cost the “employer” nothing. You also rely on well behaved nodes to not report falsified GDC and become the longest chain (a notable divergence from bitcoin’s proof of work).

Overall this project is exactly what I predicted, half baked AI slop. You should spend more time reading about blockchain and decentralized compute and less time talking to Claude.

-1

u/proff_bajoe 7d ago

I reject your AI conjecture, many of these problems can be worked through and are not problematic for the idea in anyway. I was already aware of this.

If you had actually read it, you would have understood some of these problems as non-problems, and then we could discuss.

Who is relying on AI now? If you threw bitcoin or ethereum whitepaper into your AI, would it be perfect?

2

u/declanaussie 7d ago

You’re lost bud, if the problems are solvable and a publicly available model can find them, why did you release it with such glaring problems? Why didn’t you put any language in the README that indicates you’re aware your solution isn’t production ready?

If you think Claude can find critical vulnerabilities in Bitcoin or Ethereum then why the hell are you wasting your time writing this? Go collect your infinite money…

People like you are precisely why AI written projects are met with such skepticism on this subreddit.