Initializing the Cold Credential Scripts
Before anything else can be done, the cold credential scripts need to be initialized.
Step 1: Choosing a seed input and obtain the X.509 certificate files
Note
Choosing a seed input does not apply if you are following along with the local testnet setup.
This system ships with a minting script which will mint the tokens and verify they are sent to the correct address with the correct datum. The minting script requires a known transaction input to be spent to create a unique token name. To mint the token, you just need to pick any transaction output in your wallet as the seed input.
You will also need to have access to PEM files containing the certificates in your organization’s certificate hierarchy. At the very least, you will need:
The self-signed certificate of the root certificate authority
The signed certificates of the membership and delegation roles
You will need to ask the Head of security in your organization for these files.
If you have been following along with this guide, you have access to a fake certificate tree in the folder example-certificates.
For the purposes of this guide, child-1 through child-3 will belong to the membership role, child-4 through child-6 will belong to the delegation role, and child-7 through child-9 will belong to the voting role.
Step 2(a): Creating the assets
Note
This step does not apply if you are following along with the local testnet setup. This step only applies if you are minting the cold NFT using the minting script provided by the system. For the local testnet setup, skip to step 2(c).
Once the seed input is chosen, we can use orchestrator-cli to initialize the script:
$ orchestrator-cli init-cold \
--seed-input "$(get-orchestrator-ada-only | jq -r '.key')" \
--testnet \
--ca-cert example-certificates/ca-cert.pem \
--membership-cert example-certificates/child-1.cert \
--membership-cert example-certificates/child-2.cert \
--membership-cert example-certificates/child-3.cert \
--delegation-cert example-certificates/child-4.cert \
--delegation-cert example-certificates/child-5.cert \
--delegation-cert example-certificates/child-6.cert \
-o init-cold
The -o option (or --out-dir in long form) specifies a directory to write the output assets to.
This directory will be created if it doesn’t already exist.
Every other command has an -o option and it will not be explained elsewhere.
Let’s see what assets were created.
$ ls init-cold -1
credential.plutus
credential.plutus.hash
minting.plutus
minting.plutus.hash
mint.redeemer.json
nft.addr
nft.datum.json
nft.plutus
nft.plutus.hash
nft-token-name
The output contains several files. The first two files are related to the cold credential script.
credential.plutus contains the compiled script bytes wrapped in a text envelope:
$ cat init-cold/credential.plutus
{
"type": "PlutusScriptV3",
"description": "",
"cborHex": "590bab590ba801010033232323232323232323222593293232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302623232325333573466e1d2000002180098101aba100198029aba13574400213030491035054310035573c0046aae74004dd5000998130009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c08cd5d0800ccc0848c8c8c94ccd5cd19b87480000086002604e6ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260709201035054310035573c0046aae74004dd50009aba135744002130344901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e90000010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae8400426068921035054310035573c0046aae74004dd51aba10019980f3ae357426ae880046ae88004d5d100089817a481035054310035573c0046aae74004dd50009bad3574201e60026ae84038c004c005d69981200b1aba100c33301501975a6ae8402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013302e75a6ae84006605a6ae84d5d100084c0c12401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0b9d69aba100198169aba13574400213030491035054310035573c0046aae74004dd51aba1357440021302d491035054310035573c0046aae74004dd51aba100a3302475c6ae84024ccc0548c8c8c94ccd5cd19b874800000860066eb8d5d0800854ccd5cd19b87480080086012603c6ae840042a666ae68cdc3a40080043007301d3574200215333573466e1d200600218009bad35742003301a357426ae880042a666ae68cdc3a4010004300b301c3574200215333573466e1d200a00218029bad357420033018357426ae880042605c9201035054310035573c0046aae74004dd50008131aba1008330010263574200e6eb8d5d080319980a80c1980a81491919192999ab9a3370e90000010c00854ccd5cd19b874800800860082a666ae68cdc3a400800430001302e4901035054310035573c0046aae74004dd50009aba1005330240143574200860046ae8400cc008d5d09aba2003301475c602aeb4d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba20011301a491035054310035573c0046aae74004dd51aba10099aba10089919192999ab9a3370e90000010c00cdd71aba10010a999ab9a3370e90010010c024c028d5d0800ccc01c058d5d09aba20010a999ab9a3370e90020010c01cc024d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc020d5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc010d5d09aba20010980d2481035054310035573c0046aae74004dd51aba13574401023232325333573466e1d20000021328009bad35742005300a357420033232325333573466e1d20000021328049980600f1aba10029aba1001998063ae357426ae880046ae8800454ccd5cd19b874800800860026601603a6ae84006646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109810a481035054310035573c0046aae74004dd51aba13574400215333573466e1d20040021805999804806bad357420033300b75c6ae84d5d1000854ccd5cd19b8748018008600e6601603a6ae840042a666ae68cdc3a40100042646500d3300d01f357420073301a00f3574200533300b00f75a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109811a481035054310035573c0046aae74004dd51aba135744003223301a0020010d5d10009aba200115333573466e1d200a00218029980580e9aba10019919192999ab9a3370e90000010998073ae35742002260429201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c00218010980f2481035054310035573c0046aae74004dd51aba1357440023574400226034921035054310035573c0046aae74004dd50009119118011bab00130182233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a0004646464a666ae68cdc3a4000004300d3007357420033300575a6ae84d5d1000854ccd5cd19b87480080086026600e6ae840066600aeb4d5d09aba20010a99199ab9a3370e90020018c00cc020d5d08014c004d5d09aba20020a999ab9a3370e9003001899402cc024d5d0801cc008d5d0800cdd69aba135744002357440042a666ae68cdc3a40100063009300835742005375a6ae84d5d1001054ccd5cd19b874802800c602a60106ae840082a666ae68cdc3a40180063011300835742005375a6ae84d5d1001054ccd5cd19b874803800c600a6eb8d5d08014dd71aba13574400415333573466e1d201000318039bae35742005375a6ae84d5d1001054ccd5cd19b874804800c600260106ae8400a60106ae84d5d1001054ccd5cd19b874805000c601e60106ae84008260329201035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba1357440041301d491035054310023232325333573466e1d2000002180098079aba10010a999ab9a3370e90010010c00854ccd5cd19b8748010008600826040921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980c249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004c014d5d0800854ccd5cd19b87480080086006600a6ae840042a666ae68cdc3a40080043005375c6ae840042602c921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae8800426028921035054310035573c0046aae74004dd50009aba20011300f491035054310035573c0046aae74004dd5001488a400644600d200b22222222222222220104a005228014a005228014a0041806112c800c4c0220052219002914800c88894ccd5cd19b874800a403244646603244b20031480024432005225333573466e3c0080244c01c0044c01800c006301822590018a40012219002912999ab9a3371e00400e20022600c00604c0420002601400e229344c02d2401035054350018049112999ab9a3370e900000089805a481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026010444a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009804111999aab9f00128001400cc010d5d08014c00cd5d100120004b2003180046004200123232325333573466e1d200000218010a999ab9a3370e90010010c0004c01d241035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c00180011918008009180111980100100099aa99a8910010891400400a00211212900280092211ca3cb41f2eb655ad780521d2b88f1f1197adb8f2466ef1e2fec6e9a110048811e711ca5ac6464dbe05717056ff5257ee9cdb079e28e8aa2025240151923000001"
}
credential.plutus.hash contains a hash of the script bytes as hexadecimal text:
$ cat init-cold/credential.plutus.hash
9d032b030f55cb4d50fab510c3a316ef19bba087124d1377d2c63459
This hash will be our cold committee credential.
The next three files relate to the minting script.
minting.plutus contains the compiled script bytes wrapped in a text envelope:
$ cat init-cold/minting.plutus
{
"type": "PlutusScriptV2",
"description": "",
"cborHex": "590bb2590baf010000323322323322323322323232323232323222532335323232353232325333573466e1d2000002132323232332212330010030023232325333573466e1d2000002132323232323232323232332323233323333323332332332222222222221233333333333300100d00c00b00a00900800700600500400300230013574202460026ae84044c00c8c8c8c94ccd5cd19b87480000084cc8848cc00400c008c080d5d080098029aba135744002260449201035054310035573c0046aae74004dd5000998018009aba100f23232325333573466e1d20000021323232333322221233330010050040030023232325333573466e1d20000021332212330010030023020357420026600803e6ae84d5d100089813a481035054310035573c0046aae74004dd51aba1004300835742006646464a666ae68cdc3a4000004224440062a666ae68cdc3a4004004264244460020086eb8d5d08008a999ab9a3370e9002001099091118010021aba100113027491035054310035573c0046aae74004dd51aba10023300175c6ae84d5d1001111919192999ab9a3370e90010010a8198a999ab9a3370e90000010981a18029aba100113028491035054310035573c0046aae74004dd50009aba20013574400226042921035054310035573c0046aae74004dd500098009aba100d30013574201860046004eb4cc00404cd5d080519980200a3ad35742012646464a666ae68cdc3a40000042646466442466002006004646464a666ae68cdc3a40000042664424660020060046600aeb4d5d080098021aba13574400226048921035054310035573c0046aae74004dd51aba10033232325333573466e1d20000021332212330010030023300575a6ae84004c010d5d09aba2001130244901035054310035573c0046aae74004dd51aba1357440064646464a666ae68cdc3a4000004206a2a666ae68cdc3a4004004206c26048921035054310035573c0046aae74004dd5000911919192999ab9a3370e9000001089110010a999ab9a3370e90010010990911180180218029aba100115333573466e1d20040021122200113024491035054310035573c0046aae74004dd50008980fa49035054310035573c0046aae74004dd51aba10083300175c6ae8401c8c88c008dd60009817911999aab9f001202e233502d30043574200460066ae880080a0ccc00c044008d5d0802998008011aba1004300275c40024464460046eac004c0b488cccd55cf800901611919a8161981318031aab9d001300535573c00260086ae8800cd5d0801013180b9aba1357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d100089807249035054310035573c0046aae74004dd51aba10053001357426ae880148c8c8c94ccd5cd19b87480000084c848888c00c014dd71aba100115333573466e1d2002002132122223001005300c357420022a666ae68cdc3a400800426424444600400a600c6ae8400454ccd5cd19b87480180084c848888c010014c014d5d080089807249035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909111111180280418029aba100115333573466e1d20020021321222222230070083005357420022a666ae68cdc3a400800426644244444446600c012010600a6ae84004dd71aba1357440022a666ae68cdc3a400c0042664424444444660040120106eb8d5d08009bae357426ae8800454ccd5cd19b87480200084cc8848888888cc004024020dd71aba1001375a6ae84d5d10008a999ab9a3370e90050010891111110020a999ab9a3370e900600108911111100189806a49035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099091180100198029aba100115333573466e1d2002002132333222122333001005004003375a6ae84008dd69aba1001375a6ae84d5d10009aba20011300c4901035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909118010019bae357420022a666ae68cdc3a400400426424460020066eb8d5d080089805a481035054310035573c0046aae74004dd500089803a49035054310035573c0046aae74004dd5002911999a80093119191a8029111111111111806804180d91299a8008b1109a8011119192999ab9a3371e008014266a01a4646a01c444444444444601a018604844a66a00220484426a004446a0024444a66a6604200c016260180062601400e446464646a02244464444444444a66a666a05e446a004446a00644a666ae68cdc78020010999ab9a3370e006002074072207202a6466a06200206466054a0209001098050068819981591299a8008b1109a80111299a998120010070980500389803001981391299a8008b1109a80111111a8021119a8011180580412999ab9a3371e01c0022a666ae68cdc3a400464646606844a66a002290001109a801112999ab9a3371e0040422600e0022600c006010606644a66a002290001109a801112999ab9a3371e00400e20022600c006a01a2a666a00a2a66ac26018010206042a66aa66a66666605200244a666ae68cdc3a40000042a66a6666aae7c004940b88c0bccc0acd5d08011aba200202c2135001225335302c00221533533335573e0044a064460666605e6ae8400cd5d1001818109a8009119299a980080190a99a9999aab9f0032503723232303a0023574400a6ae840100d4854cd4c00c00484c0e448ccc004024010008540dc540d8540d4c88cccccc0d00048940e0940dc008940dc940dcc0f088cccd55cf8009181c01d9299a98199aba100221533530043574400642607466a0780040022a070264a07060066ae880080d4540c4540c0540b4540b4940b0940b0940b0940b084d40048894cd4c07400854cd4c07400440d840d440d4584c03402440c4854cd584c03402440c440c04c02c020c098894cd4004409c884d40088888d401088cd40088c02c02094ccd5cd19b8f00d001102f1300b008135002225333573466e2000520800413233714666e312008337026e3400d200800333716902300099b8b001488100161300800530222253350011302102222135002225333573466e3c00803c4c01c0044c01800cc084894cd40044c080088884d400888cc09c894cd40044c09809c884d4008894ccd5cd19b8f00200815333573466e1c01ccdc0a400000226018012260540562600c00600e4a666ae68cdc3980580098061980680080b8a99a800880c91080e080c93131919192999ab9a3370e9000001099910911980080200198021aba1001375c6ae84d5d10008a999ab9a3370e9001001099091180100198021aba1001130064901035054310035573c0046aae74004dd500291919192999ab9a3370e900000109991091980080180118029aba1001375a6ae84d5d1000898032481035054310035573c0046aae74004dd500091919192999ab9a3370e900000109bae357420022600a921035054310035573c0046aae74004dd50008a4c2600292103505435002326335738002016602044a66a0022900011099b8048008c010004c03c894cd40045200022133700900118020009807111299a8010806911909800802180991299a80089918009980400218008031a808002110a9a801111a80411199ab9a3371e00800426601a0120162601000a446a004446a00644a666ae68cdc78020010999ab9a3370e0060020240222022466666600600244a666ae68cdc3a40000042a66a6666aae7c004940208c024cc014d5d08011aba2002006213500122533235300100321533533335573e0064a01a4646460200046ae88014d5d080200590a99a980180090980789198008020010a8068a8061199999804800912806928061280612806118068008a8050a8038a803928031280312803128031109198008018011111111999999aba40062323300735573a0026aae78004dd5003918029bab00723004375800e460066eb401c8c008dd70038038900090911801001889100099803110911299a8010a99a8008805110805910a99a8018805910a99a998038020010999a980489000803801800880689000891001091091198008020019299a8008801880109100109100091918008009180111980100100081"
}
minting.plutus.hash contains a hash of the script bytes as hexadecimal text:
$ cat init-cold/minting.plutus.hash
a3cb41f2eb655ad780521d2b88f1f1197adb8f2466ef1e2fec6e9a11
mint.redeemer.json contains the redeemer for the minting script.
$ cat init-cold/mint.redeemer.json
{
"constructor": 0,
"fields": [
{
"constructor": 0,
"fields": [
{
"constructor": 0,
"fields": [
{
"bytes": "479cb493711ca5ac6464dbe05717056ff5257ee9cdb079e28e8aa20252401519"
}
]
},
{
"int": 0
}
]
},
{
"bytes": "db411d464ccb1ead15c5548c090b93426dd4c0f1d7c11bb479c18c7c"
}
]
}
This redeemer instructs the script to mint 1 token (outer "constructor": 0) and send it to a script address with a script hash of db411d464ccb1ead15c5548c090b93426dd4c0f1d7c11bb479c18c7c.
The token name will be derived from the transaction input 479cb493711ca5ac6464dbe05717056ff5257ee9cdb079e28e8aa20252401519#0.
nft-token-name contains the exact token name that will be minted:
$ cat init-cold/nft-token-name
711ca5ac6464dbe05717056ff5257ee9cdb079e28e8aa202524015192300
This name is produced by taking the last 28 bytes of the tx id and appending the ascii byte for “#” (0x23) and the tx IX.
Finally, there are three files that relate to the NFT locking script, where the NFT will be sent.
nft.plutus contains the compiled script bytes.
$ cat init-cold/nft.plutus
{
"type": "PlutusScriptV3",
"description": "",
"cborHex": "591888591885010100333232323232323232323232323232323232323232323232323232323232323232222593293232325333573466e1d2000002132323232323232328009919192999ab9a3370e900000109919191919191919191919191919191919999999999991999199199111111111111111400404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013303123232325333573466e1d2000002180098101aba100198029aba13574400213034491035054310035573c0046aae74004dd5000998188009aba101123232325333573466e1d2000002132328009919192999ab9a3370e90000010c004c08cd5d0800ccc0848c8c8c94ccd5cd19b87480000086002604e6ae840042a666ae68cdc3a4004004265003375a6ae8400a6eb4d5d0800cdd69aba13574400235744002260789201035054310035573c0046aae74004dd50009aba135744002130384901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e90000010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae8400426070921035054310035573c0046aae74004dd51aba10019980f3ae357426ae880046ae88004d5d100089819a481035054310035573c0046aae74004dd50009bad3574201e60026ae84038c008c009d69981780b1aba100c33301501975a6ae8402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013303275a6ae8400660626ae84d5d100084c0d12401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc0c9d69aba100198189aba13574400213034491035054310035573c0046aae74004dd51aba13574400213031491035054310035573c0046aae74004dd51aba100a3302f75c6ae84024ccc0548c8c8c94ccd5cd19b874800000860066eb8d5d0800854ccd5cd19b87480080086012603c6ae840042a666ae68cdc3a40080043007301d3574200215333573466e1d200600218009bad35742003301a357426ae880042a666ae68cdc3a4010004300b301c3574200215333573466e1d200a00218029bad357420033018357426ae88004260649201035054310035573c0046aae74004dd50008151aba10083300202a3574200e6eb8d5d080319980a80c1980a81691919192999ab9a3370e90000010c00854ccd5cd19b874800800860082a666ae68cdc3a40080043000130324901035054310035573c0046aae74004dd50009aba10053302f0143574200860026ae8400cc004d5d09aba2003301675a6026eb8d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba20011301e491035054310035573c0046aae74004dd51aba10099aba10089919192999ab9a3370e90000010c00cdd71aba10010a999ab9a3370e90010010c024c028d5d0800ccc01c068d5d09aba20010a999ab9a3370e90020010c01cc024d5d0800854ccd5cd19b874801800860026eb4d5d0800cc018d5d09aba20010a999ab9a3370e90040010c02cc020d5d0800854ccd5cd19b8748028008600a6eb4d5d0800cc010d5d09aba20010980f2481035054310035573c0046aae74004dd51aba13574401023232325333573466e1d20000021328009bad35742005300a357420033232325333573466e1d2000002132804998060111aba10029aba1001998063ae357426ae880046ae8800454ccd5cd19b87480080086002660160426ae84006646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109812a481035054310035573c0046aae74004dd51aba13574400215333573466e1d20040021805999804806bad357420033300b75c6ae84d5d1000854ccd5cd19b8748018008600e660160426ae840042a666ae68cdc3a40100042646500d3300d023357420073302500f3574200533300b00f75a6ae840072646464a666ae68cdc3a40000043001375a6ae840066eb4d5d09aba200109813a481035054310035573c0046aae74004dd51aba135744003223301b0020010d5d10009aba200115333573466e1d200a0021802998058109aba10019919192999ab9a3370e90000010998073ae357420022604a9201035054310035573c0046aae74004dd51aba13574400215333573466e1d200c0021801098112481035054310035573c0046aae74004dd51aba135744002357440022603c921035054310035573c0046aae74004dd50009119118011bab001302f2233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a0004646464a666ae68cdc3a4000004300d3007357420033300575a6ae84d5d1000854ccd5cd19b87480080086026600e6ae840066600aeb4d5d09aba20010a99199ab9a3370e90020018c00cc020d5d08014c004d5d09aba20020a999ab9a3370e9003001899402cc024d5d0801cc008d5d0800cdd69aba135744002357440042a666ae68cdc3a40100063009300835742005375a6ae84d5d1001054ccd5cd19b874802800c602a60106ae840082a666ae68cdc3a40180063011300835742005375a6ae84d5d1001054ccd5cd19b874803800c600a6eb8d5d08014dd71aba13574400415333573466e1d201000318039bae35742005375a6ae84d5d1001054ccd5cd19b874804800c600260106ae8400a60106ae84d5d1001054ccd5cd19b874805000c601e60106ae840082603a9201035054310023232325333573466e1d200000218009bae357420021532333573466e1d2002003180298009aba10020a999ab9a3370e90020018c00cdd71aba100298009aba13574400413021491035054310023232325333573466e1d2000002180098079aba10010a999ab9a3370e90010010c00854ccd5cd19b8748010008600826048921035054310035573c0046aae74004dd50009aab9e00235573a0026ea8004d55cf0011aab9d001375400244646464a666ae68cdc3a4004004300215333573466e1d2000002180098029aba10010980e249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004c014d5d0800854ccd5cd19b87480080086006600a6ae840042a666ae68cdc3a40080043005375c6ae8400426034921035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10010a999ab9a3370e90010010c00cdd71aba10010980ca49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae8800426030921035054310035573c0046aae74004dd50009aba200113013491035054310035573c0046aae74004dd5001488a4006450029400a450029400a44b200323213001900791111111111111110080c0a889640063002910c80148a40064444b200d22900f914a999ab9a3371e0080042666ae68cdc3801800c00200430028ac9819807c8564cccccc0dc050894c8ccd5cd19b874800000c564cccd55cf801140088c8ca002004357440086ae8400e001215933333303b00122532333573466e1d200000315933335573e0045002232328008010d5d10021aba100380048564c0f80064300180080091300249913001498260029312999ab9a3370e90010018ac9999aab9f00228011191940040086ae88010d5d0801c00242b2607c00321800c00c0048c0091801060045002280114008a00521800c0040048980124c89800a4c1300149894ccd5cd19b874800800c60030040a99199ab9a3370e90020020ac9999aab9f00328011191940040086ae88014d5d0802400242b2607400321800c01c0048980124c89800a4c1300149894c8ccd5cd19b8748018014564cccd55cf802140088c8ca0020043574400c6ae840160012159303b00190c00601200244c0092644c0052609800a4c4a666ae68cdc3a401000a3001805054ccd5cd19b874802801460030020a999ab9a3370e90060028ac9999aab9f00428011191940040086ae88018d5d0802c00242b2607800321800c0340048c0091801060045002280114008a0052139016911111111111111112c800c84ccccc0f811c07006c040964cc1080540062b266061202b222001005c564ccd413011003a00700102c801300046001180123002460048ac998174809c88800801315900c89814007c8860048c00913333303d04601b01a00f259330410140018ac99817c80a4888008015159333504b04300d801c03c0ad800230008c009180123002484ccccc0f811c07006c040964cc10e40564440069001911001a2b201d159333504c04390159110012400644400489999981880580101980a800c6004910c00918012426666607c08e0380360204b266087202b2220034800c88800d15900e8ac999a826021c80ac888005200322200144ccccc0c402c0080d0054006300248860048c00913333303d04601b01a00f259330429014911001a40064440068ac806c564cc0be405244400400a8992c99980081a00a80144ccc0040cc05400a3002111912994980280144c0060012213003801096400630028980198028010c13889640063000910c80148c8c88c008c028024c150896400626006029221593304e00800289805003c4c010004305322590018c00a442a666ae68cdc7802801098048030980200088c0092218012300248c8564cc0c2405644400400b8ac80744c00404644300246004304c22590018c00a443200522225333573466e24cc0e400c0d1200013008005190049148014a00525333573466e3c030004600030020000630024600489807005811801250020c08c89640063000910c801488894ccd5cd19b893301000300b480004c0200146004452689807a490350543500180f9112999ab9a3370e9000000898072481035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e1000800466008004002603c444a666ae68cdc3a4000002200426600600266e18008004896400a300291099192999ab9a3371266e00cdc1800a400866e18005200430143301623302422590018c00a442a666ae68cdc78028010c0004c01000400c0043000180118090009980818078024000444446464646604844b20031801488564cc07802c00a2600a019130040010c018014c08c89640063002910c8054894ccd5cd19b8f002004159500889803c00244260130020980300184b200318014564ccd4088064c01400d400a30008c00813301429001914803c894ccd5cd19b8f00400215333573466e3c00c0046004300018000600600445200322323302022590018a40012219002912999ab9a3371e0040122600e0022600c006002980f912c800c52000910c8014894ccd5cd19b8f00200710011300600305200322200114800c88800840024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a49035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c001800119118011bac00130142233335573e0025000280198021aba100298019aba20024000c04889640063000910c00e400a44004980200086022444b20051800488c84c004010c0588964006300300499803801c00c01200a488564cc05000801a26601200a00f130040010602044b200314800244266e01200230040011807912c800c5200091099b8048008c01000444444b26600c52003222290049119809c805c8800800400146005221900291112c802c56402a45200d22932900594802494ccd5cd19b8f0020011500318014a004948024a00525333573466e3c0080045400c60040ac801c856400a4320052900291980d001000c88a00491148024a0052225333573466e1c01800c54ccd5cd19b8700500213301d00400118010c0088c00915900190c00a300022b266646600246026002660024666ae68cdc3a400000300080100b11919119111980180100098109112c80144c014006442b200713008004910c802488ca401644b26604e00a0051593300d004001899806004003460048ac980800244cc03002002a266006b2602000318004600600f800000c0c0a8889640063002910c80148964c05000626600e00c0071593302b0090028ac99808804000c4cc040030ccc0c48896400a200322133005001801801400c0060038c009133007801802401800600c07c89640063000910c80148964c0200062600c00718010301e22590018c00244320052259300700189803001c6004003401e2b200d180148564c04000642601a0031801243002460048c008488600408c88c008004c03889640063000910992c9803001c6006007001440046008002300c22590018c0024432005225333573466e1d2000001130060031801045200522290049112c99804803001c4c964cc00401800e26600200a00518010d404802630020452005229003912999ab9a3371e0080042660140060023002088cc8c8a401645200d22900494801c94ccd5cd19b8f00200113300d00500318014a00494801ca00525333573466e3c0080044cc03401400c600448a0052280148a00522801488a005228014a0052280148a0052801245200d2280148a40125200725333573466e3c0080044cc02001400c600528012520072801494ccd5cd19b8f002001133008005003180112280148a00522801488a005228014a0052280148a005280124500291400a45200d2280148a0052280148a00522900494801c94ccd5cd19b8f00200113300c00500318014a00494801ca00525333573466e3c0080044cc03001400c6004488a005228014a0052280148a00528012445200f2280148a0052280148a005228014888ca401e5200b25333573466e3c0080045400c6005280125200b2801494ccd5cd19b8f00200115003180102b26601000a00513300c0040018c009228014a0052280148a0052801245200d2280148a0052280148a00522801488a00522900494801c94ccd5cd19b8f00200113300900500318014a00494801ca00525333573466e3c0080044cc02401400c60044a0052280148a005280125200b2280148a0052280148a00522801488a0052280148cc0240080064500291400a500248a401a4500291400a4500291400a45002911400a450029400a4520092900392999ab9a3371e00400226601800a006300294009290039400a4a666ae68cdc78010008998060028018c00891400a500248a401a4500291400a4500291400a45002911400a450029400a450029148024a400e4a666ae68cdc78010008998048028018c00a50024a400e500292999ab9a3371e00400226601200a00630022500240044465200729003919805801000c8a0052801245200928014894ccd5cd19b8f00400213300500300118014a00494801ca0052280148cc00c008004225900290ac801484cc02c00800630028c00915900190c00a30008c00915900190c00a30028c000225900290ac801484cc01c00800630024564006430028c0002900291400a4500291400a4500291400a44500291400a500291400a45002919803001000888ccd5cd19b8700200180040088a400a5200523300500200194009290029400a46600a00400211199ab9a3371e0040030008011199999802000912999ab9a3370e90000010ac9999aab9f0012801140060026ae8400a6ae88008800486400644b2600e005215933335573e00450022800c004d5d0801cd5d1001900090c800c8964c8cccccc03800c8a0045002001280114008c03c88cccd55cf80094006000259300e35742005215930043574400721800c00c00a002460048994008c00cd5d10012001215933335573e0045002232328008010d5d10021aba100380048564c8cccccc0400088a0045002001280114008c04488cccd55cf80094006000259301035742005215930043574400721800c00c00a002460048994008c00cd5d1001200121800c00401e00700123002460048c0088c009180111801060045002280114008a004466666600600244a666ae68cdc3a40000042b26666aae7c004a00450018009aba10029aba20022001219001912c980380148564cccd55cf801140088c8ca002004357440086ae8400e0012159300900190c00600200700123002460048c0088c0083002280114008a004500223333330020012280114008a004500228008008888888ccccccd5d2003119198039aab9d00135573c0026ea801c8c014dd5803918021bac00723003375a00e460046eb801e00066002442444b20051590018c00244300248856400e3002910ac9980380200144ccd4c0244800401c00c006300202400246460020024600446600400400266aa66a244004224500100280084484a400a0024891ca3cb41f2eb655ad780521d2b88f1f1197adb8f2466ef1e2fec6e9a110048811e711ca5ac6464dbe05717056ff5257ee9cdb079e28e8aa2025240151923000033335122200228008008a00600221229003801400491011c9d032b030f55cb4d50fab510c3a316ef19bba087124d1377d2c634590001"
}
nft.plutus.hash contains the script hash as hex.
$ cat init-cold/nft.plutus.hash
db411d464ccb1ead15c5548c090b93426dd4c0f1d7c11bb479c18c7c
nft.addr contains the script address in bech32
$ cat init-cold/nft.addr
addr_test1wrd5z82xfn93atg4c42gczgtjdpxm4xq78tuzxa508qcclq2uxx6m
nft.datum.json contains the initial datum of the NFT script:
$ cat init-cold/nft.datum.json
{
"constructor": 0,
"fields": [
{
"constructor": 0,
"fields": [
{
"bytes": "09159adec41ce5d48dde24a275a5b2c2e79461c8693ef60af9fc3207"
},
{
"bytes": "0ff1fd44947bcd4cdc6f06841d881ac2a0beb3f15ba5f5e3c08991d92e8ba643"
}
]
},
{
"list": [
{
"constructor": 0,
"fields": [
{
"bytes": "ff7a6c9f3ebf80ab457cca7813842aa2150d0dad341a7956a334c76d"
},
{
"bytes": "1a82818b488574c156f1fa8941bad9b4b4976ba21cfaede1ab33a30de39f7edd"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "c2233827cca3a0cc2c49f91a66276c468be994db855d6b413005fa88"
},
{
"bytes": "3b8536a38eea871cc8b2775deb5861ac4348ef61a84b9e9c643480ae5b88ffc3"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "b23a02a308165c702ce00bf760a0eff33b27b12906e1805b7685125f"
},
{
"bytes": "fdf913abfdb8f00997cca5c14ca0b82f3d08781015a061e91444425d6f777ffa"
}
]
}
]
},
{
"list": [
{
"constructor": 0,
"fields": [
{
"bytes": "fc6a114db76d31de585793749dcd6ad2d6c02a52ce9226820656bedd"
},
{
"bytes": "7c9d1c732c313066ded1568dc24b1230cc782d331cb65465bc65ad5df6fbe832"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "168ff0600f6245812192fb84c1d5a72129ae0445a272acc65dc88fb3"
},
{
"bytes": "c60e20be4ce0fa457a8c65ade01005475e71880e921c2ee40a6b51d42fd95e11"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "c530a8b72dd72e320e7f4883fcb98d0058e70efcf4e7e0871ce13eb7"
},
{
"bytes": "ce75748d37a55ef1faec7219708059479197965a5927a7f9901c6bc9707eeaa1"
}
]
}
]
}
]
}
Now we need to build and submit the transaction to mint the cold NFT:
$ cardano-cli conway transaction build \
--change-address $(cat orchestrator.addr) \
--tx-in "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-in-collateral "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-out "$(cat init-cold/nft.addr) + 5000000 + 1 $(cat init-cold/minting.plutus.hash).$(cat init-cold/nft-token-name)" \
--tx-out-inline-datum-file init-cold/nft.datum.json \
--mint "1 $(cat init-cold/minting.plutus.hash).$(cat init-cold/nft-token-name)" \
--mint-script-file init-cold/minting.plutus \
--mint-redeemer-file init-cold/mint.redeemer.json \
--out-file init-cold/body.json
Estimated transaction fee: Coin 413872
$ cardano-cli conway transaction sign \
--signing-key-file orchestrator.skey \
--tx-body-file init-cold/body.json \
--out-file init-cold/tx.json
$ cardano-cli conway transaction submit --tx-file init-cold/tx.json
Transaction successfully submitted.
Step 2(b): Creating the assets (custom NFT lock script)
Note
This step does not apply if you are following along with the local testnet setup. This step only applies if you are minting the cold NFT using the minting script provided by the system. For the local testnet setup, skip to step 2(c).
orchestrator-cli also allows you to send the NFT to a custom lock script if you don’t want to use the one provided by the system.
$ orchestrator-cli init-cold \
--seed-input "$(get-orchestrator-ada-only | jq -r '.key')" \
--testnet \
--nft-lock-script-hash <my-custom-script-hash> \
-o init-cold-custom-script
Let’s see what assets were created this time.
$ ls init-cold-custom-script -1
credential.plutus
credential.plutus.hash
minting.plutus
minting.plutus.hash
mint.redeemer.json
nft-token-name
A subset of the above files are created this time - notably the nft lock script files are not present (which makes sense).
Now we need to build and submit the transaction to mint the cold NFT:
$ cardano-cli conway transaction build \
--change-address $(cat orchestrator.addr) \
--tx-in "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-in-collateral "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-out "<my-custom-script-address> + 5000000 + 1 $(cat init-cold-custom-script/minting.plutus.hash).$(cat init-cold-custom-script/nft-token-name)" \
--tx-out-inline-datum-file <my-custom-datum-file> \
--mint "1 $(cat init-cold-custom-script/minting.plutus.hash).$(cat init-cold-custom-script/nft-token-name)" \
--mint-script-file init-cold-custom-script/minting.plutus \
--mint-redeemer-file init-cold-custom-script/mint.redeemer.json \
--out-file init-cold-custom-script/body.json
Estimated transaction fee: Coin 413872
$ cardano-cli conway transaction sign \
--signing-key-file orchestrator.skey \
--tx-body-file init-cold-custom-script/body.json \
--out-file init-cold-custom-script/tx.json
$ cardano-cli conway transaction submit --tx-file init-cold-custom-script/tx.json
Transaction successfully submitted.
Step 2(c): Creating the assets (custom NFT)
If you have been following along with the guide on a local testnet, the cold credential is already in the committee. To achieve this, it was initialized with stable NFT minting policy that mints using a public key hash and included in the conway genesis file. To initialize the assets, we need to override the default minting policy and provide a custom NFT.
$ orchestrator-cli init-cold \
--policy-id $COLD_POLICY_ID \
--token-name "" \
--testnet \
--ca-cert example-certificates/ca-cert.pem \
--membership-cert example-certificates/child-1.cert \
--membership-cert example-certificates/child-2.cert \
--membership-cert example-certificates/child-3.cert \
--delegation-cert example-certificates/child-4.cert \
--delegation-cert example-certificates/child-5.cert \
--delegation-cert example-certificates/child-6.cert \
-o init-cold
Let’s see what assets were created this time.
$ ls init-cold -1
credential.plutus
credential.plutus.hash
nft.addr
nft.datum.json
nft.plutus
nft.plutus.hash
This time there are only the files that relate to the credential script and the NFT lock script. To ensure compatibility with the rest of the guide, let’s copy some files into this directory.
$ cp coldMint.hash init-cold/minting.plutus.hash
$ echo "" > init-cold/nft-token-name
Now we need to build and submit the transaction to mint the cold NFT:
$ cardano-cli conway transaction build \
--change-address $(cat orchestrator.addr) \
--tx-in "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-in-collateral "$(get-orchestrator-ada-only | jq -r '.key')" \
--tx-out "$(cat init-cold/nft.addr) + 5000000 + 1 $COLD_POLICY_ID" \
--tx-out-inline-datum-file init-cold/nft.datum.json \
--mint "1 $COLD_POLICY_ID" \
--mint-script-file coldMint.native \
--out-file init-cold/body.json
Estimated transaction fee: Coin 205057
$ cardano-cli conway transaction sign \
--signing-key-file orchestrator.skey \
--signing-key-file coldMint.skey \
--tx-body-file init-cold/body.json \
--out-file init-cold/tx.json
$ cardano-cli conway transaction submit --tx-file init-cold/tx.json
Transaction successfully submitted.
Step 3: Add the Credential to The Committee
This is the only step that cannot be achieved without some kind of special power over the Cardano network. There are two ways to add a cold credential to the committee:
Create an update-committee governance action that proposes to add the credential to the committee and have it ratified and enacted at epoch boundaries. Note that this option is unavailable during the bootstrap period.
Hard-code it in the Conway genesis file. The only members who will be added this way will be members of the interim constitutional committee for the Chang hard fork event. If this applies to your organization, instructions will be communicated about submitting this credential.
So either you will need to have authorial control over the conway genesis file on your network, or you will need to control a sufficient coalition of DReps and SPOs to vote yourself in. Instructions on how to do this are out of scope for this guide.
If you have been following along with the guide and running in the provided test environment, you are already in the committee (the cold credential is included in the conway genesis config):
$ cardano-cli conway query committee-state --cold-script-hash $(cat init-cold/credential.plutus.hash)
{
"committee": {
"scriptHash-533e8af4515ba4cf6035ac7087ae8978e09692fea68e9466f1683f28": {
"expiration": 50000,
"hotCredsAuthStatus": {
"tag": "MemberNotAuthorized"
},
"nextEpochChange": {
"tag": "NoChangeExpected"
},
"status": "Active"
}
},
"epoch": 3,
"threshold": 0
}
We can also query the script address to verify the UTxO is there:
$ cardano-cli conway query utxo --address $(cat init-cold/nft.addr) --output-json
{
"1e016be093fdf1b28aefd28ed13b268653c03dd86872063d58434a2c83d68e6c#0": {
"address": "addr_test1wrd2665l5depddaeg9cke7w58de9tc0q0x03recs9cm9deqfkxg0v",
"datum": null,
"inlineDatum": {
"constructor": 0,
"fields": [
{
"constructor": 0,
"fields": [
{
"bytes": "09159adec41ce5d48dde24a275a5b2c2e79461c8693ef60af9fc3207"
},
{
"bytes": "0ff1fd44947bcd4cdc6f06841d881ac2a0beb3f15ba5f5e3c08991d92e8ba643"
}
]
},
{
"list": [
{
"constructor": 0,
"fields": [
{
"bytes": "19c04196cca86fb0fbf09a35e67d55148508acafa321ebc509bc5cd6"
},
{
"bytes": "0ab37eb812d864c903dc48ef99dd91eb71b805efe7286b0080cc1228570c5f96"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "2b3d02d77ee80b219ca1a20cd3f82b95ff23eb28ca4e886ce3cc039d"
},
{
"bytes": "03452838656348992c11f383a3b17f520a2603ab5659d6c77ea650a1675610f4"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "95bebd09ef4d125a595ae0bf5f15724731a7537b5fda32927bc7b366"
},
{
"bytes": "c2367d7b1d649be1847bf2224bb33ce7252bc7cfa73bf740ea589b741ee70e0d"
}
]
}
]
},
{
"list": [
{
"constructor": 0,
"fields": [
{
"bytes": "7c4ce0c3eca1b077d8465cf3b44db18beea87bacf55c05c9b4d0317c"
},
{
"bytes": "4e42c90371daf9c4a030bd7d161e44364c49f7f94ffe3daaf5843032ffd1c207"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "a263b5a55cb7b8728a0a97092fad7054117f7695897990bc1ab499b4"
},
{
"bytes": "521a9f8bbf35f0b228b686657e67a1b168e10eb20fb92a0d3203221a5bd6db88"
}
]
},
{
"constructor": 0,
"fields": [
{
"bytes": "b381e71db0a8fcf7c6f928ad5d1c7925f8143e7bcd534208406f3325"
},
{
"bytes": "b4d674ccc1423bc429f737b786bae5201394daa208651d25a2339ef55e5ebdf8"
}
]
}
]
}
]
},
"inlineDatumhash": "6e39a7e639b2401c929de368c0db6c777f1d93aee6cf0065c835127797e473db",
"referenceScript": null,
"value": {
"c8aa0de384ad34d844dc479085c3ed00deb1306afb850a2cde6281f4": {
"": 1
},
"lovelace": 5000000
}
}
}