Skip to content

Instantly share code, notes, and snippets.

@bitjson
Created February 16, 2024 04:10
Show Gist options
  • Save bitjson/6be7fbca3b3f77d60bc8953439e42612 to your computer and use it in GitHub Desktop.
Save bitjson/6be7fbca3b3f77d60bc8953439e42612 to your computer and use it in GitHub Desktop.
{
"$schema": "https://ide.bitauth.com/authentication-template-v0.schema.json",
"description": "This template includes worst-case contracts along several dimensions to test the performance of Bitcoin Cash virtual machine implementations.\n",
"name": "Targeted VM Limits Benchmarks",
"entities": {},
"scripts": {
"unlock_minimize_redeem_bytecode_length": {
"name": "Unlock",
"script": "<1>",
"unlocks": "_hashing_limit"
},
"unlock_post-deployment_hashing_limit": {
"name": "Unlock",
"script": "<1>",
"unlocks": "post-deployment_hashing_benchmark"
},
"_hashing_limit": {
"lockingType": "p2sh20",
"name": "1) Hashing Limit",
"script": "<0> <520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\n<520> OP_NUM2BIN OP_HASH256\nOP_DROP\n\n\n\n"
},
"post-deployment_hashing_benchmark": {
"lockingType": "p2sh20",
"name": "Post-Deployment Hashing Benchmark",
"script": "<0> <10000> OP_NUM2BIN OP_HASH256\n<10000> OP_NUM2BIN OP_HASH256\n<10000> OP_NUM2BIN OP_HASH256\n<10000> OP_NUM2BIN OP_HASH256\n<10000> OP_NUM2BIN OP_HASH256\n<10000> OP_NUM2BIN OP_HASH256\n<3703> OP_NUM2BIN OP_HASH256\nOP_DROP"
},
"_stack_memory_usage_limit": {
"lockingType": "p2sh20",
"name": "2) Stack Memory Usage Limit",
"script": "OP_2DUP\n\n// OP_3DUP * 79:\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP\nOP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP OP_3DUP \n\n// OP_DEPTH\n// stack: 1 byte, 397 bytes, 241 * 520 bytes = 125,718 bytes\n\n// OP_2DROP * 121\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP OP_2DROP\nOP_2DROP\n"
},
"unlock_stack_memory_usage_limit": {
"name": "Unlock",
"script": "OP_1\n< $( <1> <397> OP_NUM2BIN ) >\n< $( <2> <520> OP_NUM2BIN ) >\n< $( <3> <520> OP_NUM2BIN ) >\n",
"unlocks": "_stack_memory_usage_limit"
}
},
"supported": [
"BCH_2023_05"
],
"version": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment