Restrict CosmWasm Code Upload

TL;DR

Terra Classic currently lets any account upload arbitrary CosmWasm bytecode (code_upload_access = Everybody). As a precautionary security-hardening measure, and in line with current CosmWasm ecosystem best practice, this proposal changes that parameter to Nobody, so that only governance can add new contract code.

  • Existing contracts and all contract execution/instantiation are unaffected.
  • CosmWasm is not removed — new code can still be added via a governance proposal.
  • The change is fully reversible and privileges no individual address.

Feedback is requested before this goes to an on-chain vote.

Background & rationale

By default, wasmd (the CosmWasm module) ships with code_upload_access = Everybody. Terra Classic has never changed this, so today any account can store arbitrary contract bytecode on-chain via MsgStoreCode.

Uploading bytecode is the most powerful and lowest-trust action a chain can expose: the uploaded code is processed by the on-chain VM on every validator. As the CosmWasm stack continues to evolve, a growing number of chains are moving upload behind governance as a standard, precautionary reduction of attack surface. This proposal brings Terra Classic in line with that practice.

The goal is deliberately conservative: privilege no one, keep the door fully open for the community to authorize specific deployers later, and change nothing about how existing contracts run.

What changes

x/wasm module parameters:

Parameter Before After
code_upload_access.permission Everybody Nobody
code_upload_access.addresses [] []
instantiate_default_permission Everybody Everybody (unchanged)

What this does not change

  • Existing contracts keep working. Instantiation and execution of already-stored code are untouched (instantiate_default_permission stays Everybody).
  • CosmWasm stays enabled. New code can still be uploaded — through a governance proposal.
  • No lock-in. Every parameter here can be changed again by a future governance vote.
  • No address is favored. The allow-list is empty; nobody gets a special upload privilege.

Future allow-listing

Starting at Nobody forecloses nothing. Should the community later wish to permit specific, vetted deployers (teams, a deployer multisig, etc.), a subsequent governance proposal can simply set code_upload_access to AnyOfAddresses with the chosen addresses. The mechanism to add uploaders via proposal is always available — this proposal just declines to privilege anyone today.

(Note: AnyOfAddresses requires at least one address to be valid; an “empty allow-list” is expressed as Nobody. The two are equivalent in effect, and either can be changed into the other by governance at any time.)

Impact on builders

  • Teams that need to deploy new contracts will, while this is in effect, do so via a governance proposal (or via an allow-list added by a later proposal, if the community approves one).
  • Already-deployed contracts, their users, and all existing dApp activity are unaffected.
  • If you are a builder who expects to deploy soon, please comment below so the community can weigh an AnyOfAddresses allow-list alongside or after this change.

Technical detail — the on-chain message

The vote will execute a single MsgUpdateParams against the x/wasm module:

{
  "messages": [
    {
      "@type": "/cosmwasm.wasm.v1.MsgUpdateParams",
      "authority": "<gov module account address>",
      "params": {
        "code_upload_access": { "permission": "Nobody", "addresses": [] },
        "instantiate_default_permission": "Everybody"
      }
    }
  ],
  "metadata": "",
  "deposit": "<min deposit>uluna",
  "title": "Restrict CosmWasm code upload to governance",
  "summary": "Change code_upload_access from Everybody to Nobody as a precautionary security hardening. Existing contracts and instantiation are unaffected; reversible by future governance."
}

The authority is the governance module account (terrad q auth module-account gov). Current params can be verified by anyone with terrad q wasm params (or the public LCD endpoint /cosmwasm/wasm/v1/codes/params).

Discussion questions

  1. Do you support moving contract upload behind governance as a precautionary measure?
  2. Should we pair this with (or quickly follow it by) an AnyOfAddresses allow-list for known, trusted deployers — and if so, which addresses?
  3. Any objections from active builders who have near-term deployment plans?

Please share feedback here before this is submitted on-chain.

1 Like

I understand, but now builders will depend on governance to deploy their contracts. I think that’s very bad because proposals may sometimes be rejected for ideological reasons, which could seriously hinder development on the chain.

Ethereum, Solana, and other Cosmos chains allow developers to deploy binaries/contracts without this kind of governance dependency, so development isn’t delayed. I’m not a big fan of this idea.

I know Igor. See my DM

This is result of governance / Validators decisions, from may 2022:

  • No new L1 products (No MM2, Forex, Stablecoin etc).

  • Blockchain has got no marketing. 0 offline presence. Nearly 0 online presence.

  • No customer support

  • No quantum readiness

  • No blockchain audit

  • LUNC staking APR is down by ~85% from its ATH in 2023 (~20,5%)

  • LUNC price is down by ~91% from its ATH. We are currently in ATL. Which means that nothing that validators have done has brought an increase in price.

  • Calculations show that it can be as much as ~90% of LUNC holders who are at a loss.

  • The number of active on-chain wallets is down -96.6% from the peak (peak: Aug 22, 498,729).

  • The largest community pool spend in the last two years was about 6.66% of the pool’s USD value at the time (and roughly 16% of the LUNC balance). That suggests the treasury is mostly not used. From a business perspective, that is a complete disaster.

  • Terra Classic Nakamoto Index is 6 - Validators #1-6 hold a cumulative stake of 33.33% or more. It is big centralization of governance.

  • In the last two years, on average only 0.37% of wallets vote on proposals, which means that the governance (and, at the same time, blockchain itself) is completely controlled by validators … thus, validators are responsible for its state.

  • Since May 2022, the rejection rate of proposals in Terra Classic governance is 82.2%. The pass rate is 9.1%. Governance was killing the vast majority of proposals.

  • In last 30 days Terra Classic was on 18 position in terms of IBC Volume in Cosmos Ecosystem. Terra 2 was 7th and it had nearly x42 bigger IBC volume than Terra Classic

  • A big part of Terra Classic infra, is heavily centralized.

  • Over 65% of validators do not have an account on Agora (the official Terra Classic forum) and do not participate in discussions regarding proposals.


So NO. I do not support safety measures that byproduct is:

  • giving Validators more power to put the blockchain and its project into even worse position
  • making more difficult time for developers.

PS. Regardless - Thank you @fragwuerdig for the work and being proactive. I have no doubt that you have only right intentions (safety) with this prop.

1 Like

@DawidSkinder

I am currently going around in DMs on TG explaining myself to everyone like I am a criminal - to gather support for this. You know how that feels like? Outraged individuals approaching me like I want to gatekeep everything and centralize the chain. Like I am an idiot with a power complex.

I myself would vote NO on this if I hadn’t knowledge about something very specific that I reproduced in a local sandbox and that is very critical.

This is to be done. It’s urgent. It’s temporary.

3 Likes
  • I know exactly how you feel like. I’ve been in this situation In Terra Classic. It is not your fault. It is byproduct of lack of leadership and decentralization that nobody asked for.
  • This is valuable insight

I still believe tho that byproduct of this proposal is more power to Validators and more difficult time for developers.

We have witnessed for 4 years outcome of Validators in power. Nothing good came out of it.

We are also not in a comfortable position when it comes to the number of projects and developers.

In my view it varrants research to find alternative solution.

Thank you for bringing this security discussion to the community.

I believe security is essential, but we must also consider the risk-benefit balance, particularly at Terra Classic’s current stage of recovery.

Restricting code uploads could create significant barriers for new developers and potentially concentrate power in the hands of established participants.

Before supporting such a change, I would appreciate clarification on four points:

  1. What specific vulnerability or documented attack scenario would this restriction mitigate? How many security incidents on Terra Classic have actually resulted from permissionless CosmWasm code uploads?

  2. Which comparable CosmWasm chains currently enforce similar restrictions, and what measurable security benefits have they achieved? Examples such as Osmosis and Stargaze may be useful, but their different permission models and experiences should be examined.

  3. How would we ensure that independent developers can continue building without disproportionate financial, administrative, or governance barriers?

  4. Have alternative security measures been evaluated? For example, automated code analysis, open-source security scanners, AI-assisted auditing, or other technical safeguards that preserve permissionless development.

My current position is that Terra Classic should prioritize open innovation unless the security benefits of restricting code uploads clearly outweigh the costs.

Security and decentralization should reinforce each other, not become competing objectives.

I look forward to hearing the technical arguments and evidence behind this proposal.

I think that specific vulnerability can´t be discussed publicly. It would lead bad actors to the gate to try to exploit it.

1 Like

Firstly, I ask that people speak with @fragwuerdig in a respectful and professional manner. Its disappointing to hear he feels he has had to defend himself like “a criminal”. He has the best interest of the chain’s security at heart, even if the original proposal is read as is, which it shouldnt be - based on conversations with @fragwuerdig the proposal is poorly worded. The proposal isnt precautionary nor is it about implementing cosmos best practices, it is about a known potential exploit vector that is directly mitigated by restrictions on cosmwasm deployment addresses. So it is more important than as written.

Second, for CL8Y ecosystem, the proposal as is, prevents us from implementing emergency upgrades for our deployed contracts. Every new AI model released discovers new vulnerabilities, and we have to run them, build, and deploy fixes immediately - 7 days is far too long. Incident response has to happen in minutes, not days.

As long as this is paired with whitelisting the CL8Y Ecosystem Multisig:
terra1zlmv2xydxcusurtr6rl78wsvytdc6mfex6hep7
The CL8Y ecoystem will be able to conduct normal operations in a secure fashion with the new proposal. However, that must be immediately with minimal delay after the implementation of this cosmwasm restriction proposal - each day that goes by without whitelisting is a security risk.

That said, my personal opinion is that permisionless deployment should return quickly as it helps new ecosystem members deploy trading bots and other tools. This ultimately drives LUNC and USTC onchain activity and burns. However, I understand that there are tradeoffs extending beyond the CL8Y ecosystem, so the proposal & voters should take the balance of increased LUNC and USTC burns vs security into consideration.

2 Likes

I can give you details in DMs in TG if you give me your TG username. I can’t share evidence, as it gives specific insights that I am uncomfortable to share on a public forum

1 Like

Actually - it is not poorly worded. I wanted to formulate this proposal to avoid any specific vectors. I wanted to avoid mentioning that I found and confirmed a vulnerability in a sandbox environment. Because it is not good practice to disclose it that way.

However, it seems I cannot get any support for this without becoming specific at least when talking to validators or in DMs.

The “poor” wording is fully intentional

1 Like

Frag clarified the reason behind it. I support this proposal because security is what has kept this blockchain alive. Thank you, Frag, for the excellent work you’ve done for the community.

Help me to understand.:folded_hands:

@ConsciousnessFirst