BRC20 Programmability

In this standard, we will no longer use the address in the output script as the owner, but the fee payer of the relay transaction as the owner

Key Required? Description
src option Programmable module (high priority): When op is deploy and src exists, it is considered a deployment script. When op is send and src exists, it is considered a call to the execution method,

Please check the complete standards BRC20

Deploy

{ 
  "p": "brc-20",
  "op": "deploy",
  "src": "source code hex"
}

Send


calldata = {
	"kid":"",
	"method":"",
	"params":[...params]
}

{ 
  "p": "brc-20",
  "op": "send",
  "src": strToHex(JSON.stringify(calldata))
}

We should ensure that these keys always have a higher priority than other keys. When src exists, it will be recognized as a programmable module instruction and other keys will be excluded

Minimum OutValue

The satoshi of the first output address should be greater than or equal to 2000

2 Likes

Defining the fee payer as owner needs an explicit authorization rule. A relayer may pay fees for a user, and a transaction can have multiple inputs and outputs, so “fee payer” alone may not identify who is allowed to deploy or call a module. Specify how the owner is derived and which signature must authorize each operation; also clarify whether the 2,000-sat minimum applies to the first output or the owner’s output.

Using the relay fee payer as the owner ties asset ownership to whoever funds the transaction, which may be a relayer rather than the user authorizing the call. The spec should say how that user is authenticated and whether the relayer can redirect the resulting balance. It should also define whether kid identifies a deployed module, since it is empty in the example.