Enforce address regex requirement for permissions

+1 vote

I want to make a semi-open blockchain. Anyone will be able to connect and read streams (I'm using JSON streams as a public database) but I want to limit users who can write to and mine the blockchain. I only want users who's address matches a specific regex expression getting granted appropriate permissions. For example, if their address starts with 1mine, the address is granted permission to mine. If it starts with 1json they are granted the send, receive, and create (for JSON streams) permissions. Looking at https://www.multichain.com/developers/address-key-format/ MultiChain’s addresses and private keys can be fully compatible with Bitcoin’s. Can I use a Bitcoin address generator like https://github.com/exploitagency/vanitygen-plus to generate the needed addresses and private keys and import them into Multichain? The idea is that users would have to spend resources to earn an address that's capable of mining or writing to the shared JSON database (hashcash).

I don't want users submitting addresses they don't have the private key for, so I'm going to require users use signmessage and I'll use verifymessage to prove they really have a valid public/private key pair. The verification and permission granting will be done with a script on a central server.

asked Feb 2, 2018 by Anon

1 Answer

0 votes
Best answer
If you're already using a central server to verify that users have the private key for the address they submit, why not also apply the regular expression rules on that central server as well?

In any event, there isn't currently a way in MultiChain to define these kinds of permissions based on arbitrary criteria. Look out for filters coming in MultiChain 2.0 which will provide a solution:

answered Feb 3, 2018 by MultiChain
I'm granting permissions to any address (this will be a public blockchain) that fits a hashcash requirement. For now the granting will be done automatically with an unattended script but I'm planning on hopefully integrating the logic into MultiChain 2.0 when it's developed a bit more.

Basically I want to know if I can import an existing Bitcoin private key and address with the settings mentioned in https://www.multichain.com/developers/address-key-format/ into MultiChain.
Yes. if you set the blockchain parameters as given in that page, you can definitely use Bitcoin private keys and address formats with MultiChain.