Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jhbertra/2537036687ac003a4cb1597b4af77f3b to your computer and use it in GitHub Desktop.
Save jhbertra/2537036687ac003a4cb1597b4af77f3b to your computer and use it in GitHub Desktop.
Management of Merkelized Marlowe Contracts
{
"contract": {
"timeout": 1655663503000,
"timeout_continuation": "close",
"when": [
{
"case": {
"deposits": 12000000,
"into_account": {
"address": "addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j"
},
"of_token": {
"currency_symbol": "",
"token_name": ""
},
"party": {
"address": "addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j"
}
},
"merkleized_then": "30032ba38696e2a2c9f0f37fef7fa8cc7e2063ed4511420939be0ecfa95c0587"
}
]
},
"continuations": {
"30032ba38696e2a2c9f0f37fef7fa8cc7e2063ed4511420939be0ecfa95c0587": "https://gist.githubusercontent.com/jhbertra/2537036687ac003a4cb1597b4af77f3b/raw/34b9c0725b3ee49aa85c859d2ccfdeaf49a96cd6/30032ba38696e2a2c9f0f37fef7fa8cc7e2063ed4511420939be0ecfa95c0587.json"
}
}
{
"contract": {
"timeout": 1655663504000,
"timeout_continuation": "close",
"when": [
{
"case": {
"notify_if": true
},
"merkleized_then": "f9232556d1ec9d7bb7d767468336985f350fd3bdeb3360c10f38e620cc8b200c"
}
]
},
"continuations": {
"f9232556d1ec9d7bb7d767468336985f350fd3bdeb3360c10f38e620cc8b200c": "https://gist.githubusercontent.com/jhbertra/2537036687ac003a4cb1597b4af77f3b/raw/b426969d33167b27eb87647c8cde1e16de7788a5/f9232556d1ec9d7bb7d767468336985f350fd3bdeb3360c10f38e620cc8b200c.json"
}
}
{
"contract": {
"from_account": {
"address": "addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j"
},
"pay": 5000000,
"then": {
"timeout": 1655663505000,
"timeout_continuation": "close",
"when": [
{
"case": {
"notify_if": true
},
"then": "close"
}
]
},
"to": {
"party": {
"address": "addr_test1vq9prvx8ufwutkwxx9cmmuuajaqmjqwujqlp9d8pvg6gupczgtm9j"
}
},
"token": {
"currency_symbol": "",
"token_name": ""
}
},
"continuations": {}
}
@bwbush
Copy link

bwbush commented Sep 27, 2022

Step 3 - Create contract via runtime

When we have a metadata standard for the creation transaction, it would be nice if it included a pointer to this index of all continuations.

@bwbush
Copy link

bwbush commented Sep 27, 2022

Step 1 - Merkleizing the contract

We need to not assume that a contract will ever exist in an unmerkleized form. Some realistic contracts would be many GB of JSON if they were unmerkleized. I don't believe this proposed design assumes an unmerkleized instantiation, but I just wanted to highlight this issue.

@jhbertra
Copy link
Author

Step 1 - Merkleizing the contract

We need to not assume that a contract will ever exist in an unmerkleized form. Some realistic contracts would be many GB of JSON if they were unmerkleized. I don't believe this proposed design assumes an unmerkleized instantiation, but I just wanted to highlight this issue.

That is a good point - and yes in this proposal, since Merkleization happens outside the Runtime, in some sense, it doesn't matter how this happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment