I want to use a private Ethereum chain for a specific purpose.

I want users to be able to execute contracts that I have created or that I have initialized the blockchain with, but I do not want users to be able to create new contracts.

Is there any way to do this through either settings or a simple source code edit (in geth specifically)?

Just the node I provide the users not being able to accept new contracts would suffice.

  • A way would be to top the gas price for contract creation to a very high amount and you are the only one that rich. Or you fork after contract creation and disable the opcode – Roland Kofler Jan 4 '17 at 7:39
  • Wondering this same thing, did you find a solution? – Deekor Apr 7 '18 at 1:36

As quoted frm the yellow paper:

There are two types of transactions: those which result in message calls and those which result in the creation of new accounts with associated code (known informally as `contract creation'). Both types specify a number of common fields (...)

Transactions with contract creation have a specific field "init:" that is not empty. The mining nodes can filter transaction on that condition.

Alternatively as suggested by Roland Kofler you can speficy the gas cost of the opcode CREATE to be very high thus not allowing your poor users to pay for it. This maybe the most straightforward solution. You can also have your miners set gaslimit below the cost of the CREATE so you could still create by mining a bigger block

| improve this answer | |
  • edited my answer – jerome de tychey Jan 6 '17 at 14:46
  • Now you can comment anywhere ;) – Afr Jan 6 '17 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.