Skip to main content

Cardano Example Dapp

Child Keys Multisign​

Derives three stake keys at arbitrary account and address indexes of the current wallet, and requires all three of them as signers of a single transaction. Shows how child keys outside the usual account 0 / address 0 path can co-sign, without setting up a workspace first

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"type": "script",
"title": "Child Keys Multisign",
"description": "Derives three stake keys at arbitrary account and address indexes of the current wallet, and requires all three of them as signers of a single transaction. Shows how child keys outside the usual account 0 / address 0 path can co-sign, without setting up a workspace first",
"exportAs": "MultiSign",
"require": {
"not": {
"walletTypeIn": [
"extension"
]
}
},
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"return": {
"mode": "last"
},
"run": {
"dependencies": {
"type": "script",
"run": {
"keys": {
"type": "deriveKeys",
"keys": {
"A": {
"name": "A",
"kind": "stake",
"accountIndex": 34,
"addressIndex": 423
},
"B": {
"name": "B",
"kind": "stake",
"accountIndex": 632,
"addressIndex": 7434
},
"C": {
"name": "C",
"kind": "stake",
"accountIndex": 26,
"addressIndex": 754
}
}
}
}
},
"txs": {
"type": "script",
"run": {
"buildMultiSign": {
"type": "buildTx",
"title": "Multisign with 3 child stake keys",
"tx": {
"requiredSigners": {
"A": "{get('cache.dependencies.keys.A.pubKeyHashHex')}",
"B": "{get('cache.dependencies.keys.B.pubKeyHashHex')}",
"C": "{get('cache.dependencies.keys.C.pubKeyHashHex')}"
}
}
},
"signMultiSign": {
"type": "signTxs",
"detailedPermissions": false,
"txs": [
"{get('cache.txs.buildMultiSign.txHex')}"
]
},
"submitMultiSign": {
"type": "submitTxs",
"txs": "{get('cache.txs.signMultiSign')}"
}
}
},
"finally": {
"type": "macro",
"run": {
"requiredSigners": {
"A": "{get('cache.dependencies.keys.A.pubKeyHashHex')}",
"B": "{get('cache.dependencies.keys.B.pubKeyHashHex')}",
"C": "{get('cache.dependencies.keys.C.pubKeyHashHex')}"
},
"txHash": "{get('cache.txs.buildMultiSign.txHash')}"
}
}
}
}

Run standalone QR dapp connection:​

You can use Playground IDE in GameChanger Wallet in QR URL Transport mode to capture results

This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code

Resources​

License​

MIT