A Distributed Service: Security, Blockchain and a Mycroft Token

Originally published at: http://mycroft.ai/blog/a-distributed-service-security-blockchain-and-a-mycroft-token/

Should Mycroft build a blockchain-enabled backend?


On March 14 I said hello to Mycroft and my Mark 1 didn’t respond. We were experiencing a brief outage and http://api.mycroft.ai was offline. This brought to mind a comment by user @gorbachav on Fred Wilson’s blog post about Mycroft:

@Gorbachav: The device needs an account at the service creator. Once they go belly up, you’ll have yet another useless IoT device filling your e-waste drawer.

Well……we aren’t going “belly up”…but @Gorbachav has a valid point. Like Siri, Assistant and Alexa - Mycroft’s service hinge on centralized infrastructure.

But what if it didn’t?

Decentralized Control

What if we can build a backend for Mycroft that is distributed, secure, scalable, reliable and isn’t dependent on a centralized authority? Given the importance of what we are building, wouldn’t that be a great way to manage user accounts, API aggregation, and device settings? There would be no company to fail, no data center susceptible to power outages, no central authority for repressive regimes to pressure. Wouldn’t that be a great solution?

This made me think of a technology I’ve been playing with since 2013… blockchain.

What the Heck is Blockchain?

You may be familiar with Blockchain as the technology that underpins Bitcoin, Ethereum and other cryptocurrencies, but did you know that modern blockchain technologies are Turing complete? Using smart contracts, you can create applications that can do anything a stand-alone computer can do.

The blockchain is a great way to keep a secure, distributed, reliable and scalable ledger. It is a great place to store transactional information. It can be implemented as a keystore for encryption keys that unlock larger volumes of data.

 

That’s Cool but How Does Blockchain Improve Mycroft?

There are a number of huge advantages to using the blockchain to distribute Mycroft’s backend.

Privacy

By using the blockchain to create a ledger and smart contracts to process data, we can encrypt voice samples, user queries, query results and other user data, then hand control over to the user. The data can be stored centrally or in a distributed system, but the keys for the data will reside with the users. They can control how their data is used and, through smart contracts, make it available on a limited basis for training of the AI.

The data belongs to the user. By using blockchain we empower the user to decide who gets access to it and on what terms.

Reliability

Decentralization would ensure that the Mycroft backend is always available. There would be no central authority to aggregate API keys, manage user accounts or store device settings. API aggregation would be done through smart contracts and both user accounts & device settings would live in storage managed through the blockchain.

Processing nodes would be responsible for presenting services to users. They would also be responsible for managing storage. Users who provide processing power or storage would be rewarded with a digital token. Every active Mycroft Mark I and Mark II on the network would, with permission from their owner, become a processing node on the network and mine tokens.

Economic Sustainability

Where will this token be spent? Users will be required to spend a fraction of a token every time you ask Mycroft a question that accesses a paid API.

Technologies like Mycroft require a ton of APIs to work. Speech-to-text, knowledge queries, sports scores, weather information – all are necessary and they all cost money. Today our company is subsidizing these services, but that model isn’t sustainable without large corporate customers. Using blockchain technology along with a token system Mycroft can be configured to make micropayments for the various services it accesses.

Users of the service could be issued a small amount of token when they sign up. As they use the technology their wallet would gradually decrease. Each call to a paid API would gradually deplete their balance. To fill it back up users would provide storage, processing power or simply pay for an additional token.

Users could even pay with privacy like they do with existing technologies from Amazon and Google. They would be able to sell their data to aggregators who, I’m sure, would love to purchase the reams of data users generate.

The important point is that it is the user’s choice. The system acts as the user agent. The user’ chooses what to do with their data.

Governance

Right now I am the final authority on all things Mycroft. I control a huge majority of the voting stock and have pushed hard to curtail the voting rights of other investors. I have all of the root passwords, I sign the checks and ultimately I am responsible for every single decision the company makes. Though it is nice to be in charge, it has always been my goal to turn Mycroft over the community.

By deploying a digital token we create a mechanism for giving the Mycroft community control of the technology. And through the blockchain, we can ensure that voting is both secure and fair. This will further empower our community and put them in control of the technology’s future without building a cumbersome bureaucracy.

Environmental Impacts

But won’t all of these devices mining tokens use a lot of electricity? No. We’d design it with economic controls like “proof of stake” that help prevent a processing power arms race. The goal would be to allocate exactly as much storage and processing power as is required at any given moment.

Other Benefits

A digital token would be a great tool for rewarding developers for helping with the core Mycroft stack. Developers who contribute to the platform could be rewarded with tokens that can then be converted to Ethereum, Bitcoin or fiat currency.

Creators of popular skills could also be rewarded with a fractional token when users use their skill. This provides developers who create popular skills with a reward every time a user accesses their skill. This is something that even large players like Google and Amazon have struggled with – how to allow developers to get paid for building great skills.

Blockchain solves the problem in a secure, decentralized way.

Challenges

There are certainly challenges. Deploying blockchain successfully requires a community of miners to hash transactions and process blocks. It is also difficult to scale transaction volume. The Bitcoin network, for example, can only process 3 to 7 transactions per second – this is a small fraction of the transaction volume Mycroft will process as the agent is more widely deployed.

Building secure software is also extremely difficult. Ask any German U-Boat captain who trusted an Enigma. Crypto is hard. We’ve got a great team, but implementing a distributed service with lots of storage and a large user base is going to be difficult. Doing it securely, more so.

We are also going to have to fight both scope creep and feature creep. Developing the Mycroft voice agent has already taken superhuman efforts from our developer team. Implementing a distributed service based on Blockchain in addition to building a great voice user experience will be a significant challenge.

Build It?

Should we build it? Honestly, I don’t know. We are at a stage in human history where we can build anything that physics allows. We have electric cars that outperform gasoline cars. We have re-usable space launch systems. We have quantum computers and miracle drugs. We can build anything. The real question is, does anyone want us to?

Over the next several months, we are going to set out to answer that question: Does anyone want this built and, if so, are they willing to put up the resources. Does anyone want a Mycroft token? Will users get enough benefit out of Mycroft to pay for the API calls they use? Are we just glomming on to a hot technology or do we have a real and compelling use case?

Our team is working on ways to answer these questions. If you have an opinion and want to weigh in, join our discussion here.

 

 

 

11 Likes

:heart_eyes::heart_eyes::heart_eyes:

1 Like

Great idea. Definitely should do it. Excited!!! :crazy_face:

1 Like

Correct my if I’m wrong, but isn’t it possible to setup the Mycroft backend on your own server? So if Mycroft went belly up anyone without enough skills could setup their own, right?

3 Likes

@maxolasersquad - yes, you can set up the service locally, but you’ll need to set up API access for search, Q&A, sports data, weather data, etc. You’ll also need to provide a speech-to-text service which, even with DeepSpeech, requires a GPU.

Though I’m the first guy to stand up and applaud folks who undertake this, most Mycroft users don’t have the time or inclination to set this up, so we are looking for ways to securely distribute the back-end in a way that is economically sustainable. TANSTAAFL - There ain’t no such things as a free lunch. How do we make a framework that respects privacy, isn’t centralized and securely provisions services while respecting this universal rule?

3 Likes

I have long seen the blockchain as a eventual natural home for AI. I think this would be great. My one gripe, across the board for all computers/OSes and apps is setup. Another commenter sited that users don’t have time to set all of this stuff up. If you could make the install painless, I think adoption would soar. A readily accessible easily configurable, fully customizable, personal AI that lives on the blockchain and can be harnessed by yourself or even other users?

Fuck yes please.

2 Likes

If I recall correctly blockchain has throughput issues, which is why it will be difficult for bitcoin to scale because it can only process 7 transactions per second. I’m not sure how that might affect this but I’d highly recommend considering that aspect before committing any resources.

3 Likes

it would also be nice to have a cookbook for setting up the services locally. It might be a bit of work but those folks that are looking at mycroft because they are privacy minded may also want to consider this step.

5 Likes

I’m certainly no expert on how Mycroft’s backend works, but using a blockchain-based backend seems like a bit of a square-peg-round-hole problem to me. It might work, but it’s not really ideal.

You mention that you’re planning to have Mark I and II systems form the backbone of the distributed network. If that’s the case, the processing would have to be something they could handle. If the processing is something they can handle, they wouldn’t need a distributed network to do it for them. They could process it locally and skip the extra latency, privacy concerns, and everything else that comes with an Internet transaction. If that’s not what you intend, then there’s the same problem of Mycroft nodes relying on a centralized system for processing queries, which can disappear, and we’re not really any further ahead.

There’s also the problem of size. The Bitcoin blockchain is around 150 GB large right now, and growing constantly. If you have to process and store a transaction for every single API call done by every single Mycroft node in the world, that’s going to add up quickly. Using pruning like Bitcoin recently added might prevent systems from filling up completely, but for a fresh Mark II to sync to the network is still going to take days, which is not a good new-user experience. For people on limited bandwidth it’s worse; even once you get the blockchain updated, it’s still constantly sending you notifications of every transaction and every block.

You also encounter the problem of transactions not being confirmed into the network until a block is generated. This would end up with either asking Mycroft a question taking 10 minutes (or whatever your block time is) to get a response, or the response being given without a payment being confirmed, which would make it very simple to get paid services for free.

There are aspects of this proposal which seem like it could work, but I really don’t think it’s the solution to the problem at hand. To me, it seems like making it easier and simpler for other people to set up backends, for themselves or the public, would be a better long-term solution.

11 Likes

I definitively like the idea to make it decentralized and more P2P, Not so sure about the idea that everything has to be secured by a blockchain.

If you plan to go the distributed computing route, please consider working with existing technologies like the Golem Network. There is work already done by several groups on distributed computing and it would be a big undertaking to reinvent the wheel.

1 Like

heyhey - sorry i know i’m new here and sadly i’m a little bit in a hurry … maybe i should have therefore answered later and with a more fleshed out reaction … but anyway … here we are …

…to be honest i think using blockchain is not the ideal solution for something microft. Blockchains get slower and less usable the more they get used (yes people are working on lighning and sharding… but those technologies tend to no longer be really decentralized … so…) … in addition blockchains are not privacy protecting (in general) but everything is happening openly for everyone to see (what is pretty much the foundation for their decentralized security)

What I personally would think would be a way better solution for microft could be the SAFE Network ( https://youtu.be/i-RLdU8Y0Qc )
The SAFE Network itself and the native Currency Safecoin is not yet ready for prime time and the project is still in alpha … but they already have a partnership with Identillect where Identillect wants to use a corporate version of SAFE (so known, self hosted storage nodes; no danger of being attacked by others) as scalable and self-managing data solution for their customers.

All Data on Safe is Encrypted and privacy protection is a huge mission here … Smart Contracts will be enabled on Safe too and since there are no blocks that are built everything is happening at network speed … (maybe the 10 key facts list can be of help too)
…Yes indeed it is technology that is not yet proven to be as robust as blockchain is; but it’s more privacy protecting, faster, scalable and less energy consuming :wink:

…sorry for writing this in kind of a hurry…but not sure if i have any time later… so… good luck whatever route you pick! and i will try to check back later and read more carefully through other posts/your thoughts in the initial post…

2 Likes

I feel blockchain is the wrong solution for Mycroft. I would rather us invest into developing user networks, so if I am a Mycroft user, I can configure a network of several Mark I, several Mark II, a couple Ubuntu distributions, several Picrofts, several yet to be developed enclosures like a car, lightswitch, etc. and linking them all together into a network with a centralized server Mycroft instance of my choice. This server could be in the cloud, operated by a third party or at a server at my residence. Then my Mycroft deployment is connected and the parts talk together and work together to solve my problems. I think networking with me and everyone else on the project is probably not necessary in the long run as the API services that Mycroft AI are subsidizing now could be individually passed onto me as a user for a local or private cloud deployment from those services, or for a third party or centralized platform, billed through that platform such as Mycroft AI or another cloud based backend that competed with Mycroft AI.

4 Likes

Blockchain and Mycroft’s voice/AI are two separate technology stacks.
There’s no point in merging the two without tangible benefits either to the company or end users (I prefer end users ;).
I don’t believe that blockchain would improve the user experience as it’s a backend technology that consumers would not directly interact with. Furthermore, Mycroft doesn’t need the blockchain for security.

Instead, the blockchain could be used to address the economic and sustainability issues. Blockchain is good for decentralization and transparency/trust. I think most of us already trust Mycroft, so the question is how can we ensure our devices still work 5-10 years in the future.

4 Likes

Ethereum was designed as a platform for decentralized applications as well as contracts. Why not make use of the application side for expanding Mycroft capability as well as the contract side to allow users to sell their usage info as they choose?

Seems easier than coming up with your own coin. Having said all that, I like the decentralized idea.

I don’t think Blockchain is the correct solution either. If I’ve understood it correctly, the API is currently mainly for STT and Configuration-management across devices.
While STT is currently done by relaying requests to Google, you plan to switch it to DeepSpeech by the end of March, but unfortunately still on your servers. Don’t get me wrong there, I trust you more than Google or Amazon - but I don’t trust you.

Now that Intel developed a compiler for TensorFlow (which DeepSpeech is based on?) to FPGAs and GPUs, I’d prefer if it was possible to do something more like:

  • Keep the current API running as it is and switch to an online deployment of DeepSpeech for the Mark I
  • Use the compiler (if applicable) to locally deploy DeepSpeech on the FPGA? of Mark II devices and use the API for everything else left

I don’t think the delay of a local deployment of DeepSpeech would be so much worse, since DeepSpeech took 3-5 seconds on my old Intel-CPU, whereas the cloud request to your API took around 7 to 8 seconds before the console showed what I said with a PiCroft instance.
For the Mark II there’d then be only the shared configuration problem left, which should be not that hard to resolve, compared to a server-farm with GPU deployment.

3 Likes

I don’t think you should jump like anyone else on that “Blockchain train”…
Blockchain is limited and on very many points at it’s potentially end right now.
It might be clever to base on a decentralised encrypted technology like the SAFE network of Maidsafe (have a look at http://maidsafe.net).
It’s a blockchain without a blockchain :wink:

3 Likes

I vote Yes. Being decentralized / distributed is in perfect harmony with the brand and mission. And I do believe it’s the future for products/services like yours.

From a geeky standpoint, it’s also a cool way for devs to dabble in both ai and decentralized, blockchain driven systems.

1 Like

Distributed network, absolutely. You’ve already got Mycroft Enterprise with the concept of running your own GPU based server. What if this concept were to be extended to a simple to installed service that all have common connectivity to the APIs and people who want to leverage their hardware can rent it out?

(Torrent anyone?)

Could blockchain be leveraged for the sake of API, configuration sharing and some token payment mechanism across this distributed network? Yes! Does there need to be a Mycroftcoin to do it? Not necessarily.

If you want to try some tests I’ve got a couple 1080ti’s I might be willing to run as part of a PoC :slight_smile:

For the Mycroft device itself, as others have said these are made to be super low power and I for one would love to see the compute envelope pushed lower (future battery powered wearable anyone?). Putting a burden on devices sounds like a bad idea to me.

5 Likes

Oh, forgot to add - the other challenge will be how this compares to what else is in the market…

You mention a concept of payment based on API usage. While this makes perfect sense to me and I assume a number of other supporters I’m skeptical that this would make a lot of sense to the mass market that is used to giving their data to Alexa as payment for a “free” service.

Maybe it could be free if you share your data, or you could pay for API use with full control over your data? (also not ideal, just spit balling on a way to bridge the gap between market expectations and the very real costs of running a service)

1 Like