How to add multiple users to a single blockchain

+2 votes

I am trying to create a Java app that uses blockchain for file storage.

What I want to know is what is the best way to add unique users to the blockchain when they sign up? Looking on the https://www.multichain.com/developers/json-rpc-api/ the only param that jumps out at me is getnewaddress. Is this the best option to use when creating a new user?

asked Jan 28, 2018 by doldy101

2 Answers

+1 vote

Hi,

Yes you can use getnewaddress. But your application is not a block chain application, because the data will be on only one machine. The wallet will be only one and will have multiple address. At the end if something happening to your machine, BOOM.. 

    

answered Jan 29, 2018 by shivap17
The way I would structure the project is have a few nodes that are running multichain.
But what would the best way to include new users that would allow then to upload files and save them? is there a better way than using getnewaddress?
0 votes
It all depends on your trust model and method of authentication. If users will be identified at the application level, then just use streams for your files, and use the stream item key to identify the user who created it.
answered Jan 29, 2018 by MultiChain
For authentication I was going to have another blockchain that will store the users and then each user will access the file storage chain.
I am still trying to understand it all, so apologies if I am not making much sense
It would likely be better if you used the same blockchain for both users and data.  If you are not going to be distributing the executable files (full node), but only using a web interface (API), then during your web app's user account creation process, have one of your designated blockchain addresses (with proper permissions) create a new address (getnewaddress) for the new web site user account, and subscribe that addresses to the applicable existing stream, or create a new stream for that address, make sure it has proper permissions, and continue along that route.

Obviously you want to be running 2 or 3 nodes, and if you want to make one node/address responsible for the creation of new addresses, and another node responsible for the creation of streams, that is an option (whether it is beneficial is something else entirely).

You can subscribe existing addresses to new streams if/when needed.
...