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:
- Visit HTML+JS Dapp
- Visit HTML+React Dapp
- Visit Native HTML dapp
- Run Run in Wallet…Open in IDE…
Source code:
- dapp connection code: GCScript DSL
- frontend (using @gamechanger-finance/gc): HTML+JS dapp
- frontend (using @gamechanger-finance/gc): HTML+React dapp
- frontend (without official library): Native HTML dapp
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
Resources
- How to connect?
- Docs and examples on Github
- GCScript documentation
- Playground IDE in GameChanger Wallet
- Tutorials on Youtube
- Support on Discord
- News on Twitter
- Website
License
MIT
