[{"data":1,"prerenderedAt":8949},["ShallowReactive",2],{"docs-routename-\u002Fdocs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet":3,"docs-\u002Fdocs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet":4,"docs-surround-\u002Fdocs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet":748,"docs-category-\u002Fdocs\u002Fdev":757,"docs-index-\u002Fdocs\u002Fdev":8761},"\u002Fdocs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet",{"id":5,"title":6,"body":7,"description":740,"extension":741,"image":742,"meta":743,"navTitle":742,"navigation":744,"path":3,"seo":745,"stem":746,"__hash__":747},"docs\u002Fdocs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet.md","Using Beam Shaders with CLI wallet",{"type":8,"value":9,"toc":732},"minimark",[10,14,24,29,79,83,86,101,119,123,126,136,141,147,152,516,530,578,589,593,603,628,635,641,646,652,656,669,675,678,684,688,728],[11,12,6],"h1",{"id":13},"using-beam-shaders-with-cli-wallet",[15,16,17,18,23],"p",{},"This page is somewhat obsolete, and is replaced with ",[19,20,22],"a",{"href":21},"using-beam-shaders","Using Beam Shaders"," tutorial",[25,26,28],"h3",{"id":27},"prerequisites","Prerequisites",[30,31,32,61,68,76],"ol",{},[33,34,35,36,40,41,44,48,49,53,54,53,57,60],"li",{},"Make sure you have ",[19,37,39],{"href":38},"broken-reference","node running"," and connected to local network.",[42,43],"br",{},[45,46,47],"strong",{},"Notice:"," Shaders are applied after the third fork with height 1500. Therefore, for faster testing, we recommend to define lower heights using the ",[50,51,52],"code",{},"--Fork1",", ",[50,55,56],{},"--Fork2",[50,58,59],{},"--Fork3"," attributes.",[33,62,63,64,67],{},"Create at least one Beam node[link] with ",[50,65,66],{},"--peer=\u003Cip:port of the first node>"," for the transaction replication.",[33,69,70,71,75],{},"Make sure you have Beam ",[19,72,74],{"href":73},"beam-wallets\u002Fcommand-line-wallet","CLI wallet connected to your Beam node"," or to one of the Beam bootstrap nodes.",[33,77,78],{},"You must have funds in your wallet to pay the fee.",[25,80,82],{"id":81},"shaders","Shaders",[15,84,85],{},"There are two types of Shaders in Beam:",[87,88,89,95],"ul",{},[33,90,91,94],{},[45,92,93],{},"Contract Shader"," - implements Smart Contract functionality, is stored on the blockchain and are running on Beam nodes.",[33,96,97,100],{},[45,98,99],{},"App Shaders"," - implements Smart Contract API and is running in Beam wallet.",[15,102,103,107,108,107,116],{},[104,105,106],"em",{},"All examples refer to a sample application 'mydapp' which has two"," ",[19,109,113],{"href":110,"rel":111},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Ftree\u002Fmaster\u002Fbvm\u002FShaders\u002Fvault",[112],"nofollow",[104,114,115],{},"Vault",[104,117,118],{},"Shaders: App Shader(app.wasm) and Contract Shader(contract.wasm).",[25,120,122],{"id":121},"shader-api","Shader API",[15,124,125],{},"First of all, you need to know the available actions of a contract. To see all commands supported by the App Shader enter the following command:",[127,128,133],"pre",{"className":129,"code":131,"language":132},[130],"language-text",".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm -n \u003Cnode>\n","text",[50,134,131],{"__ignoreMap":135},"",[15,137,138,140],{},[42,139],{},"\nThe output is a json format line:",[127,142,145],{"className":143,"code":144,"language":132},[130],"Shader output: {\"roles\": {\"manager\": {\"create\": {},\"destroy\": {\"cid\": \"ContractID\"},\"view\": {},\"view_logs\": {\"cid\": \"ContractID\"},\"view_accounts\": {\"cid\": \"ContractID\"},\"view_account\": {\"cid\": \"ContractID\",\"pubKey\": \"PubKey\"}},\"my_account\": {\"view\": {\"cid\": \"ContractID\"},\"get_key\": {\"cid\": \"ContractID\"},\"get_proof\": {\"cid\": \"ContractID\",\"aid\": \"AssetID\"},\"deposit\": {\"cid\": \"ContractID\",\"pkForeign\": \"PubKey\",\"bCoSigner\": \"uint32_t\",\"amount\": \"Amount\",\"aid\": \"AssetID\"},\"withdraw\": {\"cid\": \"ContractID\",\"pkForeign\": \"PubKey\",\"bCoSigner\": \"uint32_t\",\"amount\": \"Amount\",\"aid\": \"AssetID\"}}}}\n",[50,146,144],{"__ignoreMap":135},[15,148,149,151],{},[42,150],{},"\nFor convenience, let's put it this way:",[127,153,157],{"className":154,"code":155,"language":156,"meta":135,"style":135},"language-json shiki shiki-themes github-dark","{\n  \"roles\": {\n    \"manager\": {\n      \"create\": {},\n      \"destroy\": { \"cid\": \"ContractID\" },\n      \"view\": {},\n      \"view_logs\": { \"cid\": \"ContractID\" },\n      \"view_accounts\": { \"cid\": \"ContractID\" },\n      \"view_account\": { \"cid\": \"ContractID\", \"pubKey\": \"PubKey\" }\n    },\n    \"my_account\": {\n      \"view\": { \"cid\": \"ContractID\" },\n      \"get_key\": { \"cid\": \"ContractID\" },\n      \"get_proof\": { \"cid\": \"ContractID\", \"aid\": \"AssetID\" },\n      \"deposit\": {\n        \"cid\": \"ContractID\",\n        \"pkForeign\": \"PubKey\",\n        \"bCoSigner\": \"uint32_t\",\n        \"amount\": \"Amount\",\n        \"aid\": \"AssetID\"\n      },\n      \"withdraw\": {\n        \"cid\": \"ContractID\",\n        \"pkForeign\": \"PubKey\",\n        \"bCoSigner\": \"uint32_t\",\n        \"amount\": \"Amount\",\n        \"aid\": \"AssetID\"\n      }\n    }\n  }\n}\n","json",[50,158,159,168,178,186,195,217,225,241,257,284,290,298,313,329,355,363,376,388,401,414,425,431,439,450,461,472,483,492,498,504,510],{"__ignoreMap":135},[160,161,164],"span",{"class":162,"line":163},"line",1,[160,165,167],{"class":166},"s95oV","{\n",[160,169,171,175],{"class":162,"line":170},2,[160,172,174],{"class":173},"sDLfK","  \"roles\"",[160,176,177],{"class":166},": {\n",[160,179,181,184],{"class":162,"line":180},3,[160,182,183],{"class":173},"    \"manager\"",[160,185,177],{"class":166},[160,187,189,192],{"class":162,"line":188},4,[160,190,191],{"class":173},"      \"create\"",[160,193,194],{"class":166},": {},\n",[160,196,198,201,204,207,210,214],{"class":162,"line":197},5,[160,199,200],{"class":173},"      \"destroy\"",[160,202,203],{"class":166},": { ",[160,205,206],{"class":173},"\"cid\"",[160,208,209],{"class":166},": ",[160,211,213],{"class":212},"sU2Wk","\"ContractID\"",[160,215,216],{"class":166}," },\n",[160,218,220,223],{"class":162,"line":219},6,[160,221,222],{"class":173},"      \"view\"",[160,224,194],{"class":166},[160,226,228,231,233,235,237,239],{"class":162,"line":227},7,[160,229,230],{"class":173},"      \"view_logs\"",[160,232,203],{"class":166},[160,234,206],{"class":173},[160,236,209],{"class":166},[160,238,213],{"class":212},[160,240,216],{"class":166},[160,242,244,247,249,251,253,255],{"class":162,"line":243},8,[160,245,246],{"class":173},"      \"view_accounts\"",[160,248,203],{"class":166},[160,250,206],{"class":173},[160,252,209],{"class":166},[160,254,213],{"class":212},[160,256,216],{"class":166},[160,258,260,263,265,267,269,271,273,276,278,281],{"class":162,"line":259},9,[160,261,262],{"class":173},"      \"view_account\"",[160,264,203],{"class":166},[160,266,206],{"class":173},[160,268,209],{"class":166},[160,270,213],{"class":212},[160,272,53],{"class":166},[160,274,275],{"class":173},"\"pubKey\"",[160,277,209],{"class":166},[160,279,280],{"class":212},"\"PubKey\"",[160,282,283],{"class":166}," }\n",[160,285,287],{"class":162,"line":286},10,[160,288,289],{"class":166},"    },\n",[160,291,293,296],{"class":162,"line":292},11,[160,294,295],{"class":173},"    \"my_account\"",[160,297,177],{"class":166},[160,299,301,303,305,307,309,311],{"class":162,"line":300},12,[160,302,222],{"class":173},[160,304,203],{"class":166},[160,306,206],{"class":173},[160,308,209],{"class":166},[160,310,213],{"class":212},[160,312,216],{"class":166},[160,314,316,319,321,323,325,327],{"class":162,"line":315},13,[160,317,318],{"class":173},"      \"get_key\"",[160,320,203],{"class":166},[160,322,206],{"class":173},[160,324,209],{"class":166},[160,326,213],{"class":212},[160,328,216],{"class":166},[160,330,332,335,337,339,341,343,345,348,350,353],{"class":162,"line":331},14,[160,333,334],{"class":173},"      \"get_proof\"",[160,336,203],{"class":166},[160,338,206],{"class":173},[160,340,209],{"class":166},[160,342,213],{"class":212},[160,344,53],{"class":166},[160,346,347],{"class":173},"\"aid\"",[160,349,209],{"class":166},[160,351,352],{"class":212},"\"AssetID\"",[160,354,216],{"class":166},[160,356,358,361],{"class":162,"line":357},15,[160,359,360],{"class":173},"      \"deposit\"",[160,362,177],{"class":166},[160,364,366,369,371,373],{"class":162,"line":365},16,[160,367,368],{"class":173},"        \"cid\"",[160,370,209],{"class":166},[160,372,213],{"class":212},[160,374,375],{"class":166},",\n",[160,377,379,382,384,386],{"class":162,"line":378},17,[160,380,381],{"class":173},"        \"pkForeign\"",[160,383,209],{"class":166},[160,385,280],{"class":212},[160,387,375],{"class":166},[160,389,391,394,396,399],{"class":162,"line":390},18,[160,392,393],{"class":173},"        \"bCoSigner\"",[160,395,209],{"class":166},[160,397,398],{"class":212},"\"uint32_t\"",[160,400,375],{"class":166},[160,402,404,407,409,412],{"class":162,"line":403},19,[160,405,406],{"class":173},"        \"amount\"",[160,408,209],{"class":166},[160,410,411],{"class":212},"\"Amount\"",[160,413,375],{"class":166},[160,415,417,420,422],{"class":162,"line":416},20,[160,418,419],{"class":173},"        \"aid\"",[160,421,209],{"class":166},[160,423,424],{"class":212},"\"AssetID\"\n",[160,426,428],{"class":162,"line":427},21,[160,429,430],{"class":166},"      },\n",[160,432,434,437],{"class":162,"line":433},22,[160,435,436],{"class":173},"      \"withdraw\"",[160,438,177],{"class":166},[160,440,442,444,446,448],{"class":162,"line":441},23,[160,443,368],{"class":173},[160,445,209],{"class":166},[160,447,213],{"class":212},[160,449,375],{"class":166},[160,451,453,455,457,459],{"class":162,"line":452},24,[160,454,381],{"class":173},[160,456,209],{"class":166},[160,458,280],{"class":212},[160,460,375],{"class":166},[160,462,464,466,468,470],{"class":162,"line":463},25,[160,465,393],{"class":173},[160,467,209],{"class":166},[160,469,398],{"class":212},[160,471,375],{"class":166},[160,473,475,477,479,481],{"class":162,"line":474},26,[160,476,406],{"class":173},[160,478,209],{"class":166},[160,480,411],{"class":212},[160,482,375],{"class":166},[160,484,486,488,490],{"class":162,"line":485},27,[160,487,419],{"class":173},[160,489,209],{"class":166},[160,491,424],{"class":212},[160,493,495],{"class":162,"line":494},28,[160,496,497],{"class":166},"      }\n",[160,499,501],{"class":162,"line":500},29,[160,502,503],{"class":166},"    }\n",[160,505,507],{"class":162,"line":506},30,[160,508,509],{"class":166},"  }\n",[160,511,513],{"class":162,"line":512},31,[160,514,515],{"class":166},"}\n",[15,517,518,519,522,523,526,527,529],{},"As you can see above, there are two roles in this example: ",[50,520,521],{},"manager"," and ",[50,524,525],{},"my_account",". Each role has its own actions with or without required attributes. In this example, role ",[50,528,521],{}," has the following actions:",[87,531,532,537,547,552,559,566],{},[33,533,534],{},[50,535,536],{},"create",[33,538,539,542,543,546],{},[50,540,541],{},"destroy",", requires the ",[50,544,545],{},"cid"," attribute",[33,548,549],{},[50,550,551],{},"view",[33,553,554,542,557,546],{},[50,555,556],{},"view_logs",[50,558,545],{},[33,560,561,542,564,546],{},[50,562,563],{},"view_accounts",[50,565,545],{},[33,567,568,571,572,522,574,577],{},[50,569,570],{},"view_account",", requires ",[50,573,545],{},[50,575,576],{},"pubKey"," attributes",[15,579,580],{},[104,581,582,584,585,588],{},[45,583,545],{},"(i.e. ",[45,586,587],{},"contract id","), is the frequently required attribute. We get it after our contract has been deployed. The same contract which has been deployed with different attributes, will have different values.",[25,590,592],{"id":591},"commands","Commands",[15,594,595,596,599,600,602],{},"All command start with ",[50,597,598],{},".\u002Fbeam-wallet-masternet shader",".",[42,601],{},"\nThere are required flags that need to be passed to work with the contract:",[87,604,605,611,617,623],{},[33,606,607,610],{},[50,608,609],{},"--shader_app_file=\u003Capp.wasm>"," - for application shader",[33,612,613,616],{},[50,614,615],{},"--shader_contract_file=\u003Ccontract.wasm>"," - for contract shader",[33,618,619,622],{},[50,620,621],{},"--shader_args=\"role=\u003Crole>,action=\u003Caction>\""," - shader arguments",[33,624,625],{},[50,626,627],{},"-n \u003Cnode>",[15,629,630,107,632],{},[45,631,47],{},[104,633,634],{},"All arguments are passed separated by commas. For example:",[127,636,639],{"className":637,"code":638,"language":132},[130],"--shader_args=\"role=manager,action=view\"\n",[50,640,638],{"__ignoreMap":135},[15,642,643],{},[104,644,645],{},"If the action has additional attributes, they also are separated by commas:",[127,647,650],{"className":648,"code":649,"language":132},[130],"--shader_args=\"role=manager,action=view_logs,cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\"\n",[50,651,649],{"__ignoreMap":135},[25,653,655],{"id":654},"deploy-contract","Deploy contract",[15,657,658,659,661,662,664,665,668],{},"To work with the contract, it needs to be deployed. In our Vault example contract, the deployment corresponds to the ",[50,660,521],{}," role and ",[50,663,536],{}," action. Based on our knowledge, we got the following command to ",[45,666,667],{},"deploy contract",":",[127,670,673],{"className":671,"code":672,"language":132},[130],".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm --shader_args=\"role=manager,action=create\" --shader_contract_file=mydapp\u002Fcontract.wasm -n \u003Cnode>\n",[50,674,672],{"__ignoreMap":135},[15,676,677],{},"Output example:",[127,679,682],{"className":680,"code":681,"language":132},[130],"Creating new contract invocation tx on behalf of the shader\nContract ID: d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n        Comment: create Vault contract  Total fee: 1100000 GROTH\nI 2022-06-06.11:43:08.288 [ac09d5dc897647bf876b7d17d8219a77][1] Get proof for kernel: 6625e9f7756a98eb\nI 2022-06-06.11:43:08.289 Synchronizing with node: 100% (1\u002F1)\nI 2022-06-06.11:43:08.289 Current state is 8-65a2ecdf447ad942\nI 2022-06-06.11:43:18.354 Sync up to 9-7d15da24d2717100\nI 2022-06-06.11:43:18.354 Synchronizing with node: 0% (0\u002F2)\nI 2022-06-06.11:43:18.355 CoinID: Key=mine-1:1:1, Value=8000000000 Maturity=6 Spent, Height=9\nI 2022-06-06.11:43:18.356 CoinID: Key=chng-1:0:3958598515398969808, Value=7998900000 Maturity=9 Confirmed, Height=9\nI 2022-06-06.11:43:18.356 Synchronizing with node: 50% (1\u002F2)\nI 2022-06-06.11:43:18.356 Synchronizing with node: 100% (2\u002F2)\nI 2022-06-06.11:43:18.356 Current state is 9-7d15da24d2717100\nI 2022-06-06.11:43:18.356 [ac09d5dc897647bf876b7d17d8219a77][1] Get proof for kernel: 6625e9f7756a98eb\nI 2022-06-06.11:43:18.357 [ac09d5dc897647bf876b7d17d8219a77] Transaction completed\n",[50,683,681],{"__ignoreMap":135},[25,685,687],{"id":686},"command-examples","Command examples",[87,689,690,708],{},[33,691,692,693,699,701,702],{},"View deployed contracts:",[127,694,697],{"className":695,"code":696,"language":132},[130],".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm --shader_args=\"role=manager,action=view\" --shader_contract_file=mydapp\u002Fcontract.wasm -n \u003Cnode>\n",[50,698,696],{"__ignoreMap":135},[42,700],{},"The output could be like this:",[127,703,706],{"className":704,"code":705,"language":132},[130],"Shader output: {\"contracts\": [{\"cid\": \"d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\",\"Height\": 9}]}\n",[50,707,705],{"__ignoreMap":135},[33,709,710,711,713,714,720,677,722],{},"Destroy contract (with ",[50,712,545],{}," from the example above)",[127,715,718],{"className":716,"code":717,"language":132},[130],".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm --shader_contract_file=mydapp\u002Fcontract.wasm --shader_args=\"role=manager,action=destroy,cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\" -n localhost:10000\n",[50,719,717],{"__ignoreMap":135},[42,721],{},[127,723,726],{"className":724,"code":725,"language":132},[130],"Creating new contract invocation tx on behalf of the shader\nContract ID: d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n      Comment: destroy Vault contract   Total fee: 1100000 GROTH\nI 2022-06-06.12:34:15.962 Sync up to 311-788f821396683a25\nI 2022-06-06.12:34:15.962 Synchronizing with node: 0% (0\u002F2)\nI 2022-06-06.12:34:15.967 Synchronizing with node: 0% (0\u002F2)\nI 2022-06-06.12:34:15.967 CoinID: Key=mine-1:1:307, Value=8000000000 Maturity=312 Confirmed, Height=307\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:308, Value=8000000000 Maturity=313 Confirmed, Height=308\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:309, Value=8000000000 Maturity=314 Confirmed, Height=309\nI 2022-06-06.12:34:15.968 CoinID: Key=mine-1:1:310, Value=8000000000 Maturity=315 Confirmed, Height=310\nI 2022-06-06.12:34:15.969 CoinID: Key=mine-1:1:311, Value=8000000000 Maturity=316 Confirmed, Height=311\nI 2022-06-06.12:34:15.969 Synchronizing with node: 50% (1\u002F2)\nI 2022-06-06.12:34:15.969 Synchronizing with node: 100% (2\u002F2)\nI 2022-06-06.12:34:15.969 Current state is 311-788f821396683a25\nI 2022-06-06.12:34:15.969 [7b8eb0b0bd2340529996c7598d3ebaff][1] Get proof for kernel: eb45c335bca2e17c\nI 2022-06-06.12:34:15.970 Synchronizing with node: 100% (1\u002F1)\nI 2022-06-06.12:34:15.970 Current state is 311-788f821396683a25\nI 2022-06-06.12:34:26.111 Rolled back to 306-910bc6ca48d05757\nI 2022-06-06.12:34:26.112 Sync up to 312-d156e1bf16939393\nI 2022-06-06.12:34:26.113 Synchronizing with node: 0% (0\u002F2)\nI 2022-06-06.12:34:26.113 CoinID: Key=mine-1:1:307, Value=8000000000 Maturity=312 Confirmed, Height=307\nI 2022-06-06.12:34:26.113 CoinID: Key=mine-1:1:308, Value=8000000000 Maturity=313 Confirmed, Height=308\nI 2022-06-06.12:34:26.114 CoinID: Key=chng-1:0:3958598515398969808, Value=7998900000 Maturity=9 Spent, Height=312\nI 2022-06-06.12:34:26.114 CoinID: Key=chng-1:0:12345322638362229725, Value=7997800000 Maturity=312 Confirmed, Height=312\nI 2022-06-06.12:34:26.115 Synchronizing with node: 50% (1\u002F2)\nI 2022-06-06.12:34:26.115 Synchronizing with node: 100% (2\u002F2)\nI 2022-06-06.12:34:26.115 Current state is 312-d156e1bf16939393\nI 2022-06-06.12:34:26.115 [7b8eb0b0bd2340529996c7598d3ebaff][1] Get proof for kernel: eb45c335bca2e17c\nI 2022-06-06.12:34:26.116 [7b8eb0b0bd2340529996c7598d3ebaff] Transaction completed\n",[50,727,725],{"__ignoreMap":135},[729,730,731],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":135,"searchDepth":170,"depth":170,"links":733},[734,735,736,737,738,739],{"id":27,"depth":180,"text":28},{"id":81,"depth":180,"text":82},{"id":121,"depth":180,"text":122},{"id":591,"depth":180,"text":592},{"id":654,"depth":180,"text":655},{"id":686,"depth":180,"text":687},"This document describes how to use Beam Shaders with CLI wallet running on a local network","md",null,{},true,{"title":6,"description":740},"docs\u002Fdev\u002Fusing-beam-shaders-with-cli-wallet","uoRcMDT8xA-9myIxT-rJ4NsKm7QFaHsUqP4PJ3Lk-fk",[749,753],{"title":22,"path":750,"stem":751,"description":752,"children":-1},"\u002Fdocs\u002Fdev\u002Fusing-beam-shaders","docs\u002Fdev\u002Fusing-beam-shaders","This tutorial describes using Beam Shaders on DAppnet",{"title":754,"path":755,"stem":756,"description":135,"children":-1},"Beam Documentation","\u002Fdocs\u002Fecosystem\u002Freadme","docs\u002Fecosystem\u002FREADME",[758,1059,1987,2244,2776,3442,3483,3511,3582,3660,3691,3718,3733,3746,3761,3794,3839,4490,5097,5310,5549,5567,5585,6390,6558,6673,6866,7053,7330,8227],{"id":759,"title":760,"body":761,"description":135,"extension":741,"image":742,"meta":1054,"navTitle":742,"navigation":744,"path":1055,"seo":1056,"stem":1057,"__hash__":1058},"docs\u002Fdocs\u002Fdev\u002FREADME.md","Getting started",{"type":8,"value":762,"toc":1043},[763,766,771,780,783,786,791,815,820,864,867,892,906,911,936,939,942,948,955,959,962,968,972,975,983,987,996,999,1008,1011,1019,1028,1031,1034],[11,764,760],{"id":765},"getting-started",[767,768,770],"h2",{"id":769},"welcome-to-beam-developer-portal","Welcome to Beam Developer Portal",[15,772,773],{},[774,775,777],"mark",{"style":776},"color:red;",[45,778,779],{},"NOTE: Beam Developer Portal is currently under construction and is subject to changes",[15,781,782],{},"Beam is a confidential, scalable cryptocurrency and DeFi platform designed entirely in C++. Since its inception in 2018, Beam has undergone significant development and growth, becoming a large and intricate project.",[15,784,785],{},"This developer portal will provide comprehensive information about the development of both Beam and Smart Contracts (also known as Shaders) on the Beam blockchain but also includes tutorials to assist developers in creating these features.",[15,787,788],{},[45,789,790],{},"Below are some key resources that you may find essential in your journey:",[87,792,793,800,808],{},[33,794,795],{},[19,796,799],{"href":797,"rel":798},"https:\u002F\u002Fgithub.com\u002FBeamMW",[112],"Beam Source Code",[33,801,802,807],{},[19,803,806],{"href":804,"rel":805},"https:\u002F\u002Ft.me\u002Fbeamdevsupport",[112],"Developer Support Channel on Telegram",": for any questions you might have along the way.",[33,809,810,814],{},[19,811,813],{"href":812},"guides\u002Fbuilding-beam","Building Beam",": covers the process of building all Beam components from the source files.",[15,816,817],{},[45,818,819],{},"Topics covered will include:",[87,821,822,828,834,840,846,852,858],{},[33,823,824],{},[19,825,827],{"href":826},".\u002F#core-technology-overview","Core Technology Overview",[33,829,830],{},[19,831,833],{"href":832},".\u002F#confidential-assets","Confidential Assets",[33,835,836],{},[19,837,839],{"href":838},".\u002F#smart-contracts","Smart Contracts (aka Shaders)",[33,841,842],{},[19,843,845],{"href":844},".\u002F#wallet-api","Wallet API (and integration guides)",[33,847,848],{},[19,849,851],{"href":850},".\u002F#web-wallet","Web Wallet ",[33,853,854],{},[19,855,857],{"href":856},".\u002F#desktop-wallet","Desktop Wallet",[33,859,860],{},[19,861,863],{"href":862},".\u002F#node","Node",[25,865,827],{"id":866},"core-technology-overview",[15,868,869,870,874,875,880,881,886,887,891],{},"In the beginning, Beam was originally designed as an implementation of the ",[19,871,873],{"href":872},"beam-technology\u002Fmimblewimble","Mimblewimble ","(",[19,876,879],{"href":877,"rel":878},"https:\u002F\u002Fdocs.beam.mw\u002FMimblewimble.pdf",[112],"original whitepaper",") protocol. Since then, Beam version 5.0 included support for a ",[19,882,885],{"href":883,"rel":884},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FLelantus-MW",[112],"Lelantus"," shielded pool which became the ",[19,888,890],{"href":889},"beam-technology\u002Flelantusmw","LelantusMW"," protocol that is the core of Beam's Privacy Layer one.",[15,893,894,895,900,901,599],{},"The Beam network uses the ",[19,896,899],{"href":897,"rel":898},"https:\u002F\u002Fblockonomi.com\u002Fdandelion-protocol\u002F",[112],"Dandelion protocol",", merging non-interactive transactions along the stem phase. Additional technical information regarding this implementation can be found ",[19,902,905],{"href":903,"rel":904},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FTransaction-graph-obfuscation",[112],"here",[15,907,908],{},[45,909,910],{},"Beam also features:",[87,912,913,920,928],{},[33,914,915,919],{},[19,916,918],{"href":917},"beam-technology\u002Fatomic-swaps","Atomic Swaps",": Allows the exchange of Beam for Bitcoin, Ethereum, and several other currencies without needing a trusted third party.",[33,921,922,923,599],{},"Laser Beam: A direct payment channel implementation similar to those used in the ",[19,924,927],{"href":925,"rel":926},"https:\u002F\u002Flightning.network\u002F",[112],"Lightning Network",[33,929,930,931,935],{},"Secure Bulletin Board System (",[19,932,934],{"href":933},"beam-technology\u002Fsbbs","SBBS","): An encrypted, decentralized messaging system that broadcasts information and creates transactions between Beam wallets.",[25,937,833],{"id":938},"confidential-assets",[15,940,941],{},"Beam offers the creation of new asset types on the blockchain called Confidential Assets (CA). Each new CA is designated as a first-class citizen in Beam nodes due to the Layer 1 implementation and does not require using Smart Contracts like Ethereum ERC-20 tokens.",[15,943,944,947],{},[45,945,946],{},"This results in Beam tokens offering the same privacy and security as Beam coins"," while seamlessly integrating with Beam Wallets and dApps. Confidential Assets can be emitted manually or deployed via Smart Contracts within Beam Virtual Machine.",[15,949,950,951,954],{},"For more information, refer to this guide's dedicated ",[19,952,833],{"href":953},"confidential-assets\u002F"," section.",[25,956,958],{"id":957},"beam-shaders","Beam Shaders",[15,960,961],{},"Beam version 6.0 included a tweaked BVM to offer Smart Contract support, aka Beam Shaders. Beam Shaders offers a flexible Smart Contract development due to the BVM’s native operating of WebAssembly compatible langues, i.e., C++, Rust, Go, etc.",[15,963,964,965,599],{},"Beam Shaders, BVM, and all related tools are the pillars of ",[19,966,967],{"href":21},"Beam’s Confidential DeFi Platform",[25,969,971],{"id":970},"wallet-api","Wallet API",[15,973,974],{},"Beam’s robust Wallet API facilitates integration with exchanges, payment services, and third-party applications. While other networks offer APIs directly from the node, Beam API is coded directly into the Beam wallet. Using a wallet and secret keys ensures sensitive information remains secure without compromising integration with the Beam network.",[15,976,977,978,599],{},"For more information regarding Wallet API, refer to this ",[19,979,982],{"href":980,"rel":981},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FBeam-wallet-protocol-API",[112],"Beam wiki",[25,984,986],{"id":985},"web-wallet","Web Wallet",[15,988,989,990,995],{},"Beam offers a simplified version of the Beam Desktop Wallet in a web wallet metamask that runs in the background of ",[19,991,994],{"href":992,"rel":993},"https:\u002F\u002Fchrome.google.com\u002Fwebstore\u002Fsearch\u002Fbeam",[112],"Google Chrome",". The Beam Web Wallet allows users to store, send and receive Beam coins but does not currently offer Atomic Swaps or dApp support.",[15,997,998],{},"All wallet balances will be reflected accurately across all devices connected with your seed phrase (Desktop wallet, Mobile wallet, Web Wallet, etc.). However, web wallet metadata is not available for export.",[15,1000,1001,1002,1007],{},"Refer to this ",[19,1003,1006],{"href":1004,"rel":1005},"http:\u002F\u002Flocalhost:5000\u002Fo\u002F-M_G-3uaAbZMXViHLVZl\u002Fs\u002FPPXXGuwTXZfforCZnW03\u002F",[112],"web wallet guide"," for more information on getting started.",[25,1009,857],{"id":1010},"desktop-wallet",[15,1012,1013,1014,1018],{},"The Beam Desktop Wallet offers advanced privacy and security features in a user-friendly interface that allows users to hold, send or receive Beam, BeamX coins, and other confidential assets. The desktop wallet (",[19,1015,1017],{"href":1016},"\u002Fdownloads\u002Fmainnet-mac","currently version 7.3",") is available on Mac, Windows, and Linux platforms and provides access to Beam’s advanced features like dApps, and Atomic swaps.",[15,1020,1021,1022,1027],{},"Refer to our ",[19,1023,1026],{"href":1024,"rel":1025},"http:\u002F\u002Flocalhost:5000\u002Fo\u002F-M_G-3uaAbZMXViHLVZl\u002Fs\u002F-MaSm2QyXLRMULOUF0cE\u002F",[112],"desktop wallet guide"," for more information!",[25,1029,863],{"id":1030},"node",[15,1032,1033],{},"Beam Node is an essential component of the Beam blockchain. Each individual node creates a peer-to-peer network that validates transactions and blocks on the blockchain. Whether mining or validating nodes, each serves a crucial role in maintaining the integrity of the Beam Network.",[15,1035,1036,1037,1042],{},"Refer to ",[19,1038,1041],{"href":1039,"rel":1040},"http:\u002F\u002Flocalhost:5000\u002Fo\u002F-M_G-3uaAbZMXViHLVZl\u002Fs\u002F-MahNa0IaGxTr8GkB5rz\u002F",[112],"this guide"," for more information on creating your own node within the Beam network.",{"title":135,"searchDepth":170,"depth":170,"links":1044},[1045],{"id":769,"depth":170,"text":770,"children":1046},[1047,1048,1049,1050,1051,1052,1053],{"id":866,"depth":180,"text":827},{"id":938,"depth":180,"text":833},{"id":957,"depth":180,"text":958},{"id":970,"depth":180,"text":971},{"id":985,"depth":180,"text":986},{"id":1010,"depth":180,"text":857},{"id":1030,"depth":180,"text":863},{},"\u002Fdocs\u002Fdev\u002Freadme",{"title":760,"description":135},"docs\u002Fdev\u002FREADME","bT_8HF9bbrrihxEs8ZD0nnyPBkjD0Rhgt4ozJO4NliY",{"id":1060,"title":1061,"body":1062,"description":1981,"extension":741,"image":742,"meta":1982,"navTitle":742,"navigation":744,"path":1983,"seo":1984,"stem":1985,"__hash__":1986},"docs\u002Fdocs\u002Fdev\u002Fbeam-dex.md","Beam DEX",{"type":8,"value":1063,"toc":1977},[1064,1067,1071,1078,1081,1084,1086,1093,1096,1113,1975],[11,1065,1061],{"id":1066},"beam-dex",[25,1068,1070],{"id":1069},"details","Details:",[15,1072,1073,1074],{},"Repository: ",[19,1075,1076],{"href":1076,"rel":1077},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Ftree\u002Fmaster\u002Fbvm\u002FShaders\u002Famm",[112],[15,1079,1080],{},"Dappnet CID: 4e0a28b2b2a83b811ad17ba8228b0645dbce2969fd453a68fbc0b60bc8860e02",[15,1082,1083],{},"Status: In development (14.11.2022)",[25,1085,122],{"id":121},[15,1087,1088,1089],{},"To learn how to use Shader API pleasse refer to ",[19,1090,1092],{"href":13,"title":1091},"mention","using-beam-shaders-with-cli-wallet.md",[15,1094,1095],{},"Some notes regarding the API:",[87,1097,1098,1101],{},[33,1099,1100],{},"pool_view and pools_view methods can be called by user role",[33,1102,1103,1104,1106,1107,1109,1110,1112],{},"\"kind\": \"uint32_t\" parameter has three values for different types of pool with different fees:",[42,1105],{},"\n0 : low volatility, fee is 0.05%",[42,1108],{},"\n1 :  mid volatility, fee is 0.3%",[42,1111],{},"\n2 : high volatility, fee is 1% (default value)\\",[127,1114,1116],{"className":154,"code":1115,"language":156,"meta":135,"style":135},"{\n    \"roles\":\n    {\n        \"admin\":\n        {\n            \"view\":\n            {},\n            \"destroy\":\n            {\n                \"cid\": \"ContractID\"\n            },\n            \"deploy\":\n            {\n                \"hUpgradeDelay\": \"Height\",\n                \"nMinApprovers\": \"uint32_t\",\n                \"bSkipVerifyVer\": \"uint32_t\",\n                \"cidDaoVault\": \"ContractID\"\n            },\n            \"schedule_upgrade\":\n            {\n                \"cid\": \"ContractID\",\n                \"hTarget\": \"Height\",\n                \"bSkipVerifyVer\": \"uint32_t\",\n                \"iSender\": \"uint32_t\",\n                \"approve_mask\": \"uint32_t\"\n            },\n            \"replace_admin\":\n            {\n                \"cid\": \"ContractID\",\n                \"iAdmin\": \"uint32_t\",\n                \"pk\": \"PubKey\",\n                \"iSender\": \"uint32_t\",\n                \"approve_mask\": \"uint32_t\"\n            },\n            \"set_min_approvers\":\n            {\n                \"cid\": \"ContractID\",\n                \"newVal\": \"uint32_t\",\n                \"iSender\": \"uint32_t\",\n                \"approve_mask\": \"uint32_t\"\n            },\n            \"explicit_upgrade\":\n            {\n                \"cid\": \"ContractID\"\n            },\n            \"pool_view\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\"\n            },\n            \"pools_view\":\n            {\n                \"cid\": \"ContractID\"\n            }\n        },\n        \"user\":\n        {\n            \"pool_create\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\"\n            },\n            \"pool_destroy\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\"\n            },\n            \"add_liquidity\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\",\n                \"val1\": \"Amount\",\n                \"val2\": \"Amount\",\n                \"bPredictOnly\": \"uint32_t\"\n            },\n            \"withdraw\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\",\n                \"ctl\": \"Amount\",\n                \"bPredictOnly\": \"uint32_t\"\n            },\n            \"trade\":\n            {\n                \"cid\": \"ContractID\",\n                \"aid1\": \"AssetID\",\n                \"aid2\": \"AssetID\",\n                \"kind\": \"uint32_t\",\n                \"val1_buy\": \"Amount\",\n                \"bPredictOnly\": \"uint32_t\"\n            }\n        }\n    }\n}\n",[50,1117,1118,1122,1130,1135,1142,1147,1154,1159,1166,1171,1181,1186,1193,1197,1209,1220,1231,1240,1244,1251,1255,1265,1276,1286,1297,1307,1311,1318,1322,1332,1343,1354,1365,1374,1379,1387,1392,1403,1415,1426,1435,1440,1448,1453,1462,1467,1475,1480,1491,1503,1515,1525,1530,1538,1543,1552,1558,1564,1572,1577,1585,1590,1601,1612,1623,1632,1637,1645,1650,1661,1672,1683,1692,1697,1705,1710,1721,1732,1743,1754,1766,1778,1788,1793,1801,1806,1817,1828,1839,1850,1862,1871,1876,1884,1889,1900,1911,1922,1933,1945,1954,1959,1965,1970],{"__ignoreMap":135},[160,1119,1120],{"class":162,"line":163},[160,1121,167],{"class":166},[160,1123,1124,1127],{"class":162,"line":170},[160,1125,1126],{"class":173},"    \"roles\"",[160,1128,1129],{"class":166},":\n",[160,1131,1132],{"class":162,"line":180},[160,1133,1134],{"class":166},"    {\n",[160,1136,1137,1140],{"class":162,"line":188},[160,1138,1139],{"class":173},"        \"admin\"",[160,1141,1129],{"class":166},[160,1143,1144],{"class":162,"line":197},[160,1145,1146],{"class":166},"        {\n",[160,1148,1149,1152],{"class":162,"line":219},[160,1150,1151],{"class":173},"            \"view\"",[160,1153,1129],{"class":166},[160,1155,1156],{"class":162,"line":227},[160,1157,1158],{"class":166},"            {},\n",[160,1160,1161,1164],{"class":162,"line":243},[160,1162,1163],{"class":173},"            \"destroy\"",[160,1165,1129],{"class":166},[160,1167,1168],{"class":162,"line":259},[160,1169,1170],{"class":166},"            {\n",[160,1172,1173,1176,1178],{"class":162,"line":286},[160,1174,1175],{"class":173},"                \"cid\"",[160,1177,209],{"class":166},[160,1179,1180],{"class":212},"\"ContractID\"\n",[160,1182,1183],{"class":162,"line":292},[160,1184,1185],{"class":166},"            },\n",[160,1187,1188,1191],{"class":162,"line":300},[160,1189,1190],{"class":173},"            \"deploy\"",[160,1192,1129],{"class":166},[160,1194,1195],{"class":162,"line":315},[160,1196,1170],{"class":166},[160,1198,1199,1202,1204,1207],{"class":162,"line":331},[160,1200,1201],{"class":173},"                \"hUpgradeDelay\"",[160,1203,209],{"class":166},[160,1205,1206],{"class":212},"\"Height\"",[160,1208,375],{"class":166},[160,1210,1211,1214,1216,1218],{"class":162,"line":357},[160,1212,1213],{"class":173},"                \"nMinApprovers\"",[160,1215,209],{"class":166},[160,1217,398],{"class":212},[160,1219,375],{"class":166},[160,1221,1222,1225,1227,1229],{"class":162,"line":365},[160,1223,1224],{"class":173},"                \"bSkipVerifyVer\"",[160,1226,209],{"class":166},[160,1228,398],{"class":212},[160,1230,375],{"class":166},[160,1232,1233,1236,1238],{"class":162,"line":378},[160,1234,1235],{"class":173},"                \"cidDaoVault\"",[160,1237,209],{"class":166},[160,1239,1180],{"class":212},[160,1241,1242],{"class":162,"line":390},[160,1243,1185],{"class":166},[160,1245,1246,1249],{"class":162,"line":403},[160,1247,1248],{"class":173},"            \"schedule_upgrade\"",[160,1250,1129],{"class":166},[160,1252,1253],{"class":162,"line":416},[160,1254,1170],{"class":166},[160,1256,1257,1259,1261,1263],{"class":162,"line":427},[160,1258,1175],{"class":173},[160,1260,209],{"class":166},[160,1262,213],{"class":212},[160,1264,375],{"class":166},[160,1266,1267,1270,1272,1274],{"class":162,"line":433},[160,1268,1269],{"class":173},"                \"hTarget\"",[160,1271,209],{"class":166},[160,1273,1206],{"class":212},[160,1275,375],{"class":166},[160,1277,1278,1280,1282,1284],{"class":162,"line":441},[160,1279,1224],{"class":173},[160,1281,209],{"class":166},[160,1283,398],{"class":212},[160,1285,375],{"class":166},[160,1287,1288,1291,1293,1295],{"class":162,"line":452},[160,1289,1290],{"class":173},"                \"iSender\"",[160,1292,209],{"class":166},[160,1294,398],{"class":212},[160,1296,375],{"class":166},[160,1298,1299,1302,1304],{"class":162,"line":463},[160,1300,1301],{"class":173},"                \"approve_mask\"",[160,1303,209],{"class":166},[160,1305,1306],{"class":212},"\"uint32_t\"\n",[160,1308,1309],{"class":162,"line":474},[160,1310,1185],{"class":166},[160,1312,1313,1316],{"class":162,"line":485},[160,1314,1315],{"class":173},"            \"replace_admin\"",[160,1317,1129],{"class":166},[160,1319,1320],{"class":162,"line":494},[160,1321,1170],{"class":166},[160,1323,1324,1326,1328,1330],{"class":162,"line":500},[160,1325,1175],{"class":173},[160,1327,209],{"class":166},[160,1329,213],{"class":212},[160,1331,375],{"class":166},[160,1333,1334,1337,1339,1341],{"class":162,"line":506},[160,1335,1336],{"class":173},"                \"iAdmin\"",[160,1338,209],{"class":166},[160,1340,398],{"class":212},[160,1342,375],{"class":166},[160,1344,1345,1348,1350,1352],{"class":162,"line":512},[160,1346,1347],{"class":173},"                \"pk\"",[160,1349,209],{"class":166},[160,1351,280],{"class":212},[160,1353,375],{"class":166},[160,1355,1357,1359,1361,1363],{"class":162,"line":1356},32,[160,1358,1290],{"class":173},[160,1360,209],{"class":166},[160,1362,398],{"class":212},[160,1364,375],{"class":166},[160,1366,1368,1370,1372],{"class":162,"line":1367},33,[160,1369,1301],{"class":173},[160,1371,209],{"class":166},[160,1373,1306],{"class":212},[160,1375,1377],{"class":162,"line":1376},34,[160,1378,1185],{"class":166},[160,1380,1382,1385],{"class":162,"line":1381},35,[160,1383,1384],{"class":173},"            \"set_min_approvers\"",[160,1386,1129],{"class":166},[160,1388,1390],{"class":162,"line":1389},36,[160,1391,1170],{"class":166},[160,1393,1395,1397,1399,1401],{"class":162,"line":1394},37,[160,1396,1175],{"class":173},[160,1398,209],{"class":166},[160,1400,213],{"class":212},[160,1402,375],{"class":166},[160,1404,1406,1409,1411,1413],{"class":162,"line":1405},38,[160,1407,1408],{"class":173},"                \"newVal\"",[160,1410,209],{"class":166},[160,1412,398],{"class":212},[160,1414,375],{"class":166},[160,1416,1418,1420,1422,1424],{"class":162,"line":1417},39,[160,1419,1290],{"class":173},[160,1421,209],{"class":166},[160,1423,398],{"class":212},[160,1425,375],{"class":166},[160,1427,1429,1431,1433],{"class":162,"line":1428},40,[160,1430,1301],{"class":173},[160,1432,209],{"class":166},[160,1434,1306],{"class":212},[160,1436,1438],{"class":162,"line":1437},41,[160,1439,1185],{"class":166},[160,1441,1443,1446],{"class":162,"line":1442},42,[160,1444,1445],{"class":173},"            \"explicit_upgrade\"",[160,1447,1129],{"class":166},[160,1449,1451],{"class":162,"line":1450},43,[160,1452,1170],{"class":166},[160,1454,1456,1458,1460],{"class":162,"line":1455},44,[160,1457,1175],{"class":173},[160,1459,209],{"class":166},[160,1461,1180],{"class":212},[160,1463,1465],{"class":162,"line":1464},45,[160,1466,1185],{"class":166},[160,1468,1470,1473],{"class":162,"line":1469},46,[160,1471,1472],{"class":173},"            \"pool_view\"",[160,1474,1129],{"class":166},[160,1476,1478],{"class":162,"line":1477},47,[160,1479,1170],{"class":166},[160,1481,1483,1485,1487,1489],{"class":162,"line":1482},48,[160,1484,1175],{"class":173},[160,1486,209],{"class":166},[160,1488,213],{"class":212},[160,1490,375],{"class":166},[160,1492,1494,1497,1499,1501],{"class":162,"line":1493},49,[160,1495,1496],{"class":173},"                \"aid1\"",[160,1498,209],{"class":166},[160,1500,352],{"class":212},[160,1502,375],{"class":166},[160,1504,1506,1509,1511,1513],{"class":162,"line":1505},50,[160,1507,1508],{"class":173},"                \"aid2\"",[160,1510,209],{"class":166},[160,1512,352],{"class":212},[160,1514,375],{"class":166},[160,1516,1518,1521,1523],{"class":162,"line":1517},51,[160,1519,1520],{"class":173},"                \"kind\"",[160,1522,209],{"class":166},[160,1524,1306],{"class":212},[160,1526,1528],{"class":162,"line":1527},52,[160,1529,1185],{"class":166},[160,1531,1533,1536],{"class":162,"line":1532},53,[160,1534,1535],{"class":173},"            \"pools_view\"",[160,1537,1129],{"class":166},[160,1539,1541],{"class":162,"line":1540},54,[160,1542,1170],{"class":166},[160,1544,1546,1548,1550],{"class":162,"line":1545},55,[160,1547,1175],{"class":173},[160,1549,209],{"class":166},[160,1551,1180],{"class":212},[160,1553,1555],{"class":162,"line":1554},56,[160,1556,1557],{"class":166},"            }\n",[160,1559,1561],{"class":162,"line":1560},57,[160,1562,1563],{"class":166},"        },\n",[160,1565,1567,1570],{"class":162,"line":1566},58,[160,1568,1569],{"class":173},"        \"user\"",[160,1571,1129],{"class":166},[160,1573,1575],{"class":162,"line":1574},59,[160,1576,1146],{"class":166},[160,1578,1580,1583],{"class":162,"line":1579},60,[160,1581,1582],{"class":173},"            \"pool_create\"",[160,1584,1129],{"class":166},[160,1586,1588],{"class":162,"line":1587},61,[160,1589,1170],{"class":166},[160,1591,1593,1595,1597,1599],{"class":162,"line":1592},62,[160,1594,1175],{"class":173},[160,1596,209],{"class":166},[160,1598,213],{"class":212},[160,1600,375],{"class":166},[160,1602,1604,1606,1608,1610],{"class":162,"line":1603},63,[160,1605,1496],{"class":173},[160,1607,209],{"class":166},[160,1609,352],{"class":212},[160,1611,375],{"class":166},[160,1613,1615,1617,1619,1621],{"class":162,"line":1614},64,[160,1616,1508],{"class":173},[160,1618,209],{"class":166},[160,1620,352],{"class":212},[160,1622,375],{"class":166},[160,1624,1626,1628,1630],{"class":162,"line":1625},65,[160,1627,1520],{"class":173},[160,1629,209],{"class":166},[160,1631,1306],{"class":212},[160,1633,1635],{"class":162,"line":1634},66,[160,1636,1185],{"class":166},[160,1638,1640,1643],{"class":162,"line":1639},67,[160,1641,1642],{"class":173},"            \"pool_destroy\"",[160,1644,1129],{"class":166},[160,1646,1648],{"class":162,"line":1647},68,[160,1649,1170],{"class":166},[160,1651,1653,1655,1657,1659],{"class":162,"line":1652},69,[160,1654,1175],{"class":173},[160,1656,209],{"class":166},[160,1658,213],{"class":212},[160,1660,375],{"class":166},[160,1662,1664,1666,1668,1670],{"class":162,"line":1663},70,[160,1665,1496],{"class":173},[160,1667,209],{"class":166},[160,1669,352],{"class":212},[160,1671,375],{"class":166},[160,1673,1675,1677,1679,1681],{"class":162,"line":1674},71,[160,1676,1508],{"class":173},[160,1678,209],{"class":166},[160,1680,352],{"class":212},[160,1682,375],{"class":166},[160,1684,1686,1688,1690],{"class":162,"line":1685},72,[160,1687,1520],{"class":173},[160,1689,209],{"class":166},[160,1691,1306],{"class":212},[160,1693,1695],{"class":162,"line":1694},73,[160,1696,1185],{"class":166},[160,1698,1700,1703],{"class":162,"line":1699},74,[160,1701,1702],{"class":173},"            \"add_liquidity\"",[160,1704,1129],{"class":166},[160,1706,1708],{"class":162,"line":1707},75,[160,1709,1170],{"class":166},[160,1711,1713,1715,1717,1719],{"class":162,"line":1712},76,[160,1714,1175],{"class":173},[160,1716,209],{"class":166},[160,1718,213],{"class":212},[160,1720,375],{"class":166},[160,1722,1724,1726,1728,1730],{"class":162,"line":1723},77,[160,1725,1496],{"class":173},[160,1727,209],{"class":166},[160,1729,352],{"class":212},[160,1731,375],{"class":166},[160,1733,1735,1737,1739,1741],{"class":162,"line":1734},78,[160,1736,1508],{"class":173},[160,1738,209],{"class":166},[160,1740,352],{"class":212},[160,1742,375],{"class":166},[160,1744,1746,1748,1750,1752],{"class":162,"line":1745},79,[160,1747,1520],{"class":173},[160,1749,209],{"class":166},[160,1751,398],{"class":212},[160,1753,375],{"class":166},[160,1755,1757,1760,1762,1764],{"class":162,"line":1756},80,[160,1758,1759],{"class":173},"                \"val1\"",[160,1761,209],{"class":166},[160,1763,411],{"class":212},[160,1765,375],{"class":166},[160,1767,1769,1772,1774,1776],{"class":162,"line":1768},81,[160,1770,1771],{"class":173},"                \"val2\"",[160,1773,209],{"class":166},[160,1775,411],{"class":212},[160,1777,375],{"class":166},[160,1779,1781,1784,1786],{"class":162,"line":1780},82,[160,1782,1783],{"class":173},"                \"bPredictOnly\"",[160,1785,209],{"class":166},[160,1787,1306],{"class":212},[160,1789,1791],{"class":162,"line":1790},83,[160,1792,1185],{"class":166},[160,1794,1796,1799],{"class":162,"line":1795},84,[160,1797,1798],{"class":173},"            \"withdraw\"",[160,1800,1129],{"class":166},[160,1802,1804],{"class":162,"line":1803},85,[160,1805,1170],{"class":166},[160,1807,1809,1811,1813,1815],{"class":162,"line":1808},86,[160,1810,1175],{"class":173},[160,1812,209],{"class":166},[160,1814,213],{"class":212},[160,1816,375],{"class":166},[160,1818,1820,1822,1824,1826],{"class":162,"line":1819},87,[160,1821,1496],{"class":173},[160,1823,209],{"class":166},[160,1825,352],{"class":212},[160,1827,375],{"class":166},[160,1829,1831,1833,1835,1837],{"class":162,"line":1830},88,[160,1832,1508],{"class":173},[160,1834,209],{"class":166},[160,1836,352],{"class":212},[160,1838,375],{"class":166},[160,1840,1842,1844,1846,1848],{"class":162,"line":1841},89,[160,1843,1520],{"class":173},[160,1845,209],{"class":166},[160,1847,398],{"class":212},[160,1849,375],{"class":166},[160,1851,1853,1856,1858,1860],{"class":162,"line":1852},90,[160,1854,1855],{"class":173},"                \"ctl\"",[160,1857,209],{"class":166},[160,1859,411],{"class":212},[160,1861,375],{"class":166},[160,1863,1865,1867,1869],{"class":162,"line":1864},91,[160,1866,1783],{"class":173},[160,1868,209],{"class":166},[160,1870,1306],{"class":212},[160,1872,1874],{"class":162,"line":1873},92,[160,1875,1185],{"class":166},[160,1877,1879,1882],{"class":162,"line":1878},93,[160,1880,1881],{"class":173},"            \"trade\"",[160,1883,1129],{"class":166},[160,1885,1887],{"class":162,"line":1886},94,[160,1888,1170],{"class":166},[160,1890,1892,1894,1896,1898],{"class":162,"line":1891},95,[160,1893,1175],{"class":173},[160,1895,209],{"class":166},[160,1897,213],{"class":212},[160,1899,375],{"class":166},[160,1901,1903,1905,1907,1909],{"class":162,"line":1902},96,[160,1904,1496],{"class":173},[160,1906,209],{"class":166},[160,1908,352],{"class":212},[160,1910,375],{"class":166},[160,1912,1914,1916,1918,1920],{"class":162,"line":1913},97,[160,1915,1508],{"class":173},[160,1917,209],{"class":166},[160,1919,352],{"class":212},[160,1921,375],{"class":166},[160,1923,1925,1927,1929,1931],{"class":162,"line":1924},98,[160,1926,1520],{"class":173},[160,1928,209],{"class":166},[160,1930,398],{"class":212},[160,1932,375],{"class":166},[160,1934,1936,1939,1941,1943],{"class":162,"line":1935},99,[160,1937,1938],{"class":173},"                \"val1_buy\"",[160,1940,209],{"class":166},[160,1942,411],{"class":212},[160,1944,375],{"class":166},[160,1946,1948,1950,1952],{"class":162,"line":1947},100,[160,1949,1783],{"class":173},[160,1951,209],{"class":166},[160,1953,1306],{"class":212},[160,1955,1957],{"class":162,"line":1956},101,[160,1958,1557],{"class":166},[160,1960,1962],{"class":162,"line":1961},102,[160,1963,1964],{"class":166},"        }\n",[160,1966,1968],{"class":162,"line":1967},103,[160,1969,503],{"class":166},[160,1971,1973],{"class":162,"line":1972},104,[160,1974,515],{"class":166},[729,1976,731],{},{"title":135,"searchDepth":170,"depth":170,"links":1978},[1979,1980],{"id":1069,"depth":180,"text":1070},{"id":121,"depth":180,"text":122},"Documentation for the Beam DEX contract and application",{},"\u002Fdocs\u002Fdev\u002Fbeam-dex",{"title":1061,"description":1981},"docs\u002Fdev\u002Fbeam-dex","Ic7JN5za9FLfRDhz7izHag0nB6SZYUlYDd3Fi1juxxU",{"id":1988,"title":1989,"body":1990,"description":135,"extension":741,"image":742,"meta":2239,"navTitle":742,"navigation":744,"path":2240,"seo":2241,"stem":2242,"__hash__":2243},"docs\u002Fdocs\u002Fdev\u002Fbeam-platform-architecture.md","Beam Platform Architecture",{"type":8,"value":1991,"toc":2221},[1992,1995,1997,2000,2003,2007,2010,2013,2017,2020,2024,2027,2030,2034,2037,2050,2057,2060,2067,2071,2074,2108,2112,2115,2119,2122,2126,2129,2132,2136,2140,2168,2172,2195,2199,2208,2212],[11,1993,1989],{"id":1994},"beam-platform-architecture",[767,1996,833],{"id":938},[15,1998,1999],{},"Beam Blockchain natively supports creating new types of tokens called Confidential Assets (CA). Confidential Assets inherit all the properties of the Beam Coin (a native token on Beam Blockchain), namely, confidentiality and scalability using MimbleWimble's cut-through process.",[15,2001,2002],{},"Unlike Ethereum ERC-20 contracts, Beam assets are implemented on Layer 1 and are native citizens of Beam's ecosystem. Each Beam transaction can simultaneously include various CA types as inputs and outputs, provided they match the CA type sum to zero, i.e., no type conversion can occur within a transaction.",[767,2004,2006],{"id":2005},"transaction-kernels","Transaction Kernels",[15,2008,2009],{},"Beam transactions are comprised of inputs and outputs, which are represented by Pedersen Commitments with adjacent zero-knowledge range proofs to ensure committed values are positive within a specific range. While inputs and outputs can be removed during the cut-through process, transaction kernels remain in the blockchain and are crucial for protocol validation.",[15,2011,2012],{},"Initially, kernels contained the signed difference between the blinding factors but were extended to support various purposes during Beam's development, including reflecting transaction type and supporting Lelantus shielded pool. Additionally, the kernels were further repurposed to enable the deployment of smart contracts on the Beam blockchain",[767,2014,2016],{"id":2015},"kernels-with-side-effects","Kernels with Side Effects",[15,2018,2019],{},"A transaction kernel can identify any side effects, i.e., direct changes to the node state, including transformations to tx inputs and outputs. When this occurs, Beam coins transform into a hybrid UTXO based \u003C> State Based cryptocurrency. When a side effect modifies the outputs, the value stored records on the blockchain as the kernel \"consumed\" the output. This results in the kernel \"emitting\" new inputs using the value stored in the node state.",[767,2021,2023],{"id":2022},"beam-shaders-and-beam-virtual-machine","Beam Shaders and Beam Virtual Machine",[15,2025,2026],{},"The encapsulation of each node state is done using Beam Shaders while defining the state variables and correlating business logic to modify them. These shaders are coded using WebAssembly (WASM), allowing seamless deployment on Beam Virtual Machines.",[15,2028,2029],{},"Beam uses WASM's binary instruction format for stack-based virtual machines and takes advantage of WASM's industry-standard support for various web for client and server applications.",[767,2031,2033],{"id":2032},"using-beam-shaders-to-implement-smart-contracts","Using Beam Shaders to Implement Smart Contracts",[15,2035,2036],{},"For a more technical description of Beam Smart Contracts, read here",[15,2038,2039,2040,2045,2046,2049],{},"According to ",[19,2041,2044],{"href":2042,"rel":2043},"https:\u002F\u002Fwww.investopedia.com\u002Fterms\u002Fs\u002Fsmart-contracts.asp",[112],"Investopedia",", Smart Contracts are ",[104,2047,2048],{},"\"a self-executing contract with the terms of the agreement between buyer and seller being directly written into lines of code\""," Smart Contracts on the Beam blockchain are executed via Beam Shaders.",[15,2051,2052,2053,2056],{},"Each Beam Shader is a collection of state variables and methods, including a constructor and a destructor. The ",[45,2054,2055],{},"shader constructer"," is only executed once when the Contract Creator defines parameters when registering a new shader. When a new Beam Shader code and construction parameters records on the blockchain, it creates a unique Shader Instance.",[15,2058,2059],{},"It is important to note the same code with different parameters will produce a distinct unique Shader ID, thus creating a separate Shader Instance.",[15,2061,2062,2063,2066],{},"A ",[45,2064,2065],{},"destructor"," runs when the Beam Shader is deactivated and cleans all used resources.  A Beam Shader can only be deactivated if it does not contain any funds, preventing the destruction of value during the Shader deactivation process.",[767,2068,2070],{"id":2069},"properties-of-chain-side-beam-shaders","Properties of Chain Side Beam Shaders",[15,2072,2073],{},"The section below details key properties of smart contract (Beam Chain Side Shaders) implementation on the Beam blockchain.",[87,2075,2076,2079,2085,2093,2096,2099,2102],{},[33,2077,2078],{},"Beam Shaders utilize several limiting mechanisms (charging execution fees, maximum execution fees) to avoid blocking the node with an unbounded cycle and ensure bounded execution time.",[33,2080,2081,2084],{},[45,2082,2083],{},"Shaders cannot be automated"," and only record on the blockchain via sent transactions with required parameters, signatures, and fees.",[33,2086,2087,2088,599],{},"Shaders can claim a portion of fees from provided sources of decentralized application requests. Shaders can then store and issue disbursements, including refunding excess payments to special ",[19,2089,2092],{"href":2090,"rel":2091},"https:\u002F\u002Fblog.giveth.io\u002Fthe-vault-contract-open-sourced-by-giveth-fe2261f7b91b",[112],"Vault contracts",[33,2094,2095],{},"Shaders can communicate with other Shaders to delegate operations in the transaction context, activating the initial Shader on the chain.",[33,2097,2098],{},"The Shader that controls the assets can burn CA emissions, and the shaders defined logic conducts emission burning when manual emission burn cannot function.",[33,2100,2101],{},"When a Shader deploys, it results in one of two outcomes: either the Shader consumes funds (transaction inputs) or unlocks funds (transaction outputs) recorded on the blockchain.",[33,2103,2104,2107],{},[45,2105,2106],{},"Overdraft protection",". BVM only validates equal amounts of locked and unlocked funds to discourage bad actors from creating confidential assets.",[767,2109,2111],{"id":2110},"wallet-side-shaders","Wallet Side Shaders",[15,2113,2114],{},"Thus far, we have explored smart contracts activated by sent transactions (Chain-side Shaders). We now review the wallet-side architecture, i.e., the framework that interacts with Shaders via new transactions and retrieval of Shader metadata to Beam Wallets.",[25,2116,2118],{"id":2117},"wallet-web-application-platform","Wallet Web Application Platform",[15,2120,2121],{},"Since v6.0, Beam Desktop Wallets have a built-in web application platform that allows first-party and third-party app development (Mobile version TBA).",[25,2123,2125],{"id":2124},"the-role-of-wallet-side-shaders","The role of Wallet Side Shaders",[15,2127,2128],{},"Due to Beam's confidential blockchain ecosystem, any blockchain-altering function requires wallets. Beam's DeFi architecture leverages the Wallet-side shader's client logic and API required for each smart contract, simplifying interactions between wallets and Chain-side Shaders",[15,2130,2131],{},"Wallet-side Shaders offer great flexibility in separating client and chain-side logic, enabling complex flows that create operations across multiple wallets through a single UI.",[767,2133,2135],{"id":2134},"resources","Resources",[25,2137,2139],{"id":2138},"concepts","Concepts",[87,2141,2142],{},[33,2143,2144,2145],{},"DLC (Discreet Log Contract)\n",[87,2146,2147,2154,2161],{},[33,2148,2149],{},[19,2150,2153],{"href":2151,"rel":2152},"https:\u002F\u002Fadiabat.github.io\u002Fdlc.pdf",[112],"paper",[33,2155,2156],{},[19,2157,2160],{"href":2158,"rel":2159},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=P6AX8KdXAts",[112],"video",[33,2162,2163],{},[19,2164,2167],{"href":2165,"rel":2166},"https:\u002F\u002Fmedium.com\u002F@gertjaap\u002Fdiscreet-log-contracts-invisible-smart-contracts-on-the-bitcoin-blockchain-cc8afbdbf0db",[112],"article",[25,2169,2171],{"id":2170},"whitepapers","Whitepapers",[87,2173,2174,2181,2188],{},[33,2175,2176],{},[19,2177,2180],{"href":2178,"rel":2179},"https:\u002F\u002Fwww.semanticscholar.org\u002Fpaper\u002FThe-Rainbow-Network-%3A-An-Off-Chain-Decentralized-Robinson\u002F03b035bc6fea62caef3455ad383cd7f8164adf2f?p2df",[112],"Rainbow Protocol Whitepaper",[33,2182,2183],{},[19,2184,2187],{"href":2185,"rel":2186},"https:\u002F\u002Farwen.io\u002Fwhitepaper.pdf",[112],"Arwen Protocol Whitepaper",[33,2189,2190],{},[19,2191,2194],{"href":2192,"rel":2193},"https:\u002F\u002Fcompound.finance\u002Fdocuments\u002FCompound.Whitepaper.pdf",[112],"Compound Whitepaper",[25,2196,2198],{"id":2197},"wrapped-assets","Wrapped assets",[87,2200,2201],{},[33,2202,2203],{},[19,2204,2207],{"href":2205,"rel":2206},"https:\u002F\u002Ftbtc.network\u002Fdevelopers\u002Ftbtc-technical-system-overview\u002F",[112],"tBTC - Bitcoin on Ethereum via Liquid",[25,2209,2211],{"id":2210},"terms","Terms",[87,2213,2214],{},[33,2215,2216],{},[19,2217,2220],{"href":2218,"rel":2219},"https:\u002F\u002Fdefitutorials.substack.com\u002Fp\u002Fcollateralized-debt-positions-cdps",[112],"Collateralized Debt Position",{"title":135,"searchDepth":170,"depth":170,"links":2222},[2223,2224,2225,2226,2227,2228,2229,2233],{"id":938,"depth":170,"text":833},{"id":2005,"depth":170,"text":2006},{"id":2015,"depth":170,"text":2016},{"id":2022,"depth":170,"text":2023},{"id":2032,"depth":170,"text":2033},{"id":2069,"depth":170,"text":2070},{"id":2110,"depth":170,"text":2111,"children":2230},[2231,2232],{"id":2117,"depth":180,"text":2118},{"id":2124,"depth":180,"text":2125},{"id":2134,"depth":170,"text":2135,"children":2234},[2235,2236,2237,2238],{"id":2138,"depth":180,"text":2139},{"id":2170,"depth":180,"text":2171},{"id":2197,"depth":180,"text":2198},{"id":2210,"depth":180,"text":2211},{},"\u002Fdocs\u002Fdev\u002Fbeam-platform-architecture",{"title":1989,"description":135},"docs\u002Fdev\u002Fbeam-platform-architecture","9EOJ65mAB5I_SasmLGpMb8Z1yYhI1oJ9wJoYkZAcig0",{"id":2245,"title":958,"body":2246,"description":135,"extension":741,"image":742,"meta":2771,"navTitle":742,"navigation":744,"path":2772,"seo":2773,"stem":2774,"__hash__":2775},"docs\u002Fdocs\u002Fdev\u002Fbeam-shaders\u002FREADME.md",{"type":8,"value":2247,"toc":2759},[2248,2250,2254,2263,2267,2270,2273,2276,2279,2292,2300,2303,2306,2323,2327,2332,2335,2343,2350,2355,2362,2366,2369,2380,2383,2387,2389,2394,2397,2423,2426,2430,2433,2442,2459,2462,2466,2473,2476,2479,2491,2494,2553,2568,2572,2575,2578,2585,2643,2647,2650,2654,2657,2660,2664,2667,2694,2698,2701,2705,2708,2715,2718,2721,2724,2727,2748,2751],[11,2249,958],{"id":957},[767,2251,2253],{"id":2252},"beam-smart-contracts-overview","Beam Smart Contracts Overview",[15,2255,2256,2257,2262],{},"This section will give an overview of Beam's Smart Contracts. Beam's blockchain offers fully featured Smart Contracts that support ",[19,2258,2261],{"href":2259,"rel":2260},"https:\u002F\u002Fwww.geeksforgeeks.org\u002Fwhat-is-meant-by-turing-complete-in-ethereum\u002F",[112],"Turing complete programming",", enabling the construction of complex Decentralized Applications. Beam's implementation and architecture differ from most other blockchains.",[25,2264,2266],{"id":2265},"contract-shaders-and-application-shaders","Contract Shaders and Application Shaders",[15,2268,2269],{},"In Beam, Smart Contracts have two components, Contract Shaders and Application Shaders.",[15,2271,2272],{},"The term \"shader\" originated from 3D graphics and refers to a custom program, as opposed to a pre-defined fixed function.",[15,2274,2275],{},"Deployed on the blockchain, Contract Shaders are executed by the Beam Virtual Machine when a wallet constructs a transaction that accesses one of the public methods of the contract.",[15,2277,2278],{},"On the other hand, Application Shaders run within the Beam Wallet and act as helpers to expose the contract API to decentralized applications. One Application Shader can interac with several Contract Shaders, providing complex functionality.",[2280,2281,2282,2286],"figure",{},[2283,2284],"img",{"src":2285,"alt":135},"..\u002F.gitbook\u002Fassets\u002FBeam Shaders.png",[2287,2288,2289],"figcaption",{},[15,2290,2291],{},"Conceptual Diagram of Applications and Contract Shaders",[15,2293,2294,2295,599],{},"Beam Shaders are implemented in WebAssembly and can be written in any programming language that can be compiled into WASM. Currently most shader are implemented in C++. Many examples of smart contracts can be found in the Beam ",[19,2296,2299],{"href":2297,"rel":2298},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Ftree\u002Fmaster\u002Fbvm\u002FShaders",[112],"repository",[767,2301,93],{"id":2302},"contract-shader",[15,2304,2305],{},"Contract Shaders may do the following:",[87,2307,2308,2311,2314,2317,2320],{},[33,2309,2310],{},"Save\u002Fload its custom variables (access contract state)",[33,2312,2313],{},"Lock\u002Funlock funds.",[33,2315,2316],{},"Create and manage assets",[33,2318,2319],{},"Invoke public methods of other contracts",[33,2321,2322],{},"Demand signatures for arbitrary public keys (more about this later)",[25,2324,2326],{"id":2325},"contract-life-cycle","Contract life cycle",[2328,2329,2331],"h4",{"id":2330},"creation","Creation",[15,2333,2334],{},"The contract shader is created from 2 parameters:",[87,2336,2337,2340],{},[33,2338,2339],{},"Shader (the bytecode)",[33,2341,2342],{},"Constructor argument",[15,2344,2345,2346,2349],{},"A valid shader must have a ",[104,2347,2348],{},"Constructor"," public method, which is invoked only once, during contract creation. If the constructor is executed successfully, the new contract is created. It is assigned a unique ID which is calculated according to:",[15,2351,2352],{},[50,2353,2354],{},"ID := DeriveID[ Hash(Shader) | Constructor-Argument ]",[15,2356,2357,2358,2361],{},"Note: Same shader may be used in different contracts, if they were created with different constructor arguments. Hence the Shader defines the contract ",[104,2359,2360],{},"type",". Since the Contract ID explicitly depends on the shader and constructor arguments, it can't be tampered with.",[2328,2363,2365],{"id":2364},"method-invocation-arbitrary-number-of-times","Method invocation (arbitrary number of times).",[15,2367,2368],{},"Must provide the following:",[87,2370,2371,2374,2377],{},[33,2372,2373],{},"Contract ID",[33,2375,2376],{},"Method number",[33,2378,2379],{},"Arbitrary arguments",[15,2381,2382],{},"For the invocation the Node locates the requested contract shader, and invokes its appropriate public method with the given argument.",[2328,2384,2386],{"id":2385},"destruction-optional","Destruction (optional)",[15,2388,2368],{},[87,2390,2391],{},[33,2392,2393],{},"Destructor argument",[15,2395,2396],{},"The contract destruction is considered successful iff:",[87,2398,2399,2406,2409],{},[33,2400,2401,2402,2405],{},"The shader ",[104,2403,2404],{},"Destructor"," method is executed successfully",[33,2407,2408],{},"The contract deleted all its custom variables it stored.",[33,2410,2411,2412],{},"The BVM that tracks the external contract state ensures that\n",[87,2413,2414,2417,2420],{},[33,2415,2416],{},"no locked funds left in the contract",[33,2418,2419],{},"no assets left created by this contract",[33,2421,2422],{},"there are no external references (i.e. other contracts that explicitly depend on it)",[15,2424,2425],{},"The ability of destruction is optional.",[25,2427,2429],{"id":2428},"how-and-when-contacts-are-invoked","How and when contacts are invoked",[15,2431,2432],{},"Contracts are passive, means they can only be invoked directly. There's no background processing, auto-activation on specific events, timers, or etc. This is a deliberate design decision.",[15,2434,2435,2436,522,2439,599],{},"To work with contracts we added 2 additional kernel types: ",[45,2437,2438],{},"ContractCreate",[45,2440,2441],{},"ContractInvoke",[87,2443,2444,2449],{},[33,2445,2446,2448],{},[45,2447,2438],{}," contains the shader of the being-created contract, and its constructor arguments",[33,2450,2451,2453,2454],{},[45,2452,2441],{}," has the target Contract ID, its public method number, and the appropriate arguments\n",[87,2455,2456],{},[33,2457,2458],{},"Note: contract destruction is also invoked by ContractInvoke, with the appropriate method number Contracts can only be invoked during interpretation of those kernels. Which, in turn, occurs in the context of a specific block or transaction interpretation.",[15,2460,2461],{},"We preserve the MW principle (means there're no transactions per se), means those kernels can come in a transaction in any combination, be mixed with other special kernels (CA and Lelantus-MW), and be complemented by arbitrary inputs and outputs, built by arbitrary number of users.",[25,2463,2465],{"id":2464},"kernel-validation","Kernel validation",[15,2467,2468,2469,2472],{},"In MW each transaction element (input, output, and kernel) comes with a ",[104,2470,2471],{},"commitment"," and validated appropriately. Originally in MW kernels's commitment may contain blinding factor only, not the value, and it's signed by the Schnorr's signature to prove this (as well as protect other kernel parameters from tampering).",[15,2474,2475],{},"Starting from HF2 we extended this concept, and introduced special kernel types (Lelantus-MW and asset control), which come with a commitment that may contain a value (which contributes to the transaction balance), and signed by appropriate means specific to the kernel type.",[15,2477,2478],{},"So we stick to the same principle with the contract invocation kernels. Their commitment, in addition to arbitrary blinding factor, should reflect the amounts that the contract invocation is supposed to lock\u002Funlock. Their signature, in turn, is supposed to prove the following:",[30,2480,2481,2488],{},[33,2482,2483,2484,2487],{},"After accounting for the funds locked\u002Funlocked by the contract, the ",[104,2485,2486],{},"Commitment"," indeed consists of the blinding factor only",[33,2489,2490],{},"Argument of knowledge of the corresponding secret keys to all the additional public keys that the contract requested during its execution.",[15,2492,2493],{},"Technically the kernel validation goes as following:",[87,2495,2496,2499,2514],{},[33,2497,2498],{},"Kernel shader's method is executed",[33,2500,2501,2502],{},"During the execution the shader may:\n",[87,2503,2504,2507],{},[33,2505,2506],{},"Lock or unlock funds",[33,2508,2509,2510,2513],{},"Specify specific public keys ",[50,2511,2512],{},"Pk[i]"," that must be signed",[33,2515,2516,2517],{},"After the shader execution\n",[87,2518,2519,2539,2546],{},[33,2520,2521,2522,2525,2526],{},"Adjust the specified kernel commitment ",[50,2523,2524],{},"C"," w.r.t. funds locked\u002Funlocked\n",[87,2527,2528],{},[33,2529,2530,2531,2534,2535,2538],{},"For each locked\u002Funlocked asset type add\u002Fsubtract ",[50,2532,2533],{},"H[i] * value",", whereas ",[50,2536,2537],{},"H[i]"," is the generator for the specified CA type.",[33,2540,2541,2542,2545],{},"For the resulting commitment ",[50,2543,2544],{},"C'"," the prover must prove knowledge of the appropriate blinding factor.",[33,2547,2548,2549,522,2551,599],{},"Verify the provided Multi-Signature of the argument of knowledge of the preimages of ",[50,2550,2544],{},[50,2552,2512],{},[15,2554,2555,2556,2559,2560,2563,2564,2567],{},"Hence to build a valid transaction with the contract invocation, the user must ",[45,2557,2558],{},"predict"," how much ",[45,2561,2562],{},"funds"," the contract invocation will contribute to the transaction, as well as which ",[45,2565,2566],{},"public"," keys it will demand for validation.",[2328,2569,2571],{"id":2570},"multi-signature","Multi-signature",[15,2573,2574],{},"We use a variation of the Schnorr's signature to provide argument of knowledge of multiple secret keys. Unlike standard Schnorr's multisignature, which only proves the knowledge of the sum of the secret keys, our variant proves the knowledge of each individual secret key. This is important to mitigate the possible rogue key attack (a.k.a. key cancellation attack).",[15,2576,2577],{},"Consequently the verifier needs all the appropriate public keys in advance.",[15,2579,2580,2581,2584],{},"To accomplish this, we generalize the Schnorr's protocol in the following way for ",[50,2582,2583],{},"M"," keys:",[87,2586,2587,2609,2622,2632],{},[33,2588,2589,2590],{},"Prover -> Verifier\n",[87,2591,2592,2595,2603],{},[33,2593,2594],{},"Context to where the signature applies (kernel parameters, etc.)",[33,2596,2597,2598,2600,2601],{},"Set of ",[50,2599,2583],{}," public keys ",[50,2602,2512],{},[33,2604,2605,2606],{},"Public nonce ",[50,2607,2608],{},"N",[33,2610,2611,2612],{},"Verifier -> Prover\n",[87,2613,2614],{},[33,2615,2597,2616,2618,2619],{},[50,2617,2583],{}," challenges ",[50,2620,2621],{},"e[i]",[33,2623,2589,2624],{},[87,2625,2626],{},[33,2627,2628,2629],{},"Signature preimage ",[50,2630,2631],{},"k",[33,2633,2634,2635],{},"Verifier\n",[87,2636,2637],{},[33,2638,2639,2640],{},"Accept iff: ",[50,2641,2642],{},"N + Sum(Pk[i] * e[i]) == G*k",[25,2644,2646],{"id":2645},"constraints-and-limitations","Constraints and limitations",[15,2648,2649],{},"As we mentioned, shaders are executed by the BVM in a sandbox (isolated environment) to ensure that bugs or malicious behavior won't affect blockchain integrity.",[2328,2651,2653],{"id":2652},"maximum-complexity","Maximum complexity",[15,2655,2656],{},"The length of the execution (number of cycles) is limited, as well as specific support functions of the BVM have their limitations (such as max number of signatures to check, max length of the variable to store, and etc.). This is to keep execution time within sane bounds, and prevent the blockchain bloat.",[15,2658,2659],{},"For most real-world cases those limitations are adequate. If, however, for some reason the shader method is complex, and those limitations can't be met, then we recommend splitting it into several smaller ones, while the intermediate calculation result is saved in some custom variables.",[2328,2661,2663],{"id":2662},"repeatability","Repeatability",[15,2665,2666],{},"In addition it's critically important to ensure that the shader executes in an exactly the same way on all the nodes, and produces exactly the same side effects (if not - attacker can easily cause chain split). Because of this:",[87,2668,2669,2677,2680],{},[33,2670,2671,2672],{},"All the memory that the shader can access is initialized the same way on all the nodes.\n",[87,2673,2674],{},[33,2675,2676],{},"Developers however should not assume that it's necessarily zero-initialized.",[33,2678,2679],{},"By design, there are no BVM functions for the shader that can yield different results. Such as generating randoms, getting current time, and so on.",[33,2681,2682,2685,2686],{},[45,2683,2684],{},"Native floating-point operations are currently not supported",".\n",[87,2687,2688,2691],{},[33,2689,2690],{},"This is because there may be subtle differences in FPU (floating-point unit) behavior on different machines (like the positive\u002Fnegative sign of zero). In the future we may support it, once all the potential problems are solved.",[33,2692,2693],{},"Instead we recommend using multi-precision integer arithmetics.",[2328,2695,2697],{"id":2696},"contract-bounds","Contract bounds",[15,2699,2700],{},"Contract can access its custom variables only. It can't access the variables that belong to other contract, not even for reading. This is a deliberate design decision. By such it's possible for the contract to protect its data from unauthorized usage by other contracts (though that data itself is visible to all the users).",[2328,2702,2704],{"id":2703},"other-considerations","Other considerations",[15,2706,2707],{},"We detect and protect against malicious behavior toward the blockchain integrity (such as invalid memory access, attempt to unlock more funds that had been locked, attempt to manage an asset that doesn't belong to the contract, and so on).",[15,2709,2710,2711,2714],{},"With all the precautions from our side, there is ",[45,2712,2713],{},"literally no guarantee that contract behaves as described by its creator",". Innocently-looking code may have bugs or disguised backdoors. This is the price of the flexibility, an inevitable trade-off of the customizable logic.",[15,2716,2717],{},"Hence users should only trust contracts after thorough source code audit. The compilation process should be transparent, i.e. everyone should be able to take the source code, compile it with publicly-available compiler, and get exactly the same shader bytecode.",[767,2719,2720],{"id":2110},"Wallet-side shaders",[15,2722,2723],{},"As we mentioned, wallet-side shaders are designed for wallets (user-side software), to provide an interface to specific contract types. In contrast to contract-side shaders, the wallet-side shaders don't have strict complexity limitations, and are allowed to read any blockchain information (state and variables of any contract, block headers). There is also no consideration regarding repeatability, so they can access current time, generate random, and so on.",[15,2725,2726],{},"We make sure however that they can't do anything potentially dangerous without user authorization.",[87,2728,2729,2732,2740],{},[33,2730,2731],{},"Shader can get public keys generated by the user account, but not private keys.",[33,2733,2734,2735],{},"It can ask to communicate with other users (via SBBS system), this may be necessary for multi-user signatures in specific contracts\n",[87,2736,2737],{},[33,2738,2739],{},"Communication must be allowed by the user explicitly.",[33,2741,2742,2743],{},"Shader may prepare contract control kernel and ask the wallet to build and broadcast the appropriate transaction\n",[87,2744,2745],{},[33,2746,2747],{},"Of course this requires user authorization. The user sees how much funds it gets\u002Fspends in the transaction.",[15,2749,2750],{},"Technically the wallet-side shaders is executed with user-supplied parameters (in a textual form), and can do either of the following:",[87,2752,2753,2756],{},[33,2754,2755],{},"produce json-style document with the relevant information for the user",[33,2757,2758],{},"prepare contract control kernel, that, after user authorization, is signed by the wallet and used in the appropriate transaction.",{"title":135,"searchDepth":170,"depth":170,"links":2760},[2761,2764,2770],{"id":2252,"depth":170,"text":2253,"children":2762},[2763],{"id":2265,"depth":180,"text":2266},{"id":2302,"depth":170,"text":93,"children":2765},[2766,2767,2768,2769],{"id":2325,"depth":180,"text":2326},{"id":2428,"depth":180,"text":2429},{"id":2464,"depth":180,"text":2465},{"id":2645,"depth":180,"text":2646},{"id":2110,"depth":170,"text":2720},{},"\u002Fdocs\u002Fdev\u002Fbeam-shaders\u002Freadme",{"title":958,"description":135},"docs\u002Fdev\u002Fbeam-shaders\u002FREADME","_GfLyzqo76wBN0Lb79jlNDuosssv6inHtLWux3adlzM",{"id":2777,"title":2778,"body":2779,"description":3436,"extension":741,"image":742,"meta":3437,"navTitle":742,"navigation":744,"path":3438,"seo":3439,"stem":3440,"__hash__":3441},"docs\u002Fdocs\u002Fdev\u002Fbeam-shaders\u002Fusing-beam-shaders-with-cli-wallet-masternet.md","Using Beam Shaders with CLI Wallet (masternet)",{"type":8,"value":2780,"toc":3429},[2781,2784,2805,2809,2820,2822,2833,2840,2842,2876,2890,2892,2898,2904,2907,2910,2915,2918,3202,3212,3248,3263,3269,3284,3287,3295,3299,3303,3306,3325,3331,3336,3342,3347,3349,3357,3362,3368,3370,3375,3384,3386,3427],[11,2782,2778],{"id":2783},"using-beam-shaders-with-cli-wallet-masternet",[15,2785,2786,107,2789,107,2794],{},[104,2787,2788],{},"All examples refer to a sample application \"mydapp\" which has two",[19,2790,2792],{"href":110,"rel":2791},[112],[104,2793,115],{},[104,2795,2796,2797,2800,2801,2804],{},"Shaders: App Shader (",[50,2798,2799],{},"app.wasm",") and Contract Shader (",[50,2802,2803],{},"contract.wasm",").",[25,2806,2808],{"id":2807},"overview","Overview",[15,2810,2811,2812,2815,2816,2819],{},"Beam shaders support requires ",[50,2813,2814],{},"Fork3"," and at least ",[50,2817,2818],{},"v6.0"," CLI.",[15,2821,85],{},[87,2823,2824,2828],{},[33,2825,2826,94],{},[45,2827,93],{},[33,2829,2830,100],{},[45,2831,2832],{},"App Shader",[15,2834,2835,2836,2839],{},"To perform any transactions with shaders, you must specify the ",[50,2837,2838],{},"shader"," command.",[25,2841,28],{"id":27},[30,2843,2844,2862,2867,2874],{},[33,2845,2846,2847,599,2850,2852,48,2854,53,2857,53,2860,60],{},"Make sure you have node running and connected to ",[19,2848,2849],{"href":38},"local network",[42,2851],{},[45,2853,47],{},[50,2855,2856],{},"Fork1",[50,2858,2859],{},"Fork2",[50,2861,2814],{},[33,2863,2864,2865,67],{},"Create at least one Beam node with ",[50,2866,66],{},[33,2868,70,2869,2873],{},[19,2870,2872],{"href":2871},"..\u002Fbeam-wallets\u002Fcommand-line-wallet","CLI wallet"," connected to your Beam node.",[33,2875,78],{},[15,2877,2878,2879,2882,2883,522,2886,2889],{},"Since this tutorial is based on a local network, each command must be specified with the ",[50,2880,2881],{},"--FakePoW=1"," flag. For convenience we recommend adding this flag to your ",[50,2884,2885],{},"beam-node.cfg",[50,2887,2888],{},"beam-wallet.cfg"," files.",[25,2891,122],{"id":121},[15,2893,2894,2895,2897],{},"First of all, you need to know the available actions of a contract. To see all commands supported by the App Shader enter the following command with ",[50,2896,2838],{}," command:",[127,2899,2902],{"className":2900,"code":2901,"language":132},[130],".\u002Fbeam-wallet-masternet shader --pass=1 --shader_app_file=mydapp\u002Fapp.wasm -n localhost:10000\n",[50,2903,2901],{"__ignoreMap":135},[15,2905,2906],{},"You need to specify your wallet password, shader application file and node address.",[15,2908,2909],{},"The output is a json format line:",[127,2911,2913],{"className":2912,"code":144,"language":132},[130],[50,2914,144],{"__ignoreMap":135},[15,2916,2917],{},"For convenience, let's put it this way:",[127,2919,2920],{"className":154,"code":155,"language":156,"meta":135,"style":135},[50,2921,2922,2926,2932,2938,2944,2958,2964,2978,2992,3014,3018,3024,3038,3052,3074,3080,3090,3100,3110,3120,3128,3132,3138,3148,3158,3168,3178,3186,3190,3194,3198],{"__ignoreMap":135},[160,2923,2924],{"class":162,"line":163},[160,2925,167],{"class":166},[160,2927,2928,2930],{"class":162,"line":170},[160,2929,174],{"class":173},[160,2931,177],{"class":166},[160,2933,2934,2936],{"class":162,"line":180},[160,2935,183],{"class":173},[160,2937,177],{"class":166},[160,2939,2940,2942],{"class":162,"line":188},[160,2941,191],{"class":173},[160,2943,194],{"class":166},[160,2945,2946,2948,2950,2952,2954,2956],{"class":162,"line":197},[160,2947,200],{"class":173},[160,2949,203],{"class":166},[160,2951,206],{"class":173},[160,2953,209],{"class":166},[160,2955,213],{"class":212},[160,2957,216],{"class":166},[160,2959,2960,2962],{"class":162,"line":219},[160,2961,222],{"class":173},[160,2963,194],{"class":166},[160,2965,2966,2968,2970,2972,2974,2976],{"class":162,"line":227},[160,2967,230],{"class":173},[160,2969,203],{"class":166},[160,2971,206],{"class":173},[160,2973,209],{"class":166},[160,2975,213],{"class":212},[160,2977,216],{"class":166},[160,2979,2980,2982,2984,2986,2988,2990],{"class":162,"line":243},[160,2981,246],{"class":173},[160,2983,203],{"class":166},[160,2985,206],{"class":173},[160,2987,209],{"class":166},[160,2989,213],{"class":212},[160,2991,216],{"class":166},[160,2993,2994,2996,2998,3000,3002,3004,3006,3008,3010,3012],{"class":162,"line":259},[160,2995,262],{"class":173},[160,2997,203],{"class":166},[160,2999,206],{"class":173},[160,3001,209],{"class":166},[160,3003,213],{"class":212},[160,3005,53],{"class":166},[160,3007,275],{"class":173},[160,3009,209],{"class":166},[160,3011,280],{"class":212},[160,3013,283],{"class":166},[160,3015,3016],{"class":162,"line":286},[160,3017,289],{"class":166},[160,3019,3020,3022],{"class":162,"line":292},[160,3021,295],{"class":173},[160,3023,177],{"class":166},[160,3025,3026,3028,3030,3032,3034,3036],{"class":162,"line":300},[160,3027,222],{"class":173},[160,3029,203],{"class":166},[160,3031,206],{"class":173},[160,3033,209],{"class":166},[160,3035,213],{"class":212},[160,3037,216],{"class":166},[160,3039,3040,3042,3044,3046,3048,3050],{"class":162,"line":315},[160,3041,318],{"class":173},[160,3043,203],{"class":166},[160,3045,206],{"class":173},[160,3047,209],{"class":166},[160,3049,213],{"class":212},[160,3051,216],{"class":166},[160,3053,3054,3056,3058,3060,3062,3064,3066,3068,3070,3072],{"class":162,"line":331},[160,3055,334],{"class":173},[160,3057,203],{"class":166},[160,3059,206],{"class":173},[160,3061,209],{"class":166},[160,3063,213],{"class":212},[160,3065,53],{"class":166},[160,3067,347],{"class":173},[160,3069,209],{"class":166},[160,3071,352],{"class":212},[160,3073,216],{"class":166},[160,3075,3076,3078],{"class":162,"line":357},[160,3077,360],{"class":173},[160,3079,177],{"class":166},[160,3081,3082,3084,3086,3088],{"class":162,"line":365},[160,3083,368],{"class":173},[160,3085,209],{"class":166},[160,3087,213],{"class":212},[160,3089,375],{"class":166},[160,3091,3092,3094,3096,3098],{"class":162,"line":378},[160,3093,381],{"class":173},[160,3095,209],{"class":166},[160,3097,280],{"class":212},[160,3099,375],{"class":166},[160,3101,3102,3104,3106,3108],{"class":162,"line":390},[160,3103,393],{"class":173},[160,3105,209],{"class":166},[160,3107,398],{"class":212},[160,3109,375],{"class":166},[160,3111,3112,3114,3116,3118],{"class":162,"line":403},[160,3113,406],{"class":173},[160,3115,209],{"class":166},[160,3117,411],{"class":212},[160,3119,375],{"class":166},[160,3121,3122,3124,3126],{"class":162,"line":416},[160,3123,419],{"class":173},[160,3125,209],{"class":166},[160,3127,424],{"class":212},[160,3129,3130],{"class":162,"line":427},[160,3131,430],{"class":166},[160,3133,3134,3136],{"class":162,"line":433},[160,3135,436],{"class":173},[160,3137,177],{"class":166},[160,3139,3140,3142,3144,3146],{"class":162,"line":441},[160,3141,368],{"class":173},[160,3143,209],{"class":166},[160,3145,213],{"class":212},[160,3147,375],{"class":166},[160,3149,3150,3152,3154,3156],{"class":162,"line":452},[160,3151,381],{"class":173},[160,3153,209],{"class":166},[160,3155,280],{"class":212},[160,3157,375],{"class":166},[160,3159,3160,3162,3164,3166],{"class":162,"line":463},[160,3161,393],{"class":173},[160,3163,209],{"class":166},[160,3165,398],{"class":212},[160,3167,375],{"class":166},[160,3169,3170,3172,3174,3176],{"class":162,"line":474},[160,3171,406],{"class":173},[160,3173,209],{"class":166},[160,3175,411],{"class":212},[160,3177,375],{"class":166},[160,3179,3180,3182,3184],{"class":162,"line":485},[160,3181,419],{"class":173},[160,3183,209],{"class":166},[160,3185,424],{"class":212},[160,3187,3188],{"class":162,"line":494},[160,3189,497],{"class":166},[160,3191,3192],{"class":162,"line":500},[160,3193,503],{"class":166},[160,3195,3196],{"class":162,"line":506},[160,3197,509],{"class":166},[160,3199,3200],{"class":162,"line":512},[160,3201,515],{"class":166},[15,3203,518,3204,522,3206,3208,3209,3211],{},[50,3205,521],{},[50,3207,525],{},". Each role has its own available actions with or without required attributes. Consider the role ",[50,3210,521],{}," , it has the following actions:",[87,3213,3214,3218,3224,3228,3234,3240],{},[33,3215,3216],{},[50,3217,536],{},[33,3219,3220,542,3222,546],{},[50,3221,541],{},[50,3223,545],{},[33,3225,3226],{},[50,3227,551],{},[33,3229,3230,542,3232,546],{},[50,3231,556],{},[50,3233,545],{},[33,3235,3236,542,3238,546],{},[50,3237,563],{},[50,3239,545],{},[33,3241,3242,571,3244,522,3246,577],{},[50,3243,570],{},[50,3245,545],{},[50,3247,576],{},[15,3249,3250,3251,3253,3254,3257,3258,3260,3261,668],{},"This means that if, for example, we want to deploy a contract (in Vault, deployment is ",[50,3252,536],{}," argument), we must specify ",[50,3255,3256],{},"shader_args","(consider below) with the role ",[50,3259,521],{}," and the action ",[50,3262,536],{},[127,3264,3267],{"className":3265,"code":3266,"language":132},[130],"--shader_args=\"role=manager,action=create\"\n",[50,3268,3266],{"__ignoreMap":135},[15,3270,3271,3272,3275,3276,3279,3280,3283],{},"Specifying a ",[50,3273,3274],{},"role"," and an ",[50,3277,3278],{},"action"," in a ",[50,3281,3282],{},"key=value"," pair representation is a requirement for working with shaders. But each contract has its own API and the arguments can be different.",[25,3285,3286],{"id":545},"Cid",[15,3288,3289,3291,3292,3294],{},[45,3290,545],{}," (i.e. ",[45,3293,587],{},") is the frequently required attribute. We get it after our contract has been deployed. The same contract which has been deployed with different attributes, will have different values.",[25,3296,3298],{"id":3297},"working-with-shaders","Working with shaders",[2328,3300,3302],{"id":3301},"commands-rules","Commands rules",[15,3304,3305],{},"There are required flags that need to be passed in the wallet CLI to work with the contract:",[87,3307,3308,3312,3316,3320],{},[33,3309,3310,610],{},[50,3311,609],{},[33,3313,3314,616],{},[50,3315,615],{},[33,3317,3318,622],{},[50,3319,621],{},[33,3321,3322],{},[50,3323,3324],{},"-n \u003Cnode address>",[15,3326,3327,3328,3330],{},"All arguments in ",[50,3329,3256],{}," are passed separated by commas without spaces. For example:",[127,3332,3334],{"className":3333,"code":638,"language":132},[130],[50,3335,638],{"__ignoreMap":135},[15,3337,3338,3339,3341],{},"If the ",[50,3340,3278],{}," has additional attributes, they also are separated by commas without spaces:",[127,3343,3345],{"className":3344,"code":649,"language":132},[130],[50,3346,649],{"__ignoreMap":135},[2328,3348,655],{"id":654},[15,3350,3351,3352,661,3354,3356],{},"To work with the contract, you first need to deploy it. As we said, in our Vault example contract, the deployment corresponds to the ",[50,3353,521],{},[50,3355,536],{}," action.",[15,3358,3359,3360,668],{},"Based on our knowledge, we got the following command to ",[45,3361,667],{},[127,3363,3366],{"className":3364,"code":3365,"language":132},[130],".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm --shader_args=\"role=manager,action=create\" --shader_contract_file=mydapp\u002Fcontract.wasm -n localhost:10000\n",[50,3367,3365],{"__ignoreMap":135},[15,3369,677],{},[127,3371,3373],{"className":3372,"code":681,"language":132},[130],[50,3374,681],{"__ignoreMap":135},[15,3376,3377,3378,3380,3381,3383],{},"In the ",[50,3379,2373],{}," line we got the ",[50,3382,545],{}," for this deployed contract.",[2328,3385,687],{"id":686},[87,3387,3388,3407],{},[33,3389,3390,3393,3394,3400,701,3402],{},[45,3391,3392],{},"View"," deployed contracts:",[127,3395,3398],{"className":3396,"code":3397,"language":132},[130],".\u002Fbeam-wallet-masternet shader --shader_app_file=mydapp\u002Fapp.wasm --shader_args=\"role=manager,action=view\" --shader_contract_file=mydapp\u002Fcontract.wasm -n localhost:10000\n",[50,3399,3397],{"__ignoreMap":135},[42,3401],{},[127,3403,3405],{"className":3404,"code":705,"language":132},[130],[50,3406,705],{"__ignoreMap":135},[33,3408,3409,3412,3413,713,3415,3420,677,3422],{},[45,3410,3411],{},"Destroy"," contract (with ",[50,3414,545],{},[127,3416,3418],{"className":3417,"code":717,"language":132},[130],[50,3419,717],{"__ignoreMap":135},[42,3421],{},[127,3423,3425],{"className":3424,"code":725,"language":132},[130],[50,3426,725],{"__ignoreMap":135},[729,3428,731],{},{"title":135,"searchDepth":170,"depth":170,"links":3430},[3431,3432,3433,3434,3435],{"id":2807,"depth":180,"text":2808},{"id":27,"depth":180,"text":28},{"id":121,"depth":180,"text":122},{"id":545,"depth":180,"text":3286},{"id":3297,"depth":180,"text":3298},"This document describes how to use Beam Shaders with CLI wallet running on a local network.",{},"\u002Fdocs\u002Fdev\u002Fbeam-shaders\u002Fusing-beam-shaders-with-cli-wallet-masternet",{"title":2778,"description":3436},"docs\u002Fdev\u002Fbeam-shaders\u002Fusing-beam-shaders-with-cli-wallet-masternet","AQm_O0waefZ4xwlIpE6L-UTkg_LdRh-G0wzpNAYtrrE",{"id":3443,"title":918,"body":3444,"description":3451,"extension":741,"image":742,"meta":3478,"navTitle":742,"navigation":744,"path":3479,"seo":3480,"stem":3481,"__hash__":3482},"docs\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fatomic-swaps.md",{"type":8,"value":3445,"toc":3476},[3446,3449,3452,3455,3470],[11,3447,918],{"id":3448},"atomic-swaps",[15,3450,3451],{},"Beam offers Atomic Swap functionality, enabling peer-to-peer trading of Beam for Bitcoin, Ethereum, Litecoin, DOGE (and more) in a completely decentralized way without an exchange or third-party intermediary. Atomic Swaps are the pinnacle of decentralization, censorship resistance, and core values of cryptocurrencies.",[15,3453,3454],{},"Atomic Swaps are supported only on Beam Desktop Wallets, including the Atomic Swap Marketplace for publishing and accepting swap offers.",[15,3456,3457,3458,3463,3464,3469],{},"See ",[19,3459,3462],{"href":3460,"rel":3461},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FAtomic-swap",[112],"Atomic Swaps design"," or ",[19,3465,3468],{"href":3466,"rel":3467},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FAtomic-swap-token",[112],"Atomic Swap token format"," for more detailed information regarding Atomic Swaps.",[15,3471,3472],{},[2283,3473],{"alt":3474,"src":3475},"Screenshot of Atomic Swap marketplace in Beam wallet","..\u002F.gitbook\u002Fassets\u002Fswaps.PNG",{"title":135,"searchDepth":170,"depth":170,"links":3477},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fatomic-swaps",{"title":918,"description":3451},"docs\u002Fdev\u002Fbeam-technology\u002Fatomic-swaps","VZkUa9iMsxTM2onguvLVVN3qbn5g7vStRUGikbBKmdk",{"id":3484,"title":3485,"body":3486,"description":3493,"extension":741,"image":742,"meta":3506,"navTitle":742,"navigation":744,"path":3507,"seo":3508,"stem":3509,"__hash__":3510},"docs\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Flaser-beam.md","Laser Beam",{"type":8,"value":3487,"toc":3504},[3488,3491,3494,3497],[11,3489,3485],{"id":3490},"laser-beam",[15,3492,3493],{},"Beam added relative kernels (e.g., kernels that are only valid if another kernel exists on the blockchain) as a part of our expansion of the Mimblewimble protocol, which birthed the creation of Laser Beam direct payment channels similar to those used in the Lightning Network.",[15,3495,3496],{},"Fast transactions and scalability is an issue that most cryptocurrencies have yet to solve. Laser Beam establishes a funded channel between two wallets that performs instant transactions that later settle on-chain. Laser Beam is operational on Beam Mainnet (Command-Line support, only).",[15,3498,3499,3500,599],{},"See our Beam wiki for more information regarding ",[19,3501,3485],{"href":3502,"rel":3503},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FLightning-Network",[112],{"title":135,"searchDepth":170,"depth":170,"links":3505},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Flaser-beam",{"title":3485,"description":3493},"docs\u002Fdev\u002Fbeam-technology\u002Flaser-beam","yfdudheyqMiqoZCB5Kc_8-TtifXAyIzPSkzWoiCGreI",{"id":3512,"title":890,"body":3513,"description":3576,"extension":741,"image":742,"meta":3577,"navTitle":742,"navigation":744,"path":3578,"seo":3579,"stem":3580,"__hash__":3581},"docs\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Flelantusmw.md",{"type":8,"value":3514,"toc":3574},[3515,3518,3527,3542,3557,3568],[11,3516,890],{"id":3517},"lelantusmw",[15,3519,3520,3521,3526],{},"Cryptographer ",[19,3522,3525],{"href":3523,"rel":3524},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Faramjivanyan\u002F",[112],"Aram Jivanyan"," of Firo (formerly ZCoin) initially developed Lelantus as a new protocol for a confidential exchange of value.",[15,3528,3529,3530,3535,3536,3541],{},"The core principles of Lelantus describe the related proofs placing a UTXO set into a ",[19,3531,3534],{"href":3532,"rel":3533},"https:\u002F\u002Fbeamx.gitbook.io\u002Fglossary\u002F-Ma56WMqUB1AsnhoithB\u002F",[112],"shielded pool"," while the ",[19,3537,3540],{"href":3538,"rel":3539},"https:\u002F\u002Fwww.google.com\u002Fsearch?q=anonymity+set+crypto&sxsrf=ALeKk03stmb--lt3dzzlAfJEASZzekFidw%3A1625620539632&ei=OwDlYKXhJfW3qtsP4f6o8Aw&oq=anonymity+set+crypto&gs_lcp=Cgdnd3Mtd2l6EAMyBQghEKABMgUIIRCgAToHCCMQsAMQJzoHCAAQRxCwAzoCCAA6BggAEBYQHjoFCCEQqwJKBAhBGABQ2UdY1FdggVpoAXACeACAAcYBiAGFCZIBAzAuOJgBAKABAaoBB2d3cy13aXrIAQnAAQE&sclient=gws-wiz&ved=0ahUKEwjl6ra25M_xAhX1m2oFHWE_Cs4Q4dUDCA8&uact=5",[112],"anonymity set"," accumulates. The UTXO set leaves the shielded pool as a \"new\" UTXO set equally the exact total value as UTXO set initially submitted.",[15,3543,3544,3545,3550,3551,3556],{},"Beam combined Lelantus with Mimblewimble to create a hybrid",[19,3546,3549],{"href":3547,"rel":3548},"https:\u002F\u002Fdocs.beam.mw\u002FLelantus-MW.pdf",[112]," LelantusMW protocol",". This hybrid protocol resolves the issue of ",[19,3552,3555],{"href":3553,"rel":3554},"https:\u002F\u002Fieeexplore.ieee.org\u002Fdocument\u002F8806723",[112],"linkability",", which in some instances could allow an active attack to establish a link between wallets (though not to determine identities or values of the transactions).",[15,3558,3457,3559,522,3562,3567],{},[19,3560,890],{"href":883,"rel":3561},[112],[19,3563,3566],{"href":3564,"rel":3565},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FMW-CLA",[112],"MW Confidential Lelantus Assets"," for a more in-depth description of our protocol.",[15,3569,3570],{},[19,3571,3572],{"href":3572,"rel":3573},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=cQGQZ1OWPmc&ab_channel=ZKProofStandards",[112],{"title":135,"searchDepth":170,"depth":170,"links":3575},[],"Cryptographer Aram Jivanyan of Firo (formerly ZCoin) initially developed Lelantus as a new protocol for a confidential exchange of value.",{},"\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Flelantusmw",{"title":890,"description":3576},"docs\u002Fdev\u002Fbeam-technology\u002Flelantusmw","zvtRSRbXVwMle-dcn526yZSbooUR8PyHIh6wDBhhQHU",{"id":3583,"title":3584,"body":3585,"description":3592,"extension":741,"image":742,"meta":3655,"navTitle":742,"navigation":744,"path":3656,"seo":3657,"stem":3658,"__hash__":3659},"docs\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fmimblewimble.md","Mimblewimble",{"type":8,"value":3586,"toc":3653},[3587,3590,3593,3599,3602,3605,3611,3614,3623,3629,3632,3635,3648,3650],[11,3588,3584],{"id":3589},"mimblewimble",[15,3591,3592],{},"Mimblewimble is an innovative confidential cryptocurrency protocol described initially in a whitepaper published in October 2016 by an anonymous author under the pseudonym of Tom Elvis Jedusor.",[15,3594,3595],{},[2283,3596],{"alt":3597,"src":3598},"Screenshot of MW whitepaper as it was published","..\u002F.gitbook\u002Fassets\u002FMW.PNG",[15,3600,3601],{},"In this relatively short whitepaper (only six pages), the author has presented a fantastic idea: building a confidential value exchange protocol that does not bloat the blockchain size but instead compressing the blockchain by removing the intermediate transactions while validating the entire blockchain.",[15,3603,3604],{},"To achieve this, replacing the UTXO with Pedersen Commitments and then validating block validity by summing up all inputs and outputs and ensuring that the resulting sum is zero (or more precisely equal to coinbase transaction). Since the same approach can extend to all blocks, the resulting blockchain size growth is a function of UTXOs rather than transactions (which, in average cases, produces an order of magnitude smaller blockchain). Each UTXO also contains a zero-knowledge range proof that ensures the UTXO value is positive..",[15,3606,3607],{},[2283,3608],{"alt":3609,"src":3610},"Explanation of the UTXO structure using Pedersen Commitments","..\u002F.gitbook\u002Fassets\u002Fmw2.PNG",[15,3612,3613],{},"To balance the difference in blinding factors, each transaction also contains the \"kernel,\" which includes the signed difference in its simplest form.",[15,3615,3616,3617,3622],{},"Mathematician ",[19,3618,3621],{"href":3619,"rel":3620},"https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fandrew-poelstra-958a75106\u002F",[112],"Andrew Poelstra"," first reviewed the protocol and published a paper validating the approach.",[15,3624,3625],{},[19,3626,3627],{"href":3627,"rel":3628},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=aHTRlbCaUyM&ab_channel=SFBitcoinDevelopers",[112],[15,3630,3631],{},"Beam started by implementing the whitepaper verbatim and later expanded it by first adding relative kernels and later Lelantus shielded pool and eventually the Beam Virtual Machine that allows to run smart contracts thus transforming Beam into a fully functional Confidential DeFi Platform.",[15,3633,3634],{},"The Beam development team's initial approach was to implement the whitepaper verbatim. They later tweaked the protocol by adding relative kernels before implementing a Lelantus shielded pool. Finally, the Beam Virtual Machine ran smart contracts, thus transforming Beam into a fully functional Confidential DeFi Platform.",[15,3636,3457,3637,522,3642,3647],{},[19,3638,3641],{"href":3639,"rel":3640},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FBeam-Technical-Specifications",[112],"Beam technical specifications",[19,3643,3646],{"href":3644,"rel":3645},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FTransaction-creation-protocol",[112],"Transaction Creation Protocol"," for additional information detailing the math and design decisions behind Beam Mimblewimble implementation.",[2328,3649],{"id":135},[2328,3651],{"id":3652},"_1",{"title":135,"searchDepth":170,"depth":170,"links":3654},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fmimblewimble",{"title":3584,"description":3592},"docs\u002Fdev\u002Fbeam-technology\u002Fmimblewimble","ysVBpqc73mc4Ngm5tDX2B9lbbkZrB76XzzoIkRRYmH0",{"id":3661,"title":934,"body":3662,"description":3669,"extension":741,"image":742,"meta":3686,"navTitle":742,"navigation":744,"path":3687,"seo":3688,"stem":3689,"__hash__":3690},"docs\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fsbbs.md",{"type":8,"value":3663,"toc":3684},[3664,3667,3670],[11,3665,934],{"id":3666},"sbbs",[15,3668,3669],{},"SBBS (Secure Bulletin Board System) is an encrypted messaging protocol used to secure communication between Beam wallets. Initially, this protocol only allowed for the interactive creation of Mimblewimble transactions. Eventually, SBBS was adapted to fit many different scenarios of passing information between wallets, such as Atomic Swap marketplace, price feed metadata, and more.",[15,3671,3672,3673,522,3678,3683],{},"SBBS is a subsystem within each Beam node designed to leak no metadata that can aid in the deanonymization of Beam users. See ",[19,3674,3677],{"href":3675,"rel":3676},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FSecure-bulletin-board-system-(SBBS)",[112],"SBBS Design",[19,3679,3682],{"href":3680,"rel":3681},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FBeam-news-channels",[112],"Beam News Channels"," for additional information regarding SBBS.",{"title":135,"searchDepth":170,"depth":170,"links":3685},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-technology\u002Fsbbs",{"title":934,"description":3669},"docs\u002Fdev\u002Fbeam-technology\u002Fsbbs","braeuBfpNRQOioweafRJjIKt1nMYzNhia7cZpjKY7Sk",{"id":3692,"title":3693,"body":3694,"description":3701,"extension":741,"image":742,"meta":3713,"navTitle":742,"navigation":744,"path":3714,"seo":3715,"stem":3716,"__hash__":3717},"docs\u002Fdocs\u002Fdev\u002Fbeam-virtual-machine.md","Beam Virtual Machine",{"type":8,"value":3695,"toc":3711},[3696,3699,3702],[11,3697,3693],{"id":3698},"beam-virtual-machine",[15,3700,3701],{},"Beam Virtual Machine (BVM) is a crucial building block in Beam Confidential DeFi platform. BVM follows the WebAssembly technology stack that allows Beam Shaders (smart contract running on Beam blockchain) to support any programming language compiled into WebAssembly, including C++ (currently supported), with Go and Rust to be added at a later date.",[15,3703,3704,3705,3710],{},"‌See ",[19,3706,3709],{"href":3707,"rel":3708},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FBVM-functions-for-shaders",[112],"Beam Virtual Machine Specifications"," for more information regarding BVM.",{"title":135,"searchDepth":170,"depth":170,"links":3712},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-virtual-machine",{"title":3693,"description":3701},"docs\u002Fdev\u002Fbeam-virtual-machine","HKwuc2EblAbk5_8E8qpTzs6wPPozgAIFHfz3GfQth0Q",{"id":3719,"title":3720,"body":3721,"description":135,"extension":741,"image":742,"meta":3728,"navTitle":742,"navigation":744,"path":3729,"seo":3730,"stem":3731,"__hash__":3732},"docs\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fcommand-line-wallet.md","Command Line Wallet",{"type":8,"value":3722,"toc":3726},[3723],[11,3724,3720],{"id":3725},"command-line-wallet",{"title":135,"searchDepth":170,"depth":170,"links":3727},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fcommand-line-wallet",{"title":3720,"description":135},"docs\u002Fdev\u002Fbeam-wallets\u002Fcommand-line-wallet","rzfAftcRU2ZlLhRBOgLXgs6mCUVJs6QuWg-AneRjQDE",{"id":3734,"title":857,"body":3735,"description":135,"extension":741,"image":742,"meta":3741,"navTitle":742,"navigation":744,"path":3742,"seo":3743,"stem":3744,"__hash__":3745},"docs\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fdesktop-wallet.md",{"type":8,"value":3736,"toc":3739},[3737],[11,3738,857],{"id":1010},{"title":135,"searchDepth":170,"depth":170,"links":3740},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fdesktop-wallet",{"title":857,"description":135},"docs\u002Fdev\u002Fbeam-wallets\u002Fdesktop-wallet","m9N78l2RX41gie1jEtK2twoUIzPt-G5zYTpAkVXK7qE",{"id":3747,"title":3748,"body":3749,"description":135,"extension":741,"image":742,"meta":3756,"navTitle":742,"navigation":744,"path":3757,"seo":3758,"stem":3759,"__hash__":3760},"docs\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fmobile-wallet.md","Mobile Wallet",{"type":8,"value":3750,"toc":3754},[3751],[11,3752,3748],{"id":3753},"mobile-wallet",{"title":135,"searchDepth":170,"depth":170,"links":3755},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fmobile-wallet",{"title":3748,"description":135},"docs\u002Fdev\u002Fbeam-wallets\u002Fmobile-wallet","weQz1GqzUmL2XCdv-ZZEDmwUYyP5Kn1cqXSI2xfFE5g",{"id":3762,"title":986,"body":3763,"description":3769,"extension":741,"image":742,"meta":3789,"navTitle":742,"navigation":744,"path":3790,"seo":3791,"stem":3792,"__hash__":3793},"docs\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fweb-wallet.md",{"type":8,"value":3764,"toc":3787},[3765,3767,3770,3773,3780],[11,3766,986],{"id":985},[15,3768,3769],{},"Beam Web Wallet is the latest addition to the Beam wallet family. It is implemented as a chrome extension and can be used for sending and receiving Beam coins and Confidential Assets as well as interacting with decentralized applications (DApps) on Beam chain.",[15,3771,3772],{},"To get started with Beam Web Wallet you can get the latest mainnet version here, or install the testnet version for experiments. You are also welcome to review the user documentation here.",[15,3774,3775,3776,599],{},"Source code for Beam Web Wallet is available in this ",[19,3777,2299],{"href":3778,"rel":3779},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fweb-wallet",[112],[15,3781,3782,3783,599],{},"From the architectural point of view, Beam Web Wallet uses the WASM component that wraps Beam Wallet Library. More information about this is available in our wiki ",[19,3784,905],{"href":3785,"rel":3786},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fwiki\u002FWASM-wallet-client",[112],{"title":135,"searchDepth":170,"depth":170,"links":3788},[],{},"\u002Fdocs\u002Fdev\u002Fbeam-wallets\u002Fweb-wallet",{"title":986,"description":3769},"docs\u002Fdev\u002Fbeam-wallets\u002Fweb-wallet","2FHlF9UXlWjeTjfC1-Avm2npN8CmvY4LwJnlE4nfCn0",{"id":3795,"title":833,"body":3796,"description":3802,"extension":741,"image":742,"meta":3834,"navTitle":742,"navigation":744,"path":3835,"seo":3836,"stem":3837,"__hash__":3838},"docs\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002FREADME.md",{"type":8,"value":3797,"toc":3832},[3798,3800,3803,3806,3812,3815],[11,3799,833],{"id":938},[15,3801,3802],{},"Beam Confidential Assets (CA) are an important extension that allows users to register new asset types and emit (or burn) these assets by simply running commands in the CLI wallet, without any need for programming or smart contracts.",[15,3804,3805],{},"In the screenshot below you see an example of Beam Desktop Wallet holding RAYS - which are Beam Community engagement tokes implemented as CA on Beam chain:",[15,3807,3808],{},[2283,3809],{"alt":3810,"src":3811},"Example of RAYS confidential asset in Beam Wallet","..\u002F.gitbook\u002Fassets\u002Frays.PNG",[15,3813,3814],{},"Information about CA includes the following topics:",[87,3816,3817,3823,3829],{},[33,3818,3819],{},[19,3820,3822],{"href":3821},"implementation-of-confidential-assets","Implementing Confidential Assets",[33,3824,3825],{},[19,3826,3828],{"href":3827},"using-confidential-assets\u002F","Using Confidential Assets",[33,3830,3831],{},"Using Confidential Assets through Wallet API",{"title":135,"searchDepth":170,"depth":170,"links":3833},[],{},"\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Freadme",{"title":833,"description":3802},"docs\u002Fdev\u002Fconfidential-assets\u002FREADME","2QTVyYBEhp6eqGTcTRyrpo2z21xyCN00Me9G9RQx4kE",{"id":3840,"title":3841,"body":3842,"description":4484,"extension":741,"image":742,"meta":4485,"navTitle":742,"navigation":744,"path":4486,"seo":4487,"stem":4488,"__hash__":4489},"docs\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fimplementation-of-confidential-assets.md","Implementation of Confidential Assets",{"type":8,"value":3843,"toc":4469},[3844,3846,3849,3904,3908,3911,3925,3929,3932,3946,3950,3956,3963,3967,3970,3974,3985,3991,3995,3998,4001,4005,4011,4014,4022,4028,4032,4035,4054,4057,4060,4064,4067,4070,4073,4113,4117,4129,4132,4143,4146,4154,4167,4171,4174,4191,4194,4199,4202,4213,4216,4220,4222,4249,4255,4266,4271,4274,4287,4291,4301,4304,4307,4310,4329,4340,4344,4350,4388,4391,4402,4405,4408,4414,4422,4429,4433,4436,4444,4452,4455,4463,4466],[11,3845,3841],{"id":3821},[15,3847,3848],{},"Implementing confidential assets on the Beam blockchain takes advantage of the LelantusMW protocol enhancing the privacy and security for all transactions.",[87,3850,3851,3869,3882],{},[33,3852,3853,3856],{},[45,3854,3855],{},"CA support",[87,3857,3858,3861],{},[33,3859,3860],{},"Blinded asset tags, similar to the Elements design by A. Poelstra, can optionally be associated with each Unspent Transaction Output (UTXO).",[33,3862,3863,3864,599],{},"Asset tags have a proof of validity based on the 1-out-of-many Sigma protocol, developed by ",[19,3865,3868],{"href":3866,"rel":3867},"https:\u002F\u002Feprint.iacr.org\u002F2014\u002F764.pdf",[112],"Jens Groth",[33,3870,3871,3874],{},[45,3872,3873],{},"Shielded pool (e.g., LelantusMW)",[87,3875,3876,3879],{},[33,3877,3878],{},"CA support for shielded operations.",[33,3880,3881],{},"One-side payments and direct anonymous payments support.",[33,3883,3884,3885],{},"The system design is heterogeneous in nature:\n",[87,3886,3887,3890,3901],{},[33,3888,3889],{},"All kernels carry excess blinding factors and may include extra validation rules such as height lock and relative lock.",[33,3891,3892,3893],{},"Some kernels may control subsystems:\n",[87,3894,3895,3898],{},[33,3896,3897],{},"Asset control (creation, emission).",[33,3899,3900],{},"Shielded operations (mint, spend).",[33,3902,3903],{},"Kernels not only affect the balance but include side effects.",[767,3905,3907],{"id":3906},"confidential-assets-support","Confidential assets support",[15,3909,3910],{},"This current design differs significantly from the previous, older design.",[15,3912,3913,3914,3917,3918,3920,3921,3924],{},"We identify each asset by ",[50,3915,3916],{},"AssetID"," as a 32-bit integer. For each asset there's an appropriate NUMS generator, which is generates deterministically from the ",[50,3919,3916],{}," (via hashing). The ",[50,3922,3923],{},"AssetID == 0"," is reserved for default asset (Beam).",[25,3926,3928],{"id":3927},"utxo-encoding","UTXO encoding",[15,3930,3931],{},"Due Mimblewimble (MW), it is feasible to encode UTXOs (asset types) using different NUMS (nothing-up-my-sleeve) generators. The UTXO representing the asset is comprises the following:",[87,3933,3934,3937,3940,3943],{},[33,3935,3936],{},"Blinded generator: $$H^* = H_i + k_A•G$$",[33,3938,3939],{},"Asset surjection proof (verifies the provided generator is indeed one of the generators listed (with arbitrary blinding factor added).",[33,3941,3942],{},"Pedersen commitment: $$C = k•G + v•H^*$$",[33,3944,3945],{},"Rangeproof (bulletproof): in terms of this blinded generator.",[2328,3947,3949],{"id":3948},"asset-surjection-proof","Asset surjection proof",[15,3951,3952,3953,3955],{},"Derived from the Sigma protocol, where the prover specifies a range of ",[50,3954,3916],{}," values, and proves that the specified generator with arbitrary blinded factor is one of the generators within that range.",[15,3957,3958,3959,3962],{},"Meanwhile, the verifier generates a list of asset generators for the provided range, methodically subtracting the provided blinded generator from each element on the list. The Prover confirms the Sigma protocol by providing the opening of one of the elements for the blinding factor, i.e., the ",[50,3960,3961],{},"G"," generator.",[25,3964,3966],{"id":3965},"asset-control","Asset control",[15,3968,3969],{},"Asset controls grants any user permission to create new asset types vs Beam which are automatically released into circulation with each new block generated. Assets are emitted and burned by the asset owner. The asset lifecycle has three stages: Asset creation, asset emission\u002Fburn and asset destroying.",[2328,3971,3973],{"id":3972},"asset-creation","Asset creation",[15,3975,3976,3977,3980,3981,3984],{},"When sending an asset creating transaction type, it provides both the ",[45,3978,3979],{},"Owner key"," and associated ",[45,3982,3983],{},"metadata",". Any proceeding asset actions will require a private key signature, and metadata visible to all users is immutable once the asset is created.",[15,3986,3987,3988,3990],{},"Metadata reserves a significant number of Beams when locking an asset, meaning that this transaction implicitly uses up that amount. If the transaction is successful, the system assigns the lowest available and unused ",[50,3989,3916],{}," to the asset and links it to the asset.",[2328,3992,3994],{"id":3993},"asset-emissionburn","Asset emission\u002Fburn",[15,3996,3997],{},"The user initiates a transaction by sending a unique asset emission kernel, which can have a positive or negative emission amount. To complete the transaction, the kernel excess blinding factor must be signed by the appropriate private key of the asset owner.",[15,3999,4000],{},"This transaction will automatically create or consume a certain amount of the asset, which should be balanced out by other transaction elements such as inputs and outputs.",[2328,4002,4004],{"id":4003},"asset-destroying","Asset destroying",[15,4006,4007,4008,4010],{},"To destroy an asset, an asset-destroying kernel with owner key signature is required. Once the asset has been destroyed, the ",[50,4009,3916],{}," is no longer linked to the owner, and the locked Beams  return to the user.",[15,4012,4013],{},"Asset can be destroyed only if:",[87,4015,4016,4019],{},[33,4017,4018],{},"Total burn occurs.",[33,4020,4021],{},"Minimum lock period elapsed after asset burn completes without an emitted event.",[15,4023,4024,4025,4027],{},"This minimum lock period prevents any asset owner manipulation or tampering. For example, if a user requests a specific asset, the ",[50,4026,3916],{}," must be directly linked with the asset info (Metadata and owner key) before its transaction expires. This tweak prevents the asset owner from destroying or re-create an asset during the lock period.",[25,4029,4031],{"id":4030},"asset-state","Asset state",[15,4033,4034],{},"The current state of the system includes a commitment to the latest state of assets, represented as an MMR root of all active assets and their relevant information:",[87,4036,4037,4040,4043],{},[33,4038,4039],{},"Static info (Metadata and owner public key)",[33,4041,4042],{},"Current emission value",[33,4044,4045,4046],{},"Lockheight:  The system maintains the latest height of the asset's transition from being burned to not being burned. Based on this information, users can take certain actions:\n",[87,4047,4048,4051],{},[33,4049,4050],{},"Asset owner can determine whether and when the asset can be destroyed, and consequently unlock the funds that were previously locked.",[33,4052,4053],{},"Other users can estimate the minimum height range within which the asset can be safely used. This helps determine whether the asset was subject to reorgs in the past or could be tampered with in the future.",[15,4055,4056],{},"Locking funds for asset creation is necessary to prevent spamming in the system. If there are too many assets, it can cause the Nodes to become heavier and can also reduce the effectiveness of the asset surjection proof due to a limited anonymity set. Although a significant amount of funds need to be locked, this design should not be an issue for users who are experimenting with assets as they will receive their funds back upon completion.",[15,4058,4059],{},"However, for organizations selling assets to users, it is unclear if they will ever be able to burn their assets back, as they must first own all of their assets. Despite this, the risk seems justified.",[25,4061,4063],{"id":4062},"note-on-transaction-repeatability","Note on transaction repeatability",[15,4065,4066],{},"UTXO-based systems, including MW, face a unique issue of repeatability. When an attacker possesses all the inputs of a transaction where they pay someone (which is typically the case), they can repeat this transaction in the future without the recipient's consent. Furthermore, if the recipient spends only the inputs received from the attacker, the attacker can repeat those transactions as well, and so on. This process can continue until a certain depth is reached where additional inputs are required, which were not initially obtained from the attacker.",[15,4068,4069],{},"Trading only beams reduces the impact of 'replays' since users can only receive beams, not lose them. However, the situation is different when it comes to asset-controlling transactions. Since assets are created through transactions, attackers can potentially replay these transactions and cause additional asset emissions, leading to a significant problem. Additionally, by replaying these transactions, attackers may be able to gain some of the newly created assets, further compounding the issue.",[15,4071,4072],{},"To mitigate this threat, starting from Fork2, duplicating kernels will be forbidden. Technically this is achieved by the following:",[87,4074,4075,4082,4089,4100,4107],{},[33,4076,4077,4078,4081],{},"Additional consensus parameter (",[50,4079,4080],{},"MaxKernelLifespan)"," equivalent to roughly ~ one month.",[33,4083,4084,4085,4088],{},"Starting from Fork2, kernels with ",[50,4086,4087],{},"HeightLock.Min"," (minimum height) lower than Fork2 will be rejected.",[33,4090,4091,4092,4095,4096,4099],{},"Each kernel, in addition to the optional ",[50,4093,4094],{},"HeightLock.Max"," (maximum height) will have an implicit max height lock as ",[50,4097,4098],{},"HeightLock.Min + MaxKernelLifespan",". This (and the previous restriction) will make repeating old kernels impossible.",[33,4101,4102,4103,4106],{},"Each node will track all recent kernels down to the current height minus ",[50,4104,4105],{},"MaxKernelLifespan",". Kernels that are below this height may be removed from the system for the purpose of blockchain verification.",[33,4108,4109,4110,4112],{},"Side effect: Kernels with relative height lock (available on mainnet) will not be able to reference a kernel older than ",[50,4111,4105],{},". However, this should not pose an issue as relative locks require much shorter duration. This effectively makes kernel replaying illegal, reducing the burden on the nodes to track only the most recent kernels.",[767,4114,4116],{"id":4115},"shielded-pool-aka-lelantus-mw","Shielded pool (a.k.a. Lelantus-MW)",[15,4118,4119,4122,4123,4128],{},[45,4120,4121],{},"Disclaimer",": The ",[19,4124,4127],{"href":4125,"rel":4126},"https:\u002F\u002Flelantus.io\u002F",[112],"Lelantus Protocol"," is the creation of Zcoin's cryptographer Aram Jivanyan as part of research aimed at improving privacy protocols. Our team's design and implementation are based on the publicly-available Lelantus scientific paper. All our code was developed from scratch based on this paper as our reference.",[15,4130,4131],{},"While Lelantus greatly improves upon privacy, to solve the issue of MW linkability, users can recycle funds via a shielded pool. This tweak from the original Lelantus protocol is unique in the following ways:",[87,4133,4134,4137,4140],{},[33,4135,4136],{},"Transaction values are never revealed.",[33,4138,4139],{},"The Lelantus Protocol formulates transactions as mint\u002Fspend primitives, which can be combined with MW and shielded parts in any way that satisfies the balance-to-zero principle used in MW.",[33,4141,4142],{},"Native CA support.",[15,4144,4145],{},"In technical terms, the system supports the following in addition to standard transaction elements:",[87,4147,4148,4151],{},[33,4149,4150],{},"Shielded output: transfers a portion of MW into shielded pool",[33,4152,4153],{},"Shielded input: withdraws a portion of the shielded pool back into MW (both are deemed as special transaction kernels on the blockchain.",[15,4155,4156,4157,4159,4160,4163,4164,599],{},"To supplement the standard MW blinding factor generator ",[50,4158,3961],{},", an extra generator ",[50,4161,4162],{},"J"," is available for the secondary blinding factor, i.e., the ",[104,4165,4166],{},"serial number",[25,4168,4170],{"id":4169},"shielded-output","Shielded output",[15,4172,4173],{},"Consists of the following:",[87,4175,4176,4179,4182,4185,4188],{},[33,4177,4178],{},"Blinded serial number commitment: $$C_s = k_s•G + s•J$$",[33,4180,4181],{},"Generalized Schnorr's signature that proves the above commitment is indeed of this form",[33,4183,4184],{},"Optionally asset info: the blinded asset generator + asset surjection proof.",[33,4186,4187],{},"UTXO commitment $$C_ = k_•G + v•H$$",[33,4189,4190],{},"Rangeproof",[15,4192,4193],{},"The UTXO commitment $$C_$$ (without the serial number) is accounted for when verifying the transaction balance. After verification, rather than combining UTXO set, the following double-blinded commitment goes into the shielded pool:",[87,4195,4196],{},[33,4197,4198],{},"$$C = C_s + C_ = s•J + (k_s + k_)•G + v•H$$",[15,4200,4201],{},"The shielded outputs in the pool form a sequence of commitments (EC points).",[15,4203,4204,4205,4208,4209,4212],{},"The serial number (",[45,4206,4207],{},"s",") is obtained from a different public key (",[50,4210,4211],{},"SpendKey)"," which discloses during the spending process. In addition, the prover will need to prove the knowledge of the appropriate private key.",[15,4214,4215],{},"In addition, the $$C_s$$ commitment must be unique. This prevents accidental misuse, and avoids making subsequent element withdrawal impossible.",[25,4217,4219],{"id":4218},"shielded-input","Shielded input",[15,4221,4173],{},[87,4223,4224,4227,4233,4235,4243,4246],{},[33,4225,4226],{},"Range within the shielded poo containing the being-spent element.",[33,4228,4229,4232],{},[50,4230,4231],{},"SpendKey"," is disclosed, providing the key signature needed for the shielded input.",[33,4234,4184],{},[33,4236,4237,4238],{},"Output commitment $$C_ = k_•G + v•H$$\n",[87,4239,4240],{},[33,4241,4242],{},"It should commit to the same value, but the blinding factor $$k_$$ differs from that used in shielded output.",[33,4244,4245],{},"Generalized Schnorr's signature, that proves the $$C_$$ is indeed of this form.",[33,4247,4248],{},"Sigma proof for the rest.",[15,4250,4251,4252,4254],{},"The ",[50,4253,4231],{}," must be unique to prevent double-spending of an asset.",[15,4256,4257,4258,4262,4263,4265],{},"During verification, the verifier computes the serial number (",[45,4259,4260],{},[50,4261,4207],{},") from the ",[50,4264,4231],{}," while calculating the following:",[87,4267,4268],{},[33,4269,4270],{},"$$C = C_ + s•J$$ This EC point is subtracted (methodically) from all the elements in the referenced range of the shielded pool.",[15,4272,4273],{},"If everything is correct, then the element spent transforms into:",[87,4275,4276],{},[33,4277,4278,4279,522,4282,4284,4285,3962],{},"$$C = (k_s + k_ - k_)•G$$ Note that both as the set and serial number generators ",[50,4280,4281],{},"H",[50,4283,4162],{}," are eliminated. The prover proceeds to demonstrate their knowledge of the opening of one of the elements within the range, using only the ",[50,4286,3961],{},[25,4288,4290],{"id":4289},"one-side-payments-and-direct-anonymous-payments","One-side payments, and direct anonymous payments",[15,4292,4293,4294,4297,4298,4300],{},"The shielded pool enables one-side payments (MW transactions require mutual agreement from both parties). This is because the serial number (",[45,4295,4296],{},"S",") is derived from an arbitrary public key ",[50,4299,4231],{},", which can be calculated by the sender without the disclosure of the appropriate private key.",[15,4302,4303],{},"However, this method is not totally anonymous as the sender can see when the receiver spends the funds. To solve this issue, the shielded output consists of two parts: the $$C_s$$ and $$C_$$. During the initial setup, the receiver generates and sends an arbitrary number of different $$C_s$$ elements (with their Schnorr's signatures). The sender then uses these elements in the shielded output without knowledge of the serial number.",[15,4305,4306],{},"Our scheme enables the receiver to scan the blockchain to detect all its shielded outputs without needing an auxiliary channel. For $$C_s$$ all the owner info is embedded within the Schnorr's signature (which has a degree of freedom). For the $$C_$$, the owner info is embedded in the Schnorr's signature, while the requires info recovery from the bulletproof.",[15,4308,4309],{},"Ultimately, the following information is recovered:",[87,4311,4312,4320,4323,4326],{},[33,4313,4314,4315,4317,4318],{},"All the relevant parameters: blinding factor, ",[50,4316,4231],{},", value, ",[50,4319,3916],{},[33,4321,4322],{},"Is it visible to the sender, i.e., was the $$C_s$$ created by the sender or the receiver in advance.",[33,4324,4325],{},"Sender ID (a public key belonging to the sender).",[33,4327,4328],{},"Default 32-byte message.",[15,4330,4331,4332,4335,4336,4339],{},"The aforementioned information can be retrieved through the ",[50,4333,4334],{},"Owner"," key. However, the ",[50,4337,4338],{},"master"," key is still necessary to spend it. This enables the utilization of the owner key in owned nodes to recognize owned TXOs and shielded elements without jeopardizing the funds in the event of a node compromise.",[25,4341,4343],{"id":4342},"implications-and-constraints","Implications and constraints",[15,4345,4346,4347,599],{},"The Lelantus is a great technology, ",[45,4348,4349],{},"but it comes with known limitations",[87,4351,4352,4371],{},[33,4353,4354,4355],{},"Scalability (size).\n",[87,4356,4357],{},[33,4358,4359,4360],{},"No MW cut-through for the shielded inputs\u002Foutputs. MW cut-through applies to non-shielded inputs\u002Foutputs.\n",[87,4361,4362,4365,4368],{},[33,4363,4364],{},"Shielded output ~800 bytes.",[33,4366,4367],{},"Shielded input ~1.6KB, can vary depending on anonymity set size.",[33,4369,4370],{},"If asset type is blinded: two more asset proofs (output and input), another ~2KB",[33,4372,4373,4374],{},"Verification time.\n",[87,4375,4376,4379,4382,4385],{},[33,4377,4378],{},"Roughly one second for 64KB elements (very big).",[33,4380,4381],{},"Easily parallelized",[33,4383,4384],{},"Only 10 milliseconds for each additional proof for the same anonymity set (batch verification).",[33,4386,4387],{},"During initial sync, many blocks can be batch-verified at once.",[15,4389,4390],{},"Thus, in order to create a sensible system that reaps the advantages of MW while also disrupting linkability, we have developed the following design:",[87,4392,4393,4396,4399],{},[33,4394,4395],{},"The majority of transactions should still use MW.",[33,4397,4398],{},"The number of shielded inputs\u002Foutputs in a block is limited, creating a competitive fee market.",[33,4400,4401],{},"The spend window, which determines the anonymity set size, is limited, and this limit is further reduced if the element being spent is not one of the most recent.",[15,4403,4404],{},"The maximum spend window or anonymity set size is yet to be decided but will likely be between 50,000 to 100,000 KB. The number of shielded elements in a block will be limited to create this window over several days.",[15,4406,4407],{},"Additionally, users can only spend their shielded elements with the maximum spend window if it references the most recent elements. If they miss their opportunity, they will have to spend it in a smaller spend window of around 1,000 elements. However, they can recycle it through the shielded pool again.",[15,4409,4410,4411,668],{},"As a result, our team has designed a network that offers equal amounts of ",[45,4412,4413],{},"scalability and performance",[87,4415,4416,4419],{},[33,4417,4418],{},"Not too many elements that can't be cut-through",[33,4420,4421],{},"Reasonable verification times: shielded inputs will have large overlap.",[15,4423,4424,4425,4428],{},"But importantly, those restrictions will also lead to ",[45,4426,4427],{},"better privacy",". Here's why:",[25,4430,4432],{"id":4431},"privacy","Privacy",[15,4434,4435],{},"In order to understand how effectively privacy is achieved through hiding within a crowd, it's important to define two terms: absolute and relative anonymity sets.",[87,4437,4438,4441],{},[33,4439,4440],{},"The absolute anonymity set size refers to the total number of individuals in the set that the user has chosen to hide among.",[33,4442,4443],{},"The relative anonymity set size, on the other hand, is the ratio of the chosen absolute set size to the overall set size weighted by the probabilities of hiding in each potential subset.",[15,4445,4446,4447,599],{},"In simpler terms, the relative set size represents the probability that a user will choose a specific absolute set. To achieve a high level of privacy, both the absolute and relative sets should be maximized. If the absolute set size is small, the user may already be suspected. If the relative set size is small, the user can still be de-anonymized through repeated transactions, even if the absolute anonymity set is large. ",[19,4448,4451],{"href":4449,"rel":4450},"https:\u002F\u002Fzfnd.org\u002Fblockchain-privacy-equal-parts-theory-and-practice\u002F",[112],"A good explanation by Ian Miers is here",[15,4453,4454],{},"Due to the finite size of the anonymity set in Lelantus, a compromise must be made.",[87,4456,4457,4460],{},[33,4458,4459],{},"If too few users use the system, then each user's activity can be easily identified.",[33,4461,4462],{},"However, if too many users use the system, the anonymity set is filled up quickly, resulting in a smaller relative set size and a lower probability of an unrelated user falling into the same set.",[15,4464,4465],{},"In contrast, systems with an unlimited anonymity set size, such as Zcash, have an advantage in this regard. However, in practice, the difference may not be significant since users typically spend their recent outputs, which can be assumed by attackers with a significant probability even in Lelantus.",[15,4467,4468],{},"To accurately estimate the practical privacy of the system, real-world usage data may be needed.",{"title":135,"searchDepth":170,"depth":170,"links":4470},[4471,4477],{"id":3906,"depth":170,"text":3907,"children":4472},[4473,4474,4475,4476],{"id":3927,"depth":180,"text":3928},{"id":3965,"depth":180,"text":3966},{"id":4030,"depth":180,"text":4031},{"id":4062,"depth":180,"text":4063},{"id":4115,"depth":170,"text":4116,"children":4478},[4479,4480,4481,4482,4483],{"id":4169,"depth":180,"text":4170},{"id":4218,"depth":180,"text":4219},{"id":4289,"depth":180,"text":4290},{"id":4342,"depth":180,"text":4343},{"id":4431,"depth":180,"text":4432},"This page describes CA(Confidential Assets), Lelantus-MW, as well as will enable adding more features in the future.",{},"\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fimplementation-of-confidential-assets",{"title":3841,"description":4484},"docs\u002Fdev\u002Fconfidential-assets\u002Fimplementation-of-confidential-assets","R_qr5OnnIVfmAiWz5luMKlL-K-PpBkx3Ifty3Dta6t4",{"id":4491,"title":3828,"body":4492,"description":5091,"extension":741,"image":742,"meta":5092,"navTitle":742,"navigation":744,"path":5093,"seo":5094,"stem":5095,"__hash__":5096},"docs\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002FREADME.md",{"type":8,"value":4493,"toc":5064},[4494,4497,4499,4503,4526,4536,4545,4555,4559,4562,4566,4575,4579,4585,4597,4602,4606,4616,4623,4627,4630,4633,4636,4643,4646,4654,4658,4664,4668,4672,4678,4684,4690,4693,4700,4704,4716,4719,4729,4733,4738,4740,4743,4747,4750,4754,4761,4767,4773,4778,4782,4785,4788,4791,4794,4797,4800,4806,4809,4812,4816,4822,4828,4834,4839,4842,4845,4848,4851,4854,4859,4862,4865,4868,4875,4881,4887,4892,4895,4898,4901,4904,4907,4909,4912,4915,4918,4921,4925,4934,4940,4950,4957,4960,4965,4968,4973,4977,4989,4995,4998,5001,5005,5013,5016,5022,5025,5028,5032,5035,5038,5047,5050,5055,5058,5061],[11,4495,3828],{"id":4496},"using-confidential-assets",[767,4498,2808],{"id":2807},[25,4500,4502],{"id":4501},"assets-support","Assets Support",[15,4504,4505,4506,2815,4512,4518,4519,4521,4522,4525],{},"Confidential Assets (CA) support requires ",[19,4507,4510],{"href":4508,"rel":4509},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fdiscussions\u002F1889",[112],[50,4511,2859],{},[19,4513,4515],{"href":980,"rel":4514},[112],[50,4516,4517],{},"v5.0"," CLI\u002FAPI. Any CA operation before ",[50,4520,2859],{}," would fail with the ",[50,4523,4524],{},"AssetsDisabledFork2 (45)"," error code.",[15,4527,4528,4529,4531,4532,4535],{},"In ",[50,4530,4517],{}," CA support is disabled by default to prevent compatibility issues. Currently, CA transactions are not supported in the GUI wallet, and the GUI wallet would reject all incoming CA transactions with the ",[50,4533,4534],{},"AssetsDisabled (43)"," error code. Rejected CA transactions do not display in the GUI wallet. Full GUI assets support is planned for later releases.",[15,4537,4538,4539,4542,4543,4525],{},"Users must specify the ",[50,4540,4541],{},"--enable_assets"," flag to perform  CA transactions with the CLI and API Without this flag, CA transactions would be rejected with the ",[50,4544,4534],{},[15,4546,4547,4548,3463,4551,4554],{},"Information about Assets UTXOs\u002FShielded Coins\u002FAssets Transactions\u002FAssets Summary can be displayed using ",[50,4549,4550],{},"--assets",[50,4552,4553],{},"--asset_id"," ID parameters added to the corresponding commands.",[25,4556,4558],{"id":4557},"fees","Fees",[15,4560,4561],{},"All fees (transaction fees and registration deposit) are always paid in BEAM\u002FGroth. It is not possible to pay any fees using assets.",[25,4563,4565],{"id":4564},"asset-owner","Asset Owner",[15,4567,4568,4570,4571,4574],{},[50,4569,4565],{}," is the person (wallet) who registered the asset. The asset owner owns the private key used for signing asset ",[50,4572,4573],{},"issue\u002Fconsume\u002Funreg"," operations.",[25,4576,4578],{"id":4577},"asset-id","Asset ID",[15,4580,4581,4582,4584],{},"The asset is identified to the network by its",[50,4583,4578],{}," which is an unsigned integer. All asset-related actions are performed using the asset ID. The node automatically assigns the first available asset ID when registering an asset.",[15,4586,4587,4588,4591,4592,4596],{},"Technically there can be a situation when one asset is unregistered, ",[50,4589,4590],{},"asset id"," becomes available, and the next registered asset takes the id that has been previously used. A ",[19,4593,4595],{"href":4594},".\u002F#lock-period","Lock period"," is introduced to ensure that asset receiver would never receive an unexpected (forged) asset.",[15,4598,4599,4601],{},[50,4600,4578],{}," of 0 is reserved and represents an original BEAM.",[25,4603,4605],{"id":4604},"asset-info","Asset Info",[15,4607,4608,4611,4612,2839],{},[50,4609,4610],{},"Asset info"," is information about the asset. It includes asset metadata, total emission and lock height. Asset info is received by the wallet automatically during asset transactions or can be requested manually using ",[19,4613,4615],{"href":4614},".\u002F#getting-asset-info","asset_info",[15,4617,4618,4619,4622],{},"Some parts of the asset info are valid only at the height the asset info has been received (",[50,4620,4621],{},"refresh height","). In subsequent blocks total asset emission can change or the asset become unregistered. Unregistering the asset invalidates all the information associated with the particular asset id.",[25,4624,4626],{"id":4625},"limits","Limits",[15,4628,4629],{},"Maximum Asset emission is $$2^{128}-1$$ asset nth units. Maximum amount for a single asset transaction (issue, consume, send, receive &c.) is $$2^{64}-1$$ asset nth units.",[25,4631,4595],{"id":4632},"lock-period",[15,4634,4635],{},"Lock period is a timeframe when several asset operations are restricted for safety reasons. This ensures that asset is not changed during rollback and\u002For by the asset owner and that receiver of the asset would receive exactly the expected asset.",[15,4637,4638,4639,4642],{},"Asset becomes locked every time when its total emission reaches 0 or leaves 0. Currently lock period duration is set to ",[50,4640,4641],{},"1440"," blocks (24 hours roughly).",[15,4644,4645],{},"Restricted operations are the following:",[87,4647,4648,4651],{},[33,4649,4650],{},"Asset unreg",[33,4652,4653],{},"Asset send\u002Freceive",[25,4655,4657],{"id":4656},"restore","Restore",[15,4659,4660,4661,4663],{},"General rules apply to the restore process. You can restore your UTXOs but not transactions. To restore shielded UTXOs node used for the restore process should be running with your owner key. Asset info is not restored automatically. You would need to execute the ",[50,4662,4615],{}," command for each restored asset manually after the restore process is completed.",[767,4665,4667],{"id":4666},"working-with-assets","Working with assets",[25,4669,4671],{"id":4670},"asset-registration","Asset registration",[15,4673,4674,4675,2897],{},"Before asset can be used it should be registered on chain using the ",[50,4676,4677],{},"asset_reg",[127,4679,4682],{"className":4680,"code":4681,"language":132},[130],".\u002Fbeam-wallet asset_reg --pass 1 -n 127.0.0.1:10000 --asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth;CUSTOM1=VAL1;CUSTOM2=VAL2\" --fee 100000 --enable_assets\n",[50,4683,4681],{"__ignoreMap":135},[15,4685,4686,4687,4689],{},"You must specify your wallet password, node address, asset meta, optional transaction fee and add ",[50,4688,4541],{}," flag.",[25,4691,4558],{"id":4692},"fees-1",[15,4694,4695,4696,4699],{},"There is a fixed fee for asset registration of 3000 BEAM. This fee is mandatory, cannot be changed and deduced from your wallet automatically. Registration fee ensures that the network would not be spammed with dummy assets. Registration fee is returned to the owner of the asset as soon as the asset is unregistered. So basically 3000 BEAM are locked for the asset lifetime. You must also pay regular transactions fees. The ",[50,4697,4698],{},"--fee"," param applies only to the transaction fee, not the registration fee.",[25,4701,4703],{"id":4702},"asset-meta","Asset meta",[15,4705,4706,4707,4710,4711,4715],{},"Asset meta is a byte buffer associated with the asset and stored on chain. It is provided on asset registration and cannot be changed afterwards. Currently CLI expects UTF8 string with several mandatory ",[50,4708,4709],{},"Key=Value"," pairs. It is not possible to register an asset without meta. Please consult the ",[19,4712,4714],{"href":4713},"asset-metadata-descriptor","Asset Descriptor"," document for more details.",[25,4717,4578],{"id":4718},"asset-id-1",[15,4720,4721,4722,4724,4725,4728],{},"After successful asset registration it is associated with the ",[50,4723,4578],{}," issued by the node. Asset becomes known to the world by its ID. Asset id is used in any asset operations performed by any person. Asset owner can perform asset operations using as asset id or asset meta. Consult the ",[19,4726,4578],{"href":4727},".\u002F#asset-id"," section for more details.",[25,4730,4732],{"id":4731},"lock-period-1","Lock Period",[15,4734,4735,4736,4728],{},"Immediately after the asset registration it becomes locked for 24h hours. Consult the ",[19,4737,4595],{"href":4594},[25,4739,4432],{"id":4431},[15,4741,4742],{},"Transaction kernel including all the asset meta becomes visible to the world. Node would know that you\u002Fyour IP is the owner of the asset.",[25,4744,4746],{"id":4745},"api-restriction","API Restriction",[15,4748,4749],{},"Asset registration can be performed only via CLI. There is no API call for asset registration for safety reasons.",[767,4751,4753],{"id":4752},"asset-issue","Asset issue",[15,4755,4756,4757,4760],{},"After asset registration its total emission is set to 0. Before performing any asset transactions the owner must mint (issue) asset coins using the ",[50,4758,4759],{},"issue"," command. Only asset owner can mint asset coins.",[127,4762,4765],{"className":4763,"code":4764,"language":132},[130],".\u002Fbeam-wallet issue --pass 1 --asset_id 1 -n 127.0.0.1:10000 --amount 10 --fee 100000 --enable_assets\n",[50,4766,4764],{"__ignoreMap":135},[127,4768,4771],{"className":4769,"code":4770,"language":132},[130],".\u002Fbeam-wallet issue --pass 1 --asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth;CUSTOM1=VAL1;CUSTOM2=VAL2\" -n 127.0.0.1:10000 --amount 10 --fee 100000 --enable_assets\n",[50,4772,4770],{"__ignoreMap":135},[15,4774,4775,4776,4689],{},"You must specify your wallet password, node address, asset id or asset meta, issue amount, optional transaction fee and add ",[50,4777,4541],{},[2328,4779,4781],{"id":4780},"coins-availability","Coins availability",[15,4783,4784],{},"New Asset coins cannot be used until the issue transaction is completed. Please ensure that the minting process is completed and new coins are present in your wallet and marked as available before sending them.",[2328,4786,4558],{"id":4787},"fees-2",[15,4789,4790],{},"Asset emission is absolutely free. You can mint as many coins as you want. You pay only regular transaction fee.",[2328,4792,4626],{"id":4793},"limits-1",[15,4795,4796],{},"Maximum Asset emission is $$2^{128}-1$$ asset nth units. Maximum amount for a single issue transaction is $$2^{64}-1$$ asset nth units.",[2328,4798,4732],{"id":4799},"lock-period-2",[15,4801,4802,4803,4805],{},"If after the issue operation total asset emission leaves 0 asset becomes locked. Consult the ",[19,4804,4595],{"href":4594}," section for more details. Asset issue can be performed even if asset is locked. Subsequent asset issue operations do not extend the lock period.",[2328,4807,4432],{"id":4808},"privacy-1",[15,4810,4811],{},"Asset information is forcibly refreshed (received from node) during this operation. Operation fails if node doesn't confirm the asset. Transaction kernel including the issued asset amount and asset id becomes visible to the world. Node would know that you\u002Fyour IP is the owner of the asset.",[767,4813,4815],{"id":4814},"asset-consume","Asset consume",[15,4817,4818,4819,2839],{},"Owner of the asset can consume (burn) asset coins. To burn the asset you must both be the owner of the asset and the owner of the particular coin\u002Futxo. Asset can be consumed using the ",[50,4820,4821],{},"consume",[127,4823,4826],{"className":4824,"code":4825,"language":132},[130],".\u002Fbeam-wallet consume --pass 1 --asset_id 1 -n 127.0.0.1:10000 --amount 10 --fee 100000 --enable_assets\n",[50,4827,4825],{"__ignoreMap":135},[127,4829,4832],{"className":4830,"code":4831,"language":132},[130],".\u002Fbeam-wallet consume --pass 1 --asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth;CUSTOM1=VAL1;CUSTOM2=VAL2\" -n 127.0.0.1:10000 --amount 10  --fee 100000 --enable_assets\n",[50,4833,4831],{"__ignoreMap":135},[15,4835,4836,4837,4689],{},"You must specify your wallet password, node address, asset id or asset meta, consume amount, optional transaction fee and add ",[50,4838,4541],{},[2328,4840,4558],{"id":4841},"fees-3",[15,4843,4844],{},"Asset consumption is free, requiring only regular transaction fees.",[2328,4846,4626],{"id":4847},"limits-2",[15,4849,4850],{},"Maximum amount for a single consume transaction is $$2^{64}-1$$ asset nth units.",[2328,4852,4732],{"id":4853},"lock-period-3",[15,4855,4856,4857,4728],{},"If after the consume operation total asset emission reaches 0 asset becomes locked. Consult the ",[19,4858,4595],{"href":4594},[2328,4860,4432],{"id":4861},"privacy-2",[15,4863,4864],{},"Asset information is forcibly refreshed (received from node) during this operation. Operation fails if node doesn't confirm the asset. Transaction kernel, including the consumed asset amount and asset id becomes visible to the world. Node would know that you\u002Fyour IP is the owner of the asset.",[767,4866,4650],{"id":4867},"asset-unreg",[15,4869,4870,4871,4874],{},"Asset can be unregistered from chain by the owner. To unregister the asset its emission should be 0 and it should be not locked. Asset is unregistered using the ",[50,4872,4873],{},"asset_unreg","command.",[127,4876,4879],{"className":4877,"code":4878,"language":132},[130],".\u002Fbeam-wallet asset_unreg --pass 1 -n 127.0.0.1:10000 --asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth;CUSTOM1=VAL1;CUSTOM2=VAL2\" --fee 100000  --enable_assets\n",[50,4880,4878],{"__ignoreMap":135},[127,4882,4885],{"className":4883,"code":4884,"language":132},[130],".\u002Fbeam-wallet asset_unreg --pass 1 -n 127.0.0.1:10000 --asset_id 1 --fee 100000 --enable_assets\n",[50,4886,4884],{"__ignoreMap":135},[15,4888,4889,4890,4689],{},"You must specify your wallet password, node address, asset meta or asset id, optional transaction fee and add ",[50,4891,4541],{},[2328,4893,4558],{"id":4894},"fees-4",[15,4896,4897],{},"Asset unregistration is free. You pay only regular transaction fee. This operation also returns 3000 BEAM locked during the asset registration.",[2328,4899,4578],{"id":4900},"asset-id-2",[15,4902,4903],{},"Asset ID becomes free after this operation and can be reused by another asset.",[2328,4905,4626],{"id":4906},"limits-3",[15,4908,4850],{},[2328,4910,4432],{"id":4911},"privacy-3",[15,4913,4914],{},"Asset information is forcibly refreshed (received from node) during this operation. Operation fails if node doesn't confirm the asset. Transaction kernel which includes asset id becomes visible to the world. Node would know that you\u002Fyour IP is the owner of the asset.",[2328,4916,4746],{"id":4917},"api-restriction-1",[15,4919,4920],{},"Asset unregistration can be performed only via CLI. There is no API call for asset unregistration for safety reasons.",[767,4922,4924],{"id":4923},"getting-asset-info","Getting Asset Info",[15,4926,4927,4928,4930,4931,4933],{},"Asset info can be received from node using ",[50,4929,4615],{}," command for any asset registered on chain. ",[50,4932,4615],{}," command stores the received info in a local database for future usage.",[127,4935,4938],{"className":4936,"code":4937,"language":132},[130],".\u002Fbeam-wallet asset_info --pass 1 -n 127.0.0.1:10000 --asset_id 1 --enable_assets\n",[50,4939,4937],{"__ignoreMap":135},[15,4941,4942,4944,4945,3463,4947,4949],{},[50,4943,4615],{}," command always receives the latest information from node. To view locally stored information regular info command should be used with ",[50,4946,4550],{},[50,4948,4553],{}," ID parameters.",[15,4951,4952,4953,4956],{},"Asset owner can query asset info using asset meta (",[50,4954,4955],{},"--asset_meta \"STD:....\"",") as well. Non-owners can use only asset id.",[2328,4958,4558],{"id":4959},"fees-5",[15,4961,4962,4964],{},[50,4963,4615],{}," operation is free. You do not pay any fees.",[2328,4966,4432],{"id":4967},"privacy-4",[15,4969,4970,4972],{},[50,4971,4615],{}," operation only communicates with the node and doesn't leave any traces in the blockchain. Node would know that particular IP has been interested in given asset.",[767,4974,4976],{"id":4975},"sending-assets","Sending assets",[15,4978,4979,4980,4983,4984,522,4986,4988],{},"Asset can be sent using regular ",[50,4981,4982],{},"send"," command. The only difference from regular BEAM transaction is the ",[50,4985,4553],{},[50,4987,4541],{}," parameters.",[127,4990,4993],{"className":4991,"code":4992,"language":132},[130],".\u002Fbeam-wallet send -n 127.0.0.1:10000 --pass 1 -r 1ec08b72ea25cd471ec37f9088a1ae0dcb8f4526eff3b8ab38f8e23901e2adf48a2 --amount 5 --asset_id 1 --enable_assets\n",[50,4994,4992],{"__ignoreMap":135},[2328,4996,4626],{"id":4997},"limits-4",[15,4999,5000],{},"Maximum amount for a single send transaction is $$2^{64}-1$$ asset nth units.",[2328,5002,5004],{"id":5003},"enable-flag","Enable flag",[15,5006,5007,5008,5010,5011,4525],{},"Both sender and receiver should specify ",[50,5009,4541],{}," flag in command line otherwise transaction would fail with the ",[50,5012,4534],{},[2328,5014,4595],{"id":5015},"lock-period-4",[15,5017,5018,5019,4525],{},"Asset cannot be sent to non-owner during the lock period. Transaction would be rejected by the receiving party with the ",[50,5020,5021],{},"AssetLocked (34)",[2328,5023,4432],{"id":5024},"privacy-5",[15,5026,5027],{},"Send transaction doesn't refresh asset info. Asset ID is hidden during the send transaction though it is visible that the transaction is performed on some asset. General Mimblewimble rules apply to the transaction. Amount, sender and receiver are not disclosed.",[767,5029,5031],{"id":5030},"receiving-assets","Receiving assets",[15,5033,5034],{},"Process of receiving assets is mostly identical to the receiving of regular BEAM.",[2328,5036,5004],{"id":5037},"enable-flag-1",[15,5039,5040,5041,5044,5045,4525],{},"CLI\u002FAPI receives assets automatically if it is running (listens) with the ",[50,5042,5043],{},"--assets_enable"," option. If assets are not enabled all incoming asset transaction would be rejected with the ",[50,5046,4534],{},[2328,5048,4595],{"id":5049},"lock-period-5",[15,5051,5052,5053,4525],{},"Asset cannot be received by non-owner during the lock period. Transaction would be rejected by the receiving party with the ",[50,5054,5021],{},[2328,5056,4432],{"id":5057},"privacy-6",[15,5059,5060],{},"Receive operation does not refresh asset info if there are any unspent UTXOs of the asset being received in the wallet. If there are no unspent UTXOs asset info might be refreshed if wallet doesn't have info about the asset (first receive) or info is older than the lock period duration.",[15,5062,5063],{},"Asset ID is hidden during the receive transaction though it is visible that the transaction is performed on some asset. General Mimblewimble rules apply to the transaction. Amount, sender and receiver are not disclosed.",{"title":135,"searchDepth":170,"depth":170,"links":5065},[5066,5076,5085,5086,5087,5088,5089,5090],{"id":2807,"depth":170,"text":2808,"children":5067},[5068,5069,5070,5071,5072,5073,5074,5075],{"id":4501,"depth":180,"text":4502},{"id":4557,"depth":180,"text":4558},{"id":4564,"depth":180,"text":4565},{"id":4577,"depth":180,"text":4578},{"id":4604,"depth":180,"text":4605},{"id":4625,"depth":180,"text":4626},{"id":4632,"depth":180,"text":4595},{"id":4656,"depth":180,"text":4657},{"id":4666,"depth":170,"text":4667,"children":5077},[5078,5079,5080,5081,5082,5083,5084],{"id":4670,"depth":180,"text":4671},{"id":4692,"depth":180,"text":4558},{"id":4702,"depth":180,"text":4703},{"id":4718,"depth":180,"text":4578},{"id":4731,"depth":180,"text":4732},{"id":4431,"depth":180,"text":4432},{"id":4745,"depth":180,"text":4746},{"id":4752,"depth":170,"text":4753},{"id":4814,"depth":170,"text":4815},{"id":4867,"depth":170,"text":4650},{"id":4923,"depth":170,"text":4924},{"id":4975,"depth":170,"text":4976},{"id":5030,"depth":170,"text":5031},"This documents describes CLI Confidential Assets workflow.",{},"\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002Freadme",{"title":3828,"description":5091},"docs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002FREADME","5077VYxLxRwxJ-TZNBKtEhZ4wtBuZ1vZPwQ-rA9E_Ik",{"id":5098,"title":5099,"body":5100,"description":5304,"extension":741,"image":742,"meta":5305,"navTitle":742,"navigation":744,"path":5306,"seo":5307,"stem":5308,"__hash__":5309},"docs\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002Fasset-metadata-descriptor.md","Asset Metadata Descriptor",{"type":8,"value":5101,"toc":5296},[5102,5104,5108,5111,5145,5149,5152,5160,5163,5167,5215,5218,5272,5276,5281,5286,5291],[11,5103,5099],{"id":4713},[767,5105,5107],{"id":5106},"requirements","Requirements",[15,5109,5110],{},"Asset meta is a byte buffer associated with the asset and stored on chain.",[87,5112,5113,5116,5126,5139,5142],{},[33,5114,5115],{},"Asset metadata should be an UTF-8 string",[33,5117,5118,5119,5122,5123],{},"Asset metadata should be serialized as a simple ",[50,5120,5121],{},"name=value"," set of pairs, delimited with ",[50,5124,5125],{},";",[33,5127,4251,5128,5131,5132,5135,5136,5138],{},[50,5129,5130],{},"keyN=valueN;"," sequence must be preceded with ",[50,5133,5134],{},"STD:"," prefix, there is no need for ",[50,5137,5125],{}," at the sequence end",[33,5140,5141],{},"The total size of the metadata cannot exceed 16 Kbytes (16,384 bytes)",[33,5143,5144],{},"Every description should be in English",[767,5146,5148],{"id":5147},"properties","Properties",[15,5150,5151],{},"Asset metadata has 2 groups of properties:",[87,5153,5154,5157],{},[33,5155,5156],{},"Standard properties",[33,5158,5159],{},"Optional properties",[15,5161,5162],{},"Both types of properties are immutable and can't be changed after the asset is created. Therefore, double-checking the values before starting the asset registration is strongly recommended",[25,5164,5166],{"id":5165},"required-properties","Required properties:",[87,5168,5169,5178,5187,5197,5206],{},[33,5170,5171,5174,5175],{},[50,5172,5173],{},"SCH_VER="," metadata schema version currently must be ",[50,5176,5177],{},"1",[33,5179,5180,5183,5184],{},[50,5181,5182],{},"N="," human-readable asset name, for example ",[50,5185,5186],{},"Beam Coin",[33,5188,5189,5192,5193,5196],{},[50,5190,5191],{},"SN="," human-readable short name\u002Fasset code, for example ",[50,5194,5195],{},"BEAM",". Length should not exceed 6 characters",[33,5198,5199,5202,5203],{},[50,5200,5201],{},"UN="," human-readable asset unit name, for example ",[50,5204,5205],{},"Beam",[33,5207,5208,5211,5212],{},[50,5209,5210],{},"NTHUN="," human-readable smallest asset unit name (nth-unit name), for example ",[50,5213,5214],{},"Groth",[25,5216,5159],{"id":5217},"optional-properties",[87,5219,5220,5230,5236,5242,5248,5254,5260,5266],{},[33,5221,5222,5225,5226,5229],{},[50,5223,5224],{},"NTH_RATIO="," integer that represents the ratio of the smallest asset unit to regular unit. If omitted default value of ",[50,5227,5228],{},"100000000"," is used",[33,5231,5232,5235],{},[50,5233,5234],{},"OPT_SHORT_DESC="," an one-liner, should not exceed 128 characters",[33,5237,5238,5241],{},[50,5239,5240],{},"OPT_LONG_DESC="," a paragraph, should not exceed 1024 characters",[33,5243,5244,5247],{},[50,5245,5246],{},"OPT_SITE_URL="," URL of the asset website",[33,5249,5250,5253],{},[50,5251,5252],{},"OPT_PDF_URL="," URL for the description paper",[33,5255,5256,5259],{},[50,5257,5258],{},"OPT_FAVICON_URL="," URL of the favicon",[33,5261,5262,5265],{},[50,5263,5264],{},"OPT_LOGO_URL="," URL of the logo in SVG vector format",[33,5267,5268,5271],{},[50,5269,5270],{},"OPT_COLOR="," color in the hex format (#FF00FF for example) to be used by the UI to display this asset. If not specified default color would be generated. Currently default colors are based on the asset id",[767,5273,5275],{"id":5274},"examples","Examples",[87,5277,5278],{},[33,5279,5280],{},"with required properties only:",[15,5282,5283],{},[50,5284,5285],{},"--asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth\"",[87,5287,5288],{},[33,5289,5290],{},"with required and optional properties:",[15,5292,5293],{},[50,5294,5295],{},"--asset_meta \"STD:SCH_VER=1;N=Beam Coin;SN=BEAM;UN=Beam;NTHUN=Groth;NTH_RATIO=1000;OPT_SHORT_DESC=Off with their heads!;OPT_LONG_DESC=The fact that this catch phrase ... this story remains a part of popular culture.;OPT_SITE_URL=https:\u002F\u002F***\u002F*;OPT_PDF_URL=https:\u002F\u002F***;OPT_FAVICON_URL=https:\u002F\u002F***\u002F;OPT_LOGO_URL=https:\u002F\u002F***;OPT_COLOR=#FF00FF\" --fee 100000 --enable_assets",{"title":135,"searchDepth":170,"depth":170,"links":5297},[5298,5299,5303],{"id":5106,"depth":170,"text":5107},{"id":5147,"depth":170,"text":5148,"children":5300},[5301,5302],{"id":5165,"depth":180,"text":5166},{"id":5217,"depth":180,"text":5159},{"id":5274,"depth":170,"text":5275},"This document's purpose is to specify the asset metadata, to enable 3rd party tools to consume and display the subset of asset-related information in a simple and well-standardized manner.",{},"\u002Fdocs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002Fasset-metadata-descriptor",{"title":5099,"description":5304},"docs\u002Fdev\u002Fconfidential-assets\u002Fusing-confidential-assets\u002Fasset-metadata-descriptor","fjj4B0ECR_k3hT9t_WLg6r6j26fx50vxRBHIlDnWeYY",{"id":5311,"title":5312,"body":5313,"description":5320,"extension":741,"image":742,"meta":5544,"navTitle":742,"navigation":744,"path":5545,"seo":5546,"stem":5547,"__hash__":5548},"docs\u002Fdocs\u002Fdev\u002Fdeveloping-beam-dapp-ui.md","Developing Beam DApp UI",{"type":8,"value":5314,"toc":5538},[5315,5318,5321,5324,5327,5331,5353,5360,5363,5366,5372,5375,5382,5386,5393,5396,5409,5412,5418,5421,5424,5431,5435,5438,5444,5451,5455,5458,5461,5466,5474,5479,5495,5500,5503,5509,5516,5527,5535],[11,5316,5312],{"id":5317},"developing-beam-dapp-ui",[15,5319,5320],{},"Most of Beam Decentralized Applications include a front end component which can run within the Beam Wallet or as a standalone website that connects to Beam Web Wallet.",[15,5322,5323],{},"These front end components are usually implemented using standard Web Frameworks such as React or Vue (or any other). The communication with the smart contract that is deployed on chain is handled through the Application Shader, which is provided as a Web Assembly component embedded within the web application.",[15,5325,5326],{},"In this tutorial we will review how to set up the development environment for building Beam DApps using the Desktop Wallet",[25,5328,5330],{"id":5329},"configure-the-testapp-in-the-wallet","Configure the 'testapp' in the wallet",[30,5332,5333,5345],{},[33,5334,5335,5336,5340,5342,5344],{},"Download and install ",[19,5337,5339],{"href":5338},"\u002Fdownloads\u002Fdappnet","Beam Desktop wallet",[42,5341],{},[42,5343],{},"\nWe recommend using DAPPNET (the testing network created especially for testing dapps), as it is the most convenient for this purpose. You will also need to get some DAPPNET Beam to pay transaction fees, which can be done using the Faucet application you can find in the built in DApp Store.\\",[33,5346,5347,5348,5350,5352],{},"Find the location of your Beam Wallet data folder",[42,5349],{},[42,5351],{},"\nIn the settings screen of the wallet, open the 'Troubleshooting' section. It will show you the location of your wallet folder on your platform",[2280,5354,5355,5358],{},[2283,5356],{"src":5357,"alt":135},".gitbook\u002Fassets\u002Fimage (14).png",[2287,5359],{},[15,5361,5362],{},"3. Open the folder and locate the settings.ini file",[15,5364,5365],{},"Edit the file and add the following section:",[127,5367,5370],{"className":5368,"code":5369,"language":132},[130],"[devapp]\nname=testapp\nurl=http:\u002F\u002F127.0.0.1:13666\u002Findex.html\n",[50,5371,5369],{"__ignoreMap":135},[15,5373,5374],{},"Restart the Desktop Wallet. Now in the DApp Store screen you will see the placeholder for the test app.",[2280,5376,5377,5380],{},[2283,5378],{"src":5379,"alt":135},".gitbook\u002Fassets\u002Fimage (12).png",[2287,5381],{},[25,5383,5385],{"id":5384},"running-the-application","Running the application",[15,5387,5388,5389],{},"For this section we assume that contract is already deployed on the blockchain and that application shader assembly is present. As an example we will use the BANS application that can be seen here: ",[19,5390,5391],{"href":5391,"rel":5392},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbans",[112],[15,5394,5395],{},"In order to run this application you will need the following pre-requisutes:",[30,5397,5398,5406],{},[33,5399,5400,5405],{},[19,5401,5404],{"href":5402,"rel":5403},"https:\u002F\u002Fnodejs.org\u002Fen\u002F",[112],"nodejs ","for your platform",[33,5407,5408],{},"yarn (can be installed with 'npm install --global yarn', once you install nodejs)",[15,5410,5411],{},"Now change directory to where you have cloned the BANS repository and run:",[127,5413,5416],{"className":5414,"code":5415,"language":132},[130],"yarn install\nyarn start\n",[50,5417,5415],{"__ignoreMap":135},[15,5419,5420],{},"If any questions are asked during installation just chose default answers this should work.",[15,5422,5423],{},"Once the local development server is running, you can launch the 'testapp' in the wallet. This will show you the BANS screen",[2280,5425,5426,5429],{},[2283,5427],{"src":5428,"alt":135},".gitbook\u002Fassets\u002Fimage (20).png",[2287,5430],{},[25,5432,5434],{"id":5433},"using-the-developer-console","Using the Developer Console",[15,5436,5437],{},"During application development, it is useful to be able to see the developer console, as you would in a regular browser. Beam Desktop Wallet provides this option when launched with a flag:",[127,5439,5442],{"className":5440,"code":5441,"language":132},[130],"--remote-debugging-port=20000\n",[50,5443,5441],{"__ignoreMap":135},[15,5445,5446,5447],{},"After you relaunch the wallet with this flag, you can open a regular web browser and navigate to: ",[19,5448,5449],{"href":5449,"rel":5450},"http:\u002F\u002Flocalhost:20000\u002F",[112],[25,5452,5454],{"id":5453},"packaging-into-dapp-file","Packaging into .dapp file",[15,5456,5457],{},"In order to distribute the application as a stand alone archive in should be packaged into a .dapp file",[15,5459,5460],{},"This can be done following the steps below:",[30,5462,5463],{},[33,5464,5465],{},"Create the following folder structure",[87,5467,5468,5471],{},[33,5469,5470],{},"Create an empty folder, use your dapp name for simplicity",[33,5472,5473],{},"Inside this folder create another empty folder called 'app'",[30,5475,5476],{"start":170},[33,5477,5478],{},"Build your application",[15,5480,5481,5482,5485,5486,5489,5490,5494],{},"Run ",[50,5483,5484],{},"yarn build","\nThis will create an ",[50,5487,5488],{},"html"," folder (if you are using the React template as provided by beam here (",[19,5491,5492],{"href":5492,"rel":5493},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam-dapp-react",[112],")\nCopy the contents of the build folder (in our case 'html') into the app folder created in step 1.",[30,5496,5497],{"start":180},[33,5498,5499],{},"Create manifest file",[15,5501,5502],{},"The manifest file contains the required metadata for your application that will be parsed and presented by the Beam Wallet during dApp installation.",[127,5504,5507],{"className":5505,"code":5506,"language":132},[130],"{\n   \"name\":  \"\",   \u002F\u002Frequired, max length 30 characters\n   \"description\":  \"\", \u002F\u002Frequired, max length 1024 characters\n   \"url\":  \"localapp\u002Fapp\u002Findex.html\", \u002F\u002Frequired\n   \"version\":  \"1.1.17\", \u002F\u002Frequired\n   \"api_version\":  \"7.0\", \u002F\u002Frequired, max length 10 characters \n   \"min_api_version\":  \"7.0\", \u002F\u002Frequired, max length 10 characters\n   \"icon\":  \"localapp\u002Fapp\u002Flogo.svg\", \u002F\u002Frequired, max size 10240 byte. SVG files only\n   \"guid\":  \"d353352eb6a94618ac0a8ec7b29ca7bb\" \u002F\u002Frequired\n}\n",[50,5508,5506],{"__ignoreMap":135},[15,5510,5511,5512,5515],{},"This file should be called ",[104,5513,5514],{},"manifest.json"," and copied into the same folder as the 'app' folder created above",[5517,5518,5519],"blockquote",{},[15,5520,5521,5522,5526],{},"TIP: To generate the guid you can use online GUID generators like: ",[19,5523,5524],{"href":5524,"rel":5525},"https:\u002F\u002Fwww.guidgenerator.com\u002Fonline-guid-generator.aspx",[112],"\nJust remember to remove the checkbox from the 'hiphens' option",[30,5528,5529,5532],{"start":188},[33,5530,5531],{},"Zip the top application folder (the one that has the manifest and the 'app' folder inside of it into a .zip archive",[33,5533,5534],{},"Rename the .zip file to .dapp",[15,5536,5537],{},"You can now test the local installation by using the 'Install DApp from file' option in the Desktop Wallet DApp Store",{"title":135,"searchDepth":170,"depth":170,"links":5539},[5540,5541,5542,5543],{"id":5329,"depth":180,"text":5330},{"id":5384,"depth":180,"text":5385},{"id":5433,"depth":180,"text":5434},{"id":5453,"depth":180,"text":5454},{},"\u002Fdocs\u002Fdev\u002Fdeveloping-beam-dapp-ui",{"title":5312,"description":5320},"docs\u002Fdev\u002Fdeveloping-beam-dapp-ui","66JLYCQQc-B9GEQmziZ4oGoeQ2fK5AqQZJENcLI_XNk",{"id":5550,"title":5551,"body":5552,"description":5559,"extension":741,"image":742,"meta":5562,"navTitle":742,"navigation":744,"path":5563,"seo":5564,"stem":5565,"__hash__":5566},"docs\u002Fdocs\u002Fdev\u002Fguidelines\u002Fcoding-guidelines.md","Coding guidelines",{"type":8,"value":5553,"toc":5560},[5554,5557],[11,5555,5551],{"id":5556},"coding-guidelines",[15,5558,5559],{},"Read in Beam wiki contributor guidelines about upcoming coding guidelines for C++, Angular\u002FJS. This would be a good section to have them in.",{"title":135,"searchDepth":170,"depth":170,"links":5561},[],{},"\u002Fdocs\u002Fdev\u002Fguidelines\u002Fcoding-guidelines",{"title":5551,"description":5559},"docs\u002Fdev\u002Fguidelines\u002Fcoding-guidelines","V5WnM-3OX9kjHNLOwGydVX3FB3j1S0SbJeT36mMH8kk",{"id":5568,"title":5569,"body":5570,"description":5577,"extension":741,"image":742,"meta":5580,"navTitle":742,"navigation":744,"path":5581,"seo":5582,"stem":5583,"__hash__":5584},"docs\u002Fdocs\u002Fdev\u002Fguidelines\u002Funtitled.md","Contributor guidelines",{"type":8,"value":5571,"toc":5578},[5572,5575],[11,5573,5569],{"id":5574},"contributor-guidelines",[15,5576,5577],{},"Information on how",{"title":135,"searchDepth":170,"depth":170,"links":5579},[],{},"\u002Fdocs\u002Fdev\u002Fguidelines\u002Funtitled",{"title":5569,"description":5577},"docs\u002Fdev\u002Fguidelines\u002Funtitled","E31h2AhTnUPnT9LfkA8DOkaBzAms80-78KvVI5zVUvg",{"id":5586,"title":813,"body":5587,"description":6384,"extension":741,"image":742,"meta":6385,"navTitle":742,"navigation":744,"path":6386,"seo":6387,"stem":6388,"__hash__":6389},"docs\u002Fdocs\u002Fdev\u002Fguides\u002Fbuilding-beam.md",{"type":8,"value":5588,"toc":6362},[5589,5592,5605,5609,5612,5668,5672,5676,5679,5685,5689,5692,5698,5702,5705,5725,5731,5741,5745,5752,5868,5872,5879,5938,5942,5946,5950,5963,5993,5997,6022,6026,6029,6036,6054,6057,6075,6079,6083,6094,6129,6133,6143,6169,6173,6176,6181,6198,6201,6206,6223,6227],[11,5590,813],{"id":5591},"building-beam",[15,5593,5594,5595,5600,5601,5604],{},"This document will serve as a guide for building Beam and BeamUI projects. Users have the option to download the binaries directly from ",[19,5596,5599],{"href":5597,"rel":5598},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam",[112],"GitHub",", however, for this walkthrough, users must have ",[104,5602,5603],{},"some"," technical knowledge, including basic knowledge of the Command-Line.",[767,5606,5608],{"id":5607},"things-youll-need","Things you'll need",[15,5610,5611],{},"To avoid any issues, have the following installed on your machine before starting your build:",[30,5613,5614,5626,5636,5646,5658],{},[33,5615,5616,5617,5624],{},"The latest version of ",[19,5618,5621],{"href":5619,"rel":5620},"https:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002Fv2\u002FGetting-Started-Installing-Git",[112],[104,5622,5623],{},"Git",[104,5625,599],{},[33,5627,5628,5635],{},[19,5629,5632],{"href":5630,"rel":5631},"https:\u002F\u002Fcmake.org\u002Fdownload\u002F",[112],[104,5633,5634],{},"CMake"," (version 3.13 and newer to generate the build environment).",[33,5637,5638,5645],{},[19,5639,5642],{"href":5640,"rel":5641},"https:\u002F\u002Fwww.boost.org\u002Fusers\u002Fhistory\u002Fversion_1_66_0.html",[112],[104,5643,5644],{},"Boost library"," (version 1.66 and newer_)._",[33,5647,5648,599],{},[19,5649,5652,107,5655],{"href":5650,"rel":5651},"https:\u002F\u002Fwww.openssl.org\u002Fsource\u002F",[112],[104,5653,5654],{},"OpenSSL",[104,5656,5657],{},"Library",[33,5659,5660,5667],{},[19,5661,5664],{"href":5662,"rel":5663},"https:\u002F\u002Fvisualstudio.microsoft.com\u002Fvs\u002Folder-downloads\u002F",[112],[104,5665,5666],{},"Microsoft Visual Studio"," (2017 and newer; Windows users only).",[767,5669,5671],{"id":5670},"first-steps","First steps",[25,5673,5675],{"id":5674},"downloading-the-binaries","Downloading the binaries",[15,5677,5678],{},"Launch a terminal window and enter the following command:",[127,5680,5683],{"className":5681,"code":5682,"language":132},[130],"git clone https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam.git\n",[50,5684,5682],{"__ignoreMap":135},[25,5686,5688],{"id":5687},"creating-submodules","Creating submodules",[15,5690,5691],{},"As a prerequisite, Beam requires the creation of submodules before starting the build. To create submodules, launch your terminal window and enter the following commands:",[127,5693,5696],{"className":5694,"code":5695,"language":132},[130],"cd beam\ngit submodule update --init --recursive\n",[50,5697,5695],{"__ignoreMap":135},[25,5699,5701],{"id":5700},"branch-convention","Branch Convention",[15,5703,5704],{},"Beam is entirely open-source, and we encourage users interested in contributing or testing our tech to follow the Branch convention below to avoid any issues.",[30,5706,5707,5713,5719],{},[33,5708,5709,5712],{},[50,5710,5711],{},"Master"," branch is for development.",[33,5714,5715,5718],{},[50,5716,5717],{},"Testnet"," branch is a sandbox for users interested in testing Beam.",[33,5720,5721,5724],{},[50,5722,5723],{},"Mainnet"," branch is the most recent version of each Beam project.",[25,5726,5728,5730],{"id":5727},"cmake-options",[104,5729,5634],{}," Options",[15,5732,5733,5734,5736,5737,5740],{},"Beam uses ",[104,5735,5634],{}," to generate the build environment with several options for building the project. Refer to ",[50,5738,5739],{},"CMakeLists.txt"," file for more details.",[767,5742,5744],{"id":5743},"windows","Windows",[15,5746,5747,5748,5751],{},"This guide assumes you have the latest version ",[19,5749,5623],{"href":5619,"rel":5750},[112]," installed on your machine.",[30,5753,5754,5767,5783,5802,5811,5828],{},[33,5755,5756,5757,5759,5760,599],{},"Install ",[104,5758,5666],{}," with ",[19,5761,5764,5766],{"href":5762,"rel":5763},"https:\u002F\u002Fdocs.microsoft.com\u002Fen-us\u002Fcpp\u002Fbuild\u002Fcmake-projects-in-visual-studio?view=msvc-160#building-cmake-projects",[112],[104,5765,5634],{}," support",[33,5768,5769,5770,5775,5776,5779,5780,599],{},"Download and install the Boost ",[19,5771,5774],{"href":5772,"rel":5773},"https:\u002F\u002Fsourceforge.net\u002Fprojects\u002Fboost\u002Ffiles\u002Fboost-binaries\u002F1.68.0\u002Fboost_1_68_0-msvc-14.1-64.exe",[112],"prebuilt"," binaries, adding ",[50,5777,5778],{},"BOOST_ROOT"," to the ",[104,5781,5782],{},"Environment Variables",[33,5784,5785,5786,107,5788,5792,5793,5796,5797,5779,5800,599],{},"Download and install the ",[104,5787,5654],{},[19,5789,5774],{"href":5790,"rel":5791},"https:\u002F\u002Fslproweb.com\u002Fproducts\u002FWin32OpenSSL.html",[112]," binaries (",[50,5794,5795],{},"Win64 OpenSSL v1.1.0h"," for example). Add ",[50,5798,5799],{},"OPENSSL_ROOT_DIR",[104,5801,5782],{},[33,5803,5804,5805,5779,5808,599],{},"Add ",[50,5806,5807],{},"...\u002Fboost_1_68_0\u002Flib64-msvc-14.1",[104,5809,5810],{},"System Path",[33,5812,5813,5814,5817,5818,5821,5822,5824,5825,599],{},"Open project folder in ",[104,5815,5816],{},"Visual Studio",", select your target (",[50,5819,5820],{},"Release-x64"," for example, if you downloaded 64bit Boost and ",[104,5823,5654],{},") and select ",[50,5826,5827],{},"CMake -> Build All",[33,5829,5830,5831,5833,5836,5838,5839,5842,5843,5847,5848,5850,5851,5838,5853,5856,5857,5634,5860,5862,5863,2804],{},"Open cache folder:",[42,5832],{},[2283,5834],{"alt":135,"src":5835},"..\u002F.gitbook\u002Fassets\u002FScreen%20Shot%202021-11-28%20at%203.27.04%20PM.png",[42,5837],{},"For ",[104,5840,5841],{},"Visual Studio 2017"," users, go to ",[104,5844,5845],{},[45,5846,5634],{},"** > Cache > Open Cache Folder > ",[50,5849,5205],{},"**",[42,5852],{},[104,5854,5855],{},"Visual Studio 2019"," users**, Project > ",[45,5858,5859],{},"_",[45,5861,5859],{}," cache > Open in explorer** (the binaries can be found in ",[45,5864,5865],{},[50,5866,5867],{},"beam\u002F..., wallet\u002Fcli\u002F..., explorer\u002F... subfolders",[767,5869,5871],{"id":5870},"linux","Linux",[15,5873,5874,5875,5878],{},"Locate the downloaded Beam node and Command Line (CLI) wallet in the ",[50,5876,5877],{},"beam\u002Fwallet\u002Fcli"," folder.",[30,5880,5881,5925],{},[33,5882,5883,5884,5888,5889,5894,5896,5899,5900,5905,5906,5909,5910,5912,5913,5918,5919],{},"Clone the Beam binaries from ",[19,5885,5887],{"href":797,"rel":5886},[112],"Github"," by entering the following command:",[127,5890,5892],{"className":5891,"code":5682,"language":132},[130],[50,5893,5682],{"__ignoreMap":135},[42,5895],{},[45,5897,5898],{},"Please note",": The above command will clone the latest master branch. The master branch is where the Beam team develops upcoming versions of Beam. Users should select the appropriate ",[19,5901,5904],{"href":5902,"rel":5903},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fbranches",[112],"branch"," then ",[50,5907,5908],{},"git checkout"," after cloning the main Beam repository.",[42,5911],{},"To clone the ",[45,5914,5915],{},[50,5916,5917],{},"Double Doppler 4.0"," release branch, enter the following:",[127,5920,5923],{"className":5921,"code":5922,"language":132},[130],"cd beam\ngit checkout double_doppler_4.0RC\n",[50,5924,5922],{"__ignoreMap":135},[33,5926,5927,5928,5931,5932],{},"The standard tutorials for Building beam will create the latest Beam Masternet build (development version, development blockchain). Build the Testnet for testing and development or build the Mainnet for real-world blockchain utilization by editing the ",[50,5929,5930],{},"beam\u002FCMakeLists.txt"," file lines 151-157. Uncomment (remove the '#' sign) respective definitions for the version Beam you wish to build.",[127,5933,5936],{"className":5934,"code":5935,"language":132},[130],"# uncomment next line for testnet\n#set(BEAM_TESTNET TRUE)\n# uncomment next line for mainnet\n#set(BEAM_MAINNET TRUE)\n\n# uncomment next line for swap mainnet\n#set(SWAP_MAINNET TRUE)\n",[50,5937,5935],{"__ignoreMap":135},[767,5939,5941],{"id":5940},"ubuntu-and-desktop-server","Ubuntu and desktop server",[25,5943,5945],{"id":5944},"ubuntu-1804","Ubuntu  18.04",[2328,5947,5949],{"id":5948},"desktop","Desktop",[15,5951,5952,5953,5956,5957,522,5959,5962],{},"The instructions below are valid for a default ",[45,5954,5955],{},"Ubuntu 18.04.03 Desktop LTS install",". For older systems, verify that steps 1, 2 & 4 do not overwrite or conflict with more recent versions of ",[50,5958,5634],{},[50,5960,5961],{},"boost"," previously installed on your machine.",[30,5964,5965,5974,5984],{},[33,5966,5967,5968],{},"Install dependencies:",[127,5969,5972],{"className":5970,"code":5971,"language":132},[130],"sudo add-apt-repository ppa:mhier\u002Flibboost-latest\nsudo apt-get update && sudo apt-get upgrade\nsudo apt-get install g++-8 libssl-dev curl wget git make \nsudo apt-get install libgl1-mesa-dev zlib1g-dev libboost1.67-dev\n",[50,5973,5971],{"__ignoreMap":135},[33,5975,5756,5976,668,5978],{},[50,5977,5634],{},[127,5979,5982],{"className":5980,"code":5981,"language":132},[130],"wget https:\u002F\u002Fcmake.org\u002Ffiles\u002Fv3.13\u002Fcmake-3.13.0-Linux-x86_64.sh\nsudo sh .\u002Fcmake-3.13.0-Linux-x86_64.sh --skip-license --prefix=\u002Fusr\n",[50,5983,5981],{"__ignoreMap":135},[33,5985,5986,5987],{},"Find your Beam project folder, start the release build:",[127,5988,5991],{"className":5989,"code":5990,"language":132},[130],"export CC=gcc-8 && export CXX=g++-8\ncmake -DCMAKE_BUILD_TYPE=Release && make -j4\n",[50,5992,5990],{"__ignoreMap":135},[2328,5994,5996],{"id":5995},"server","Server",[30,5998,5999,6006,6015],{},[33,6000,5967,6001],{},[127,6002,6004],{"className":6003,"code":5971,"language":132},[130],[50,6005,5971],{"__ignoreMap":135},[33,6007,5756,6008,668,6010],{},[50,6009,5634],{},[127,6011,6013],{"className":6012,"code":5981,"language":132},[130],[50,6014,5981],{"__ignoreMap":135},[33,6016,5986,6017],{},[127,6018,6020],{"className":6019,"code":5990,"language":132},[130],[50,6021,5990],{"__ignoreMap":135},[25,6023,6025],{"id":6024},"ubuntu-1910","Ubuntu 19.10",[2328,6027,5949],{"id":6028},"desktop-1",[15,6030,6031,6032,6035],{},"Instructions below are valid for a minimal ",[45,6033,6034],{},"Ubuntu 19.10 Desktop install"," (\"update during install\" option enabled).",[30,6037,6038,6046],{},[33,6039,5967,6040],{},[127,6041,6044],{"className":6042,"code":6043,"language":132},[130],"sudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev\nsudo apt-get install libssl-dev \n",[50,6045,6043],{"__ignoreMap":135},[33,6047,5986,6048],{},[127,6049,6052],{"className":6050,"code":6051,"language":132},[130],"cmake -DCMAKE_BUILD_TYPE=Release . && make -j4\n",[50,6053,6051],{"__ignoreMap":135},[2328,6055,5996],{"id":6056},"server-1",[30,6058,6059,6068],{},[33,6060,6061,6062],{},"Install dependencies",[127,6063,6066],{"className":6064,"code":6065,"language":132},[130],"sudo apt-get update && sudo apt-get upgrade\nsudo apt-get install g++ git make cmake libboost-all-dev zlib1g-dev\nsudo apt-get install libssl-dev\n",[50,6067,6065],{"__ignoreMap":135},[33,6069,5986,6070],{},[127,6071,6073],{"className":6072,"code":6051,"language":132},[130],[50,6074,6051],{"__ignoreMap":135},[767,6076,6078],{"id":6077},"centos","CentOS",[25,6080,6082],{"id":6081},"centos-70","CentOS 7.0",[15,6084,5952,6085,6088,6089,6091,6092,5962],{},[45,6086,6087],{},"CentOS 7.0-1908 minimal install",". For older systems, verify that steps two and three do not overwrite or conflict with more recent versions of ",[50,6090,5634],{},"and ",[50,6093,5961],{},[30,6095,6096,6104,6113,6122],{},[33,6097,5967,6098],{},[127,6099,6102],{"className":6100,"code":6101,"language":132},[130],"sudo yum update && shutdown -r now\nsudo yum install centos-release-scl yum-utils\nsudo yum-config-manager --enable rhel-server-rhscl-8-rpms\nsudo yum install devtoolset-8-gcc* \nscl enable devtoolset-8 bash\nsudo yum install git make wget openssl-devel\n",[50,6103,6101],{"__ignoreMap":135},[33,6105,6106,6107],{},"Build & install boost. This step could take considerable amount of time",[127,6108,6111],{"className":6109,"code":6110,"language":132},[130],"wget https:\u002F\u002Fdl.bintray.com\u002Fboostorg\u002Frelease\u002F1.66.0\u002Fsource\u002Fboost_1_66_0.tar.gz\ntar xzvf boost_1_66_0.tar.gz\ncd boost_1_66_0 && .\u002Fbootstrap.sh && sudo .\u002Fb2 install && cd ~\n",[50,6112,6110],{"__ignoreMap":135},[33,6114,5756,6115,668,6117],{},[50,6116,5634],{},[127,6118,6120],{"className":6119,"code":5981,"language":132},[130],[50,6121,5981],{"__ignoreMap":135},[33,6123,5986,6124],{},[127,6125,6127],{"className":6126,"code":6051,"language":132},[130],[50,6128,6051],{"__ignoreMap":135},[25,6130,6132],{"id":6131},"centos-80","CentOS 8.0",[15,6134,5952,6135,6138,6139,6091,6141,5962],{},[45,6136,6137],{},"CentOS 8.0-1905 minimal install",". For older systems, verify that step two does not overwrite or conflict with more recent versions of ",[50,6140,5634],{},[50,6142,5961],{},[30,6144,6145,6153,6162],{},[33,6146,5967,6147],{},[127,6148,6151],{"className":6149,"code":6150,"language":132},[130],"sudo dnf update\nsudo dnf config-manager --set-enabled PowerTools\nsudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel \nsudo dnf install openssl-devel tar wget \n",[50,6152,6150],{"__ignoreMap":135},[33,6154,5756,6155,668,6157],{},[50,6156,5634],{},[127,6158,6160],{"className":6159,"code":5981,"language":132},[130],[50,6161,5981],{"__ignoreMap":135},[33,6163,5986,6164],{},[127,6165,6167],{"className":6166,"code":6051,"language":132},[130],[50,6168,6051],{"__ignoreMap":135},[767,6170,6172],{"id":6171},"fedora","Fedora",[2328,6174,5949],{"id":6175},"desktop-2",[15,6177,5952,6178,599],{},[45,6179,6180],{},"Fedora 31-1.9 Workstation install",[30,6182,6183,6191],{},[33,6184,5967,6185],{},[127,6186,6189],{"className":6187,"code":6188,"language":132},[130],"sudo dnf update && shutdown -r now\nsudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel \nsudo dnf install zlib-devel openssl-devel tar \n",[50,6190,6188],{"__ignoreMap":135},[33,6192,5986,6193],{},[127,6194,6196],{"className":6195,"code":6051,"language":132},[130],[50,6197,6051],{"__ignoreMap":135},[2328,6199,5996],{"id":6200},"server-2",[15,6202,5952,6203,599],{},[45,6204,6205],{},"Fedora 31-1.9 Headless Server install",[30,6207,6208,6216],{},[33,6209,5967,6210],{},[127,6211,6214],{"className":6212,"code":6213,"language":132},[130],"sudo dnf update && shutdown -r now\nsudo dnf install git make cmake gcc-c++ libstdc++-static boost-devel \nsudo dnf install zlib-devel openssl-devel tar\n",[50,6215,6213],{"__ignoreMap":135},[33,6217,5986,6218],{},[127,6219,6221],{"className":6220,"code":6051,"language":132},[130],[50,6222,6051],{"__ignoreMap":135},[767,6224,6226],{"id":6225},"macos","MacOS",[30,6228,6229,6270,6281,6290,6304,6319,6328,6336,6353],{},[33,6230,5883,6231,668,6234,6239,6241,6244,6245,5912,6247,6250,6251,6257,6259,6260,6263,6264],{},[19,6232,5887],{"href":797,"rel":6233},[112],[127,6235,6237],{"className":6236,"code":5682,"language":132},[130],[50,6238,5682],{"__ignoreMap":135},[42,6240],{},[45,6242,6243],{},"Please note:"," The Git command above will clone the latest master branch. The master branch is where the Beam team develops upcoming versions of the Beam.",[42,6246],{},[50,6248,6249],{},"mainnet",", enter the following command:",[127,6252,6255],{"className":6253,"code":6254,"language":132},[130],"git clone --branch mainnet https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam.git\n",[50,6256,6254],{"__ignoreMap":135},[42,6258],{},"To clone the Beam ",[50,6261,6262],{},"testnet",", use:",[127,6265,6268],{"className":6266,"code":6267,"language":132},[130],"git clone --branch testnet https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam.git\n",[50,6269,6267],{"__ignoreMap":135},[33,6271,6272,107,6277,6280],{},[19,6273,6276],{"href":6274,"rel":6275},"https:\u002F\u002Fdocs.brew.sh\u002FInstallation",[112],"Install",[50,6278,6279],{},"Brew"," Package Manager.",[33,6282,6283,6284],{},"To install all necessary packages, enter:",[127,6285,6288],{"className":6286,"code":6287,"language":132},[130],"brew install openssl cmake\n",[50,6289,6287],{"__ignoreMap":135},[33,6291,6292,6293,6295,6296,668,6298],{},"Remove any existing ",[50,6294,6279],{}," installations of ",[50,6297,5961],{},[127,6299,6302],{"className":6300,"code":6301,"language":132},[130],"brew uninstall --ignore-dependencies boost\n",[50,6303,6301],{"__ignoreMap":135},[33,6305,6306,6310,6311,668,6313],{},[19,6307,6309],{"href":6274,"rel":6308},[112],"Download"," and install a compatible version of ",[50,6312,5961],{},[127,6314,6317],{"className":6315,"code":6316,"language":132},[130],"curl -O https:\u002F\u002Fraw.githubusercontent.com\u002FHomebrew\u002Fhomebrew-core\u002F5da5895add2f6b9320d654dd844d4827f6876c8b\u002FFormula\u002Fboost.rb\nbrew install .\u002Fboost.rb\n",[50,6318,6316],{"__ignoreMap":135},[33,6320,6321,6322],{},"To set your Environment Variables, enter:",[127,6323,6326],{"className":6324,"code":6325,"language":132},[130],"- export OPENSSL_ROOT_DIR=\"\u002Fusr\u002Flocal\u002Fopt\u002Fopenssl@1.1\"\n",[50,6327,6325],{"__ignoreMap":135},[33,6329,6330,6331],{},"Find your Beam project folder, then enter:",[127,6332,6334],{"className":6333,"code":6051,"language":132},[130],[50,6335,6051],{"__ignoreMap":135},[33,6337,6338,6339,6342,6343,6346,6347],{},"Use ",[50,6340,6341],{},"cpack"," to get ",[50,6344,6345],{},".dmg file."," Find Beam project folder and then enter:",[127,6348,6351],{"className":6349,"code":6350,"language":132},[130],"cpack\n",[50,6352,6350],{"__ignoreMap":135},[33,6354,6355,6356,522,6358,6361],{},"Locate the completed Beam node in the ",[50,6357,5877],{},[50,6359,6360],{},"beam\u002Fexplorer"," subfolders",{"title":135,"searchDepth":170,"depth":170,"links":6363},[6364,6365,6372,6373,6374,6378,6382,6383],{"id":5607,"depth":170,"text":5608},{"id":5670,"depth":170,"text":5671,"children":6366},[6367,6368,6369,6370],{"id":5674,"depth":180,"text":5675},{"id":5687,"depth":180,"text":5688},{"id":5700,"depth":180,"text":5701},{"id":5727,"depth":180,"text":6371},"CMake Options",{"id":5743,"depth":170,"text":5744},{"id":5870,"depth":170,"text":5871},{"id":5940,"depth":170,"text":5941,"children":6375},[6376,6377],{"id":5944,"depth":180,"text":5945},{"id":6024,"depth":180,"text":6025},{"id":6077,"depth":170,"text":6078,"children":6379},[6380,6381],{"id":6081,"depth":180,"text":6082},{"id":6131,"depth":180,"text":6132},{"id":6171,"depth":170,"text":6172},{"id":6225,"depth":170,"text":6226},"This document will serve as a guide for building Beam and BeamUI projects. Users have the option to download the binaries directly from GitHub, however, for this walkthrough, users must have some technical knowledge, including basic knowledge of the Command-Line.",{},"\u002Fdocs\u002Fdev\u002Fguides\u002Fbuilding-beam",{"title":813,"description":6384},"docs\u002Fdev\u002Fguides\u002Fbuilding-beam","yf-nza06XYWJ2kuWMQFlD6YpAAfjdDWxdhY2Je0HRmM",{"id":6391,"title":6392,"body":6393,"description":6552,"extension":741,"image":742,"meta":6553,"navTitle":742,"navigation":744,"path":6554,"seo":6555,"stem":6556,"__hash__":6557},"docs\u002Fdocs\u002Fdev\u002Fguides\u002Fconsensus-rules.md","Beam Consensus Rules",{"type":8,"value":6394,"toc":6549},[6395,6398,6406,6409,6412,6416,6536,6543],[11,6396,6392],{"id":6397},"beam-consensus-rules",[15,6399,6400],{},[104,6401,6402,6405],{},[45,6403,6404],{},"WARNING:"," Used for development and testing only!",[15,6407,6408],{},"The following parameters allow to configuration of Consensus Rules in the Beam node and wallet.",[15,6410,6411],{},"Consensus Rules are for testing and development purposes only. Changing the consensus parameters changes the Rule Signature and breaks the node and wallet compatibility with the running Mainnet or Testnet servers.",[25,6413,6415],{"id":6414},"rules","Rules",[6417,6418,6419,6436],"table",{},[6420,6421,6422],"thead",{},[6423,6424,6425,6431],"tr",{},[6426,6427,6428],"th",{},[45,6429,6430],{},"Parameter",[6426,6432,6433],{},[45,6434,6435],{},"Description & Example",[6437,6438,6439,6448,6456,6464,6472,6480,6488,6496,6504,6512,6520,6528],"tbody",{},[6423,6440,6441,6445],{},[6442,6443,6444],"td",{},"EmissionValue0",[6442,6446,6447],{},"Initial coinbase emission in a single block (in Groth, 10^-8 of Beam)",[6423,6449,6450,6453],{},[6442,6451,6452],{},"EmissionDrop0",[6442,6454,6455],{},"Height of the last block that still has the initial emission. Emission drops by half in the next block. Default equals one year (assuming one block per minute).",[6423,6457,6458,6461],{},[6442,6459,6460],{},"EmissionDrop1",[6442,6462,6463],{},"Number of blocks in halving cycle (defaults to four years, assuming one block per minute).",[6423,6465,6466,6469],{},[6442,6467,6468],{},"MaturityCoinbase",[6442,6470,6471],{},"Number of blocks that should be mined (verified) before coinbase UTXO can be spent.",[6423,6473,6474,6477],{},[6442,6475,6476],{},"MaturityStd",[6442,6478,6479],{},"Number of blocks that should be mined (verified) before normal (non-coinbase) UTXO can be spent.",[6423,6481,6482,6485],{},[6442,6483,6484],{},"MaxBodySize",[6442,6486,6487],{},"Block body size (in bytes).",[6423,6489,6490,6493],{},[6442,6491,6492],{},"DesiredRate_s",[6442,6494,6495],{},"Target block rate (in seconds).",[6423,6497,6498,6501],{},[6442,6499,6500],{},"DifficultyReviewWindow",[6442,6502,6503],{},"Number of blocks in the window for the mining difficulty adjustment.",[6423,6505,6506,6509],{},[6442,6507,6508],{},"TimestampAheadThreshold_s",[6442,6510,6511],{},"Block timestamp tolerance (in seconds).",[6423,6513,6514,6517],{},[6442,6515,6516],{},"WindowForMedian",[6442,6518,6519],{},"Number of blocks considered in calculating the timestamp median.",[6423,6521,6522,6525],{},[6442,6523,6524],{},"AllowPublicUtxos",[6442,6526,6527],{},"Flag allowing regular (non-coinbase) UTXO to have non-confidential signature.",[6423,6529,6530,6533],{},[6442,6531,6532],{},"FakePoW",[6442,6534,6535],{},"Flag to disable verification of PoW. Mining is simulated by timer.",[15,6537,6538,6539,6542],{},"The sample below displays the corresponding ",[50,6540,6541],{},".cfg"," fie section:",[127,6544,6547],{"className":6545,"code":6546,"language":132},[130],"################################################################################\n# Rules configuration:\n################################################################################\n\n# initial coinbase emission in a single block\n# EmissionValue0=800000000\n\n# height of the last block that still has the initial emission, the drop is starting from the next block\n# EmissionDrop0=525600\n\n# Each such a cycle there's a new drop\n# EmissionDrop1=2102400\n\n# num of blocks before coinbase UTXO can be spent\n# MaturityCoinbase=240\n\n# num of blocks before non-coinbase UTXO can be spent\n# MaturityStd=0\n\n# Max block body size [bytes]\n# MaxBodySize=0x100000\n\n# Desired rate of generated blocks [seconds]\n# DesiredRate_s=60\n\n# num of blocks in the window for the mining difficulty adjustment\n# DifficultyReviewWindow=1440\n\n# Block timestamp tolerance [seconds]\n# TimestampAheadThreshold_s=7200\n\n# How many blocks are considered in calculating the timestamp median\n# WindowForMedian=25\n\n# set to allow regular (non-coinbase) UTXO to have non-confidential signature\n# AllowPublicUtxos=0\n\n# Don't verify PoW. Mining is simulated by the timer\n# FakePoW=0\n",[50,6548,6546],{"__ignoreMap":135},{"title":135,"searchDepth":170,"depth":170,"links":6550},[6551],{"id":6414,"depth":180,"text":6415},"WARNING: Used for development and testing only!",{},"\u002Fdocs\u002Fdev\u002Fguides\u002Fconsensus-rules",{"title":6392,"description":6552},"docs\u002Fdev\u002Fguides\u002Fconsensus-rules","17jJJ6UtBCHNoBiU8V-hx2yc002lyik9uQ62AFgOYDM",{"id":6559,"title":6560,"body":6561,"description":135,"extension":741,"image":742,"meta":6668,"navTitle":742,"navigation":744,"path":6669,"seo":6670,"stem":6671,"__hash__":6672},"docs\u002Fdocs\u002Fdev\u002Fguides\u002Funderstanding-beam-logs.md","Understanding Beam Logs",{"type":8,"value":6562,"toc":6662},[6563,6566,6570,6573,6577,6582,6618,6624,6628,6634,6637,6642,6645,6651],[11,6564,6560],{"id":6565},"understanding-beam-logs",[767,6567,6569],{"id":6568},"understanding-beam-logs-1","Understanding Beam logs",[15,6571,6572],{},"Beam logs are files that record the events that occur within the Beam software and the Beam network. These files contain vital information that is very helpful to Beam support if you encounter any technical difficulties.",[25,6574,6576],{"id":6575},"beam-log-locations","Beam Log Locations",[15,6578,6579],{},[104,6580,6581],{},"Find CLI wallet and Node logs in the same folder as the binaries.",[6417,6583,6584,6594],{},[6420,6585,6586],{},[6423,6587,6588,6591],{},[6426,6589,6590],{},"Operating System",[6426,6592,6593],{},"Desktop Wallet Log Location",[6437,6595,6596,6604,6611],{},[6423,6597,6598,6601],{},[6442,6599,6600],{},"Mac",[6442,6602,6603],{},"\u002FUsers\u002F{your_user_name}\u002FLibrary\u002FApplication Support\u002FBeam Wallet\u002F",[6423,6605,6606,6608],{},[6442,6607,5744],{},[6442,6609,6610],{},"\\Users\\{your_user_name}\\AppData\\Local\\Beam Wallet",[6423,6612,6613,6615],{},[6442,6614,5871],{},[6442,6616,6617],{},"\u002Fhome\u002F{your_user_name}\u002F.local\u002Fshare\u002FBeam Wallet",[15,6619,6620,6621],{},"For a complete list of file locations see ",[50,6622,6623],{},":ref: Files and Locations",[25,6625,6627],{"id":6626},"node-logs","Node Logs",[15,6629,6630,6631],{},"Each log starts with the Rules Signature. Rules Signature is the hash of the Consensus Rules and must be compatible to connect with your desired network. Consensus Rules for Testnet and Mainnet logs are different. View the relevant Rules Signature for each network here ",[50,6632,6633],{},":ref: rules_signature",[15,6635,6636],{},"Beam logs have a simple structure. The first field is the severity level, followed by a timestamp and log message:",[15,6638,6639],{},[104,6640,6641],{},"Log Severity +——————–+—————–+ | I | Info | +——————–+—————–+ | W | Warning | +——————–+—————–+ | E | Error | +——————–+—————–+ | D | Debug | +——————–+—————–+",[15,6643,6644],{},"The sample below shows the start of a new node:",[127,6646,6649],{"className":6647,"code":6648,"language":132},[130],"I 2018-12-31.16:48:58.838 Rules signature: 7e16d65b64ef2fbb\nI 2018-12-31.16:48:58.986 starting a node on 10000 port...\nI 2018-12-31.16:48:58.996 Node ID=5c8f92a1cfaee337\nI 2018-12-31.16:48:58.996 Initial Tip: 0-0000000000000000\nI 2018-12-31.16:48:58.996 Requesting block 0-0000000000000000\nI 2018-12-31.16:48:58.997 PI 0000000000000000--0.0.0.0 New\nI 2018-12-31.16:48:58.997 PI 0000000000000000--0.0.0.0 Address changed to 23.239.24.209:8201\nI 2018-12-31.16:48:58.999 stratum server listens to 0.0.0.0:10002\n",[50,6650,6648],{"__ignoreMap":135},[15,6652,6653,6654,6657,6658,6661],{},"In this case, the node connects to the first peer, ",[104,6655,6656],{},"23.239.24.209:8201",", and downloads the initial Tip at ",[104,6659,6660],{},"height 0",". It then requests the matching block. In this specific example, the node also starts the Stratum server.",{"title":135,"searchDepth":170,"depth":170,"links":6663},[6664],{"id":6568,"depth":170,"text":6569,"children":6665},[6666,6667],{"id":6575,"depth":180,"text":6576},{"id":6626,"depth":180,"text":6627},{},"\u002Fdocs\u002Fdev\u002Fguides\u002Funderstanding-beam-logs",{"title":6560,"description":135},"docs\u002Fdev\u002Fguides\u002Funderstanding-beam-logs","VicQ2TgwsP2C2O5jhl8IO18KaSuoFcv1STCD2LvMPEc",{"id":6674,"title":6675,"body":6676,"description":6683,"extension":741,"image":742,"meta":6861,"navTitle":742,"navigation":744,"path":6862,"seo":6863,"stem":6864,"__hash__":6865},"docs\u002Fdocs\u002Fdev\u002Frunning-local-blockchain.md","Running local blockchain",{"type":8,"value":6677,"toc":6856},[6678,6681,6684,6688,6694,6698,6701,6707,6710,6713,6719,6722,6725,6730,6733,6738,6741,6745,6758,6761,6767,6778,6781,6786,6789,6796,6799,6806,6809,6812,6817,6820,6827,6830,6835,6838,6845,6848],[11,6679,6675],{"id":6680},"running-local-blockchain",[15,6682,6683],{},"In this tutorial we will explain how to run local blockchain. It will be extremely useful for testing your dapps locally, before deplying them to public networks",[25,6685,6687],{"id":6686},"download-node-and-wallet","Download node and wallet",[15,6689,6690,6691],{},"Create an empty folder (called dappnet in our examples) and download the binaries for the node and CLI wallet from ",[19,6692,6693],{"href":5338},"beam website",[25,6695,6697],{"id":6696},"initialize-wallet","Initialize wallet",[15,6699,6700],{},"First, let's change the wallet configuration file to make everything easy and seamless when we run it later. Edit the beam-wallet.cfg file and set the following flags:",[127,6702,6705],{"className":6703,"code":6704,"language":132},[130],"\n# General options:\n################################################################################\n\n# log level [info|debug|verbose]\nlog_level=debug\n\n# file log level [info|debug|verbose]\n# file_log_level=debug\n\n# old logs cleanup period (days)\n# log_cleanup_days=5\n\n################################################################################\n# Wallet options:\n################################################################################\n\n# password for the wallet\npass=123\n\n# phrase to generate secret key according to BIP-39.\n# seed_phrase=\n\n# address of node\nnode_addr=127.0.0.1:8100\n\n# path to wallet file\nwallet_path=wallet.db\n\nMaturity.Coinbase=0\n\n# command to execute [new_addr|send|receive|listen|init|info|export_miner_key|export_owner_key|generate_phrase]\n# command=listen\n\n\n",[50,6706,6704],{"__ignoreMap":135},[15,6708,6709],{},"Note the Maturity.Coinbase=0 flag. It means that you can spend coinbase rewards immediately (unlike the 60 block lockup in mainnet) It is useful for testing in a local environment, since you do not have to wait for your mined rewards to before available",[15,6711,6712],{},"Now let's move on to wallet initialization. Run",[15,6714,6715,6718],{},[50,6716,6717],{},"beam-wallet-dappnet.exe init","  (or .\u002Fbeam-wallet-dappnet on Mac)",[15,6720,6721],{},"Save the generated seed phase somewhere in a text file ( we might need it later)",[15,6723,6724],{},"Now print the owner key by running:",[15,6726,6727],{},[50,6728,6729],{},"beam-wallet-dappnet.exe export_owner_key",[15,6731,6732],{},"And last generate the mining key by running",[15,6734,6735],{},[50,6736,6737],{},"beam-wallet-dappnet.exe export_miner_key --subkey=1",[15,6739,6740],{},"Save both keys in the same file as the seed phrase",[25,6742,6744],{"id":6743},"initializing-the-node","Initializing the Node",[15,6746,6747,6748,6753,6754,6757],{},"Before we start configuring the node, download sample Beam treasury file ",[19,6749,6752],{"href":6750,"rel":6751},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fblob\u002Fmaster\u002Ftreasury.bin",[112],"treasury.bin",", and copy it to the same folder as the ",[50,6755,6756],{},"beam-node"," binary.",[15,6759,6760],{},"Now, open beam-node.cfg file in a text editor and set the following flags:",[127,6762,6765],{"className":6763,"code":6764,"language":132},[130],"################################################################################\n# General options:\n################################################################################\n\n# port to start server on\nport=8100\n\n# log level [info|debug|verbose]\nlog_level=debug\n\n# file log level [info|debug|verbose]\nfile_log_level=debug\n\n# old logs cleanup period (days)\n# log_cleanup_days=5\n\n################################################################################\n# Node options:\n################################################################################\n\n# node storage path\n# storage=node.db\n\n# nodes to connect to !!! MUST BE EMPTY !!!\n# peer=\n\n# port to start stratum server on\n# stratum_port=0\n\n# path to stratum server api keys file, and tls certificate and private key\n# stratum_secrets_path=.\n\n# Enforce re-synchronization (soft reset)\n# resync=0\n\n# Owner viewer key\nowner_key=\u003Cyour owner key>\n\n# Standalone miner key\nminer_key=\u003Cyour miner key>\n\n# password for keys\npass=123\n\n# Fork1 height\n# Fork1=\n\n# Path to treasury for testing\ntreasury_path=treasury.bin\n\n# Enables the node to produce blocks\nmining_threads=1\n\nMaturity.Coinbase=0\n\n\n",[50,6766,6764],{"__ignoreMap":135},[30,6768,6769,6772,6775],{},[33,6770,6771],{},"Make sure to set miner and owner keys to those generated by your wallet",[33,6773,6774],{},"Make sure peer list is empty (to avoid accidental connections to other nodes)",[33,6776,6777],{},"Check that mining_threads flag is set to 1",[15,6779,6780],{},"We are now ready to run the node using the command:",[15,6782,6783],{},[50,6784,6785],{},"beam-node-dappnet.exe",[15,6787,6788],{},"Sample output should look something like this",[2280,6790,6791,6794],{},[2283,6792],{"src":6793,"alt":135},".gitbook\u002Fassets\u002Fimage.png",[2287,6795],{},[15,6797,6798],{},"Wait for about 30 seconds to make sure new blocks are produced. A new block shoud appear every 15 seconds or so",[2280,6800,6801,6804],{},[2283,6802],{"src":6803,"alt":135},".gitbook\u002Fassets\u002Fimage (3).png",[2287,6805],{},[15,6807,6808],{},"Synchronizing the wallet",[15,6810,6811],{},"In another command line (or Terminal) window, run the CLI wallet with the following command:",[15,6813,6814],{},[50,6815,6816],{},"beam-wallet-dappnet.exe listen",[15,6818,6819],{},"This will synchronize the wallet state with the blockchain. Your output should read something like:",[2280,6821,6822,6825],{},[2283,6823],{"src":6824,"alt":135},".gitbook\u002Fassets\u002Fimage (24).png",[2287,6826],{},[15,6828,6829],{},"Stop the wallet (by clicking Ctrl + C) and check your current balance by running:",[15,6831,6832],{},[50,6833,6834],{},"beam-wallet-dappnet.exe info",[15,6836,6837],{},"You should see the mined BEAM coins in your wallet",[2280,6839,6840,6843],{},[2283,6841],{"src":6842,"alt":135},".gitbook\u002Fassets\u002Fimage (26).png",[2287,6844],{},[15,6846,6847],{},"You now have a local network!",[15,6849,6850,6851],{},"For a full reference on Beam CLI wallet see the ",[19,6852,6855],{"href":6853,"rel":6854},"https:\u002F\u002Fbeamx.gitbook.io\u002Fcli-guide\u002F",[112],"CLI Wallet Guide",{"title":135,"searchDepth":170,"depth":170,"links":6857},[6858,6859,6860],{"id":6686,"depth":180,"text":6687},{"id":6696,"depth":180,"text":6697},{"id":6743,"depth":180,"text":6744},{},"\u002Fdocs\u002Fdev\u002Frunning-local-blockchain",{"title":6675,"description":6683},"docs\u002Fdev\u002Frunning-local-blockchain","QYWhxcEI5ToT0_fQ51YWgWA3ZQjV4n9Fjv702dY2aIE",{"id":6867,"title":6868,"body":6869,"description":6876,"extension":741,"image":742,"meta":7048,"navTitle":742,"navigation":744,"path":7049,"seo":7050,"stem":7051,"__hash__":7052},"docs\u002Fdocs\u002Fdev\u002Fshader-sdk-mac.md","Shader SDK (MAC)",{"type":8,"value":6870,"toc":7042},[6871,6874,6877,6886,6888,6891,6894,6899,6902,6905,6911,6914,6919,6923,6938,6943,6946,6949,6957,6961,6966,6969,6974,6979,6985,6988,6993,6998,7003,7008,7013,7016,7020,7023,7028,7031,7036,7039],[11,6872,6868],{"id":6873},"shader-sdk-mac",[15,6875,6876],{},"In this tutorial we will show how to setup Beam Shader SDK on Mac OS",[15,6878,6879,6880,6885],{},"The Shader SDK's current version can be characterized as an ",[104,6881,6882],{},[45,6883,6884],{},"early developer preview",", with a high possibility of encountering unusual issues and bugs.",[25,6887,28],{"id":27},[15,6889,6890],{},"You will  need a Python 3.x installed and available in the path (check by typing 'python' in the command line)",[15,6892,6893],{},"In addition, you will need XCode Command line tools. The command to install those is:",[15,6895,6896],{},[50,6897,6898],{},"xcode-select --install",[15,6900,6901],{},"But please consult with official documentation for more details.",[15,6903,6904],{},"You will also need the following packages (I used brew to install those):",[15,6906,6907,6910],{},[50,6908,6909],{},"brew install openssl cmake ninja","\\",[15,6912,6913],{},"Also, set the OPENSSL_ROOT_DIR environment variable as follows:",[15,6915,6916],{},[50,6917,6918],{},"export OPENSSL_ROOT_DIR=\"\u002Fusr\u002Flocal\u002Fopt\u002Fopenssl@1.1\"",[25,6920,6922],{"id":6921},"building-shader-sdk","Building Shader SDK",[30,6924,6925,6932,6935],{},[33,6926,6927,6928],{},"Clone Shader SDK repository from here: ",[19,6929,6930],{"href":6930,"rel":6931},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fshader-sdk",[112],[33,6933,6934],{},"Open the Terminal application",[33,6936,6937],{},"Change directory to the location of the shader-sdk and run:",[15,6939,6940],{},[50,6941,6942],{},".\u002Fshade init",[15,6944,6945],{},"This will operation will install and build all the necessary components.",[15,6947,6948],{},"Here comes a small song and dance part that has to do with the fact that shader-sdk is still very raw",[30,6950,6951,6954],{},[33,6952,6953],{},"Inside the shader-sdk folder create a 'bin' folder",[33,6955,6956],{},"Copy shader-sdk\u002Fbuild\u002Fhost\u002Fbeam\u002Fbvm\u002Fsid_generator\u002Fgenerate-sid to the newly created bin folder",[25,6958,6960],{"id":6959},"creating-a-new-shader-project","Creating a new Shader Project",[30,6962,6963],{},[33,6964,6965],{},"Open a Terminal and create a new folder for your Shader project. We will use 'vault' in our example",[15,6967,6968],{},"2. Set the following environment variables to point to the location of you shader-sdk and wasi-sdk:",[15,6970,6971],{},[50,6972,6973],{},"export BEAM_SHADER_SDK=~\u002FCode\u002Fshader-sdk",[15,6975,6976],{},[50,6977,6978],{},"export WASI_SDK_PREFIX=~\u002FCode\u002Fshader-sdk\u002Fwasi-sdk-14.0",[15,6980,6981,6982],{},"3. Run the following command: ",[50,6983,6984],{},"shade create_project \u003Cproject name>",[15,6986,6987],{},"In our case:",[15,6989,6990],{},[50,6991,6992],{},"~\u002FCode\u002Fshader-sdk\u002Fshade create_project vault",[15,6994,6995],{},[50,6996,6997],{},"Here comes another issue. Your Mac is very likely to warn you about the fact that generate-sid application was not created by a certified developer",[15,6999,7000],{},[2283,7001],{"alt":135,"src":7002},".gitbook\u002Fassets\u002FScreen%20Shot%202022-11-19%20at%2014.27.00%20(1).png",[15,7004,7005],{},[50,7006,7007],{},"To avoid this you will need to allow running this script anyway from the Settings -> Security & Privacy dialogue and then rerunning the command",[15,7009,7010],{},[2283,7011],{"alt":135,"src":7012},".gitbook\u002Fassets\u002FScreen%20Shot%202022-11-19%20at%2014.27.55.png",[15,7014,7015],{},"This will initialize the structure of the Shader project",[25,7017,7019],{"id":7018},"building-the-shader-project","Building the Shader Project",[15,7021,7022],{},"Inside the project folder run the following command:",[15,7024,7025],{},[50,7026,7027],{},"cmake -G \"Ninja\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$WASI_SDK_PREFIX\u002Fshare\u002Fcmake\u002Fwasi-sdk.cmake -DCMAKE_SYSROOT=$WASI_SDK_PREFIX\u002Fshare\u002Fwasi-sysroot -DWASI_SDK_PREFIX=$WASI_SDK_PREFIX -DCMAKE_CXX_COMPILER_FORCED=True -DCMAKE_C_COMPILER_FORCED=True -DCMAKE_SYSTEM_NAME=\"WASI\"",[15,7029,7030],{},"Then run:",[15,7032,7033],{},[50,7034,7035],{},"ninja",[15,7037,7038],{},"And the .wasm files with compiled contracts will be generated in the \u002Fshaders folder",[15,7040,7041],{},"Now you are ready to start coding your Shader!",{"title":135,"searchDepth":170,"depth":170,"links":7043},[7044,7045,7046,7047],{"id":27,"depth":180,"text":28},{"id":6921,"depth":180,"text":6922},{"id":6959,"depth":180,"text":6960},{"id":7018,"depth":180,"text":7019},{},"\u002Fdocs\u002Fdev\u002Fshader-sdk-mac",{"title":6868,"description":6876},"docs\u002Fdev\u002Fshader-sdk-mac","XMfxUZidzh-ZQ0yT-lKWdtmBcwpdeAQGivkTIKtl4TE",{"id":7054,"title":7055,"body":7056,"description":7063,"extension":741,"image":742,"meta":7325,"navTitle":742,"navigation":744,"path":7326,"seo":7327,"stem":7328,"__hash__":7329},"docs\u002Fdocs\u002Fdev\u002Fshader-sdk-win.md","Shader SDK (WIN)",{"type":8,"value":7057,"toc":7319},[7058,7061,7064,7070,7072,7080,7093,7095,7116,7118,7125,7127,7136,7143,7153,7158,7163,7170,7180,7185,7192,7195,7205,7207,7218,7225,7246,7256,7263,7270,7277,7282,7285,7309,7316],[11,7059,7055],{"id":7060},"shader-sdk-win",[15,7062,7063],{},"This tutorial demonstrates How-to set up Beam Shader SDK on the Windows operating system.",[15,7065,6879,7066,6885],{},[104,7067,7068],{},[45,7069,6884],{},[25,7071,28],{"id":27},[15,7073,7074,7075,7079],{},"To follow along, make sure you have ",[19,7076,5666],{"href":7077,"rel":7078},"https:\u002F\u002Fvisualstudio.microsoft.com\u002F",[112]," installed. For this tutorial, I am using 2022 edition, but the community edition will work.",[15,7081,7082,7083,7088,7089,7092],{},"Additionally, ",[19,7084,7087],{"href":7085,"rel":7086},"https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F",[112],"Python 3.x"," must be installed and available in the systems path. Verify Python is installed by entering  ",[50,7090,7091],{},"python"," in the command line.",[25,7094,6922],{"id":6921},[30,7096,7097,7107,7110],{},[33,7098,7099,7105],{},[19,7100,7102],{"href":6930,"rel":7101},[112],[45,7103,7104],{},"Clone Shader SDK repository",[45,7106,599],{},[33,7108,7109],{},"Open Developer Command Prompt for VS. This can be done from either Tools Menu within the VS IDE or by finding an entry in the Start menu items",[33,7111,7112,7113],{},"Change directory to the location of the shader-sdk and run: ",[50,7114,7115],{},"shade init",[15,7117,6945],{},[2280,7119,7120,7123],{},[2283,7121],{"src":7122,"alt":135},".gitbook\u002Fassets\u002Fimage (8).png",[2287,7124],{},[25,7126,6960],{"id":6959},[30,7128,7129],{},[33,7130,7131,7132,7135],{},"Launch the Command Prompt, creating a new folder for your Shader project. We will use the ",[50,7133,7134],{},"vault"," folder for this tutorial:",[2280,7137,7138,7141],{},[2283,7139],{"src":7140,"alt":135},".gitbook\u002Fassets\u002Fimage (19).png",[2287,7142],{},[15,7144,7145,7146,522,7149,7152],{},"2. Locate ",[50,7147,7148],{},"shader-sdk",[50,7150,7151],{},"wasi-sdk","folders, and enter the following:",[15,7154,7155],{},[50,7156,7157],{},"set BEAM_SHADER_SDK=c:\\Code\\shader-sdk",[15,7159,7160],{},[50,7161,7162],{},"set WASI_SDK_PREFIX=C:\\Code\\shader-sdk\\wasi-sdk-14.0",[30,7164,7165],{"start":180},[33,7166,7167,7168,668],{},"To initialize the structure of your Shader, enter  ",[50,7169,6984],{},[15,7171,7172,7173,7176,7177,7179],{},"For our ",[50,7174,7175],{},"\u003Cproject name>",", use ",[50,7178,7134],{},", i.e.,:",[15,7181,7182],{},[50,7183,7184],{},"c:\\Code\\shader-sdk\\shade create_project vault",[2280,7186,7187,7190],{},[2283,7188],{"src":7189,"alt":135},".gitbook\u002Fassets\u002Fimage (4).png",[2287,7191],{},[15,7193,7194],{},"If initialized correctly, your Shader project structure should resemble the following:",[2280,7196,7197,7200],{},[2283,7198],{"src":7199,"alt":135},".gitbook\u002Fassets\u002Fimage (1).png",[2287,7201,7202],{},[15,7203,7204],{},"Vault project structure",[25,7206,7019],{"id":7018},[15,7208,7209,7210,7213,7214,7217],{},"In Visual Studio, locate ",[45,7211,7212],{},"Open A Local Folder"," from the ",[45,7215,7216],{},"Start"," menu:",[2280,7219,7220,7223],{},[2283,7221],{"src":7222,"alt":135},".gitbook\u002Fassets\u002Fimage (23).png",[2287,7224],{},[15,7226,7227,7228,7231,7232,7235,7236,522,7238,7241,7242,7245],{},"Navigate to your Shader project folder, click ",[45,7229,7230],{},"Select Folder"," to initialize a ",[45,7233,7234],{},"CMake project",", creating ",[50,7237,5739],{},[50,7239,7240],{},"CMakeLists.json"," files will be seen in the ",[45,7243,7244],{},"Solution Explorer"," for your Shader project:",[2280,7247,7248,7251],{},[2283,7249],{"src":7250,"alt":135},".gitbook\u002Fassets\u002Fimage (10).png",[2287,7252,7253],{},[15,7254,7255],{},"Vault Solution Explorer",[15,7257,7258,7259,7262],{},"Select ",[50,7260,7261],{},"wasm32-Release"," build configuration:",[2280,7264,7265,7268],{},[2283,7266],{"src":7267,"alt":135},".gitbook\u002Fassets\u002Fimage (13).png",[2287,7269],{},[15,7271,7272,7273,7276],{},"This will build ",[50,7274,7275],{},".wasm"," files following this folder structure:",[15,7278,7279],{},[50,7280,7281],{},"C:\\Code\\vault\\build\\wasi\\shaders",[15,7283,7284],{},"If you are encountering errors, try the following before reaching out to support:",[30,7286,7287,7293,7303],{},[33,7288,7289,7290,5878],{},"Open Windows Explorer and delete the ",[50,7291,7292],{},"out",[33,7294,7295,7296,7299,7300],{},"In the  ",[45,7297,7298],{},"Project"," menu, select ",[45,7301,7302],{},"Delete Cache and Reconfigure.",[33,7304,7305,7306,7308],{},"Rebuild ",[50,7307,7261],{}," project.",[2280,7310,7311,7314],{},[2283,7312],{"src":7313,"alt":135},".gitbook\u002Fassets\u002Fimage (25).png",[2287,7315],{},[15,7317,7318],{},"You can begin coding your Shader project!",{"title":135,"searchDepth":170,"depth":170,"links":7320},[7321,7322,7323,7324],{"id":27,"depth":180,"text":28},{"id":6921,"depth":180,"text":6922},{"id":6959,"depth":180,"text":6960},{"id":7018,"depth":180,"text":7019},{},"\u002Fdocs\u002Fdev\u002Fshader-sdk-win",{"title":7055,"description":7063},"docs\u002Fdev\u002Fshader-sdk-win","fOtcFu-HuUJmthjxOYwV5v3uz0QYbN18xa-qw2XajLQ",{"id":7331,"title":22,"body":7332,"description":752,"extension":741,"image":742,"meta":8224,"navTitle":742,"navigation":744,"path":750,"seo":8225,"stem":751,"__hash__":8226},"docs\u002Fdocs\u002Fdev\u002Fusing-beam-shaders.md",{"type":8,"value":7333,"toc":8214},[7334,7336,7344,7347,7367,7371,7378,7387,7390,7394,7397,7415,7422,7428,7435,7439,7449,7466,7473,7480,7485,7500,7510,7517,7521,7524,7536,7542,7547,7555,7558,7562,7574,7581,7587,7590,7602,7621,7625,7628,7631,7637,7650,7653,7665,7668,8083,8092,8105,8111,8114,8120,8123,8133,8140,8146,8155,8158,8171,8174,8184,8190,8200,8206,8212],[11,7335,22],{"id":21},[15,7337,7338,7343],{},[19,7339,7342],{"href":7340,"rel":7341},"https:\u002F\u002Fdappnet.beam.mw\u002Fdownloads\u002F",[112],"Why DAppnet","?",[15,7345,7346],{},"Beam consists of three public networks:",[30,7348,7349,7355,7361],{},[33,7350,7351,7354],{},[45,7352,7353],{},"DAppnet:"," a testing sandbox that produces a pseudo-mining block every 15 seconds.",[33,7356,7357,7360],{},[45,7358,7359],{},"Testnet:"," produces genuine mining blocks but is mostly a testing site before Mainnet deployment.",[33,7362,7363,7366],{},[45,7364,7365],{},"Mainnet:"," the living Beam network with real assets.",[25,7368,7370],{"id":7369},"install-dappnet-wallet","Install DAppnet wallet",[15,7372,7373,7374,599],{},"The latest version of the Beam DAppnet Wallet is on our ",[19,7375,7377],{"href":7340,"rel":7376},[112],"website",[15,7379,7380,7381,7386],{},"When ",[19,7382,7385],{"href":7383,"rel":7384},"https:\u002F\u002Fbeamx.gitbook.io\u002Fdappnet-user-guide\u002Fsettings",[112],"installing DAppnet",", choose the default settings to operate the local node (required) to run Beam Shader contracts.  Create a new wallet (save the seed phrase).",[15,7388,7389],{},"Beam Shaders require the use of the integrated node found in the DAppnet Wallet and must remain open for this tutorial.",[25,7391,7393],{"id":7392},"withdraw-from-the-faucet","Withdraw from the Faucet",[15,7395,7396],{},"All DAppnet transactions (including Beam Shader deployment) contain transaction fees that are paid in Beam coins, and require a positive wallet balance.",[15,7398,7399,7400,107,7405,7408,7409,107,7412,599],{},"Launch ",[19,7401,7404],{"href":7402,"rel":7403},"https:\u002F\u002Fbeamx.gitbook.io\u002Fdappnet-user-guide\u002Fmy-dapp-store",[112],"My DApp Store",[2283,7406],{"src":7407,"alt":135,"dataSize":162},".gitbook\u002Fassets\u002FScreen Shot 2023-05-10 at 10.27.02 PM.png"," and find the ",[45,7410,7411],{},"Faucet Application",[2283,7413],{"src":7414,"alt":135,"dataSize":162},".gitbook\u002Fassets\u002FScreen Shot 2023-05-11 at 5.38.24 PM.png",[2280,7416,7417,7420],{},[2283,7418],{"src":7419,"alt":135},".gitbook\u002Fassets\u002Fimage (2).png",[2287,7421],{},[15,7423,7399,7424,7427],{},[45,7425,7426],{},"Faucet >>> Get your first Beam >>> Confirm,","  and Beam coins will deposit into your wallet after the next mining block.",[2280,7429,7430,7433],{},[2283,7431],{"src":7432,"alt":135},".gitbook\u002Fassets\u002Fimage (16).png",[2287,7434],{},[25,7436,7438],{"id":7437},"configuring-your-cli-wallet","Configuring your CLI wallet",[15,7440,7441,7442,7445,7446,7448],{},"Beam shaders are deployed via CLI wallet which can be found on our ",[19,7443,7377],{"href":7340,"rel":7444},[112],". This tutorial uses Windows Command Prompt, but users can substitute ",[19,7447,6600],{"href":6873}," and Linux commands if desired.",[15,7450,7451,7452,7454,7455,7457,7458,7461,7462,7465],{},"Create a ",[50,7453,2838],{}," folder in your hard drive, and transfer CLI wallet archive. The ",[50,7456,2838],{}," folder should contain two files: two files: the ",[50,7459,7460],{},"CLI wallet archive"," and wallet ",[50,7463,7464],{},"config"," file.",[15,7467,7468,7469,7472],{},"For this tutorial, we will use our DAppnet's ",[50,7470,7471],{},"wallet.db","(for testing purposes only. This practice is not recommended with wallets containing real assets).",[25,7474,7476,7477,7479],{"id":7475},"copy-walletdb-from-dappnet-wallet","Copy ",[50,7478,7471],{}," from DAppnet Wallet",[15,7481,7482,7483,7465],{},"Beam wallets store wallet metadata (transaction history, balance, etc) locally on your hard drive in the ",[50,7484,7471],{},[15,7486,7487,7488,7490,7491,7494,7495,7497,7498,5878],{},"Locate your DAppnet ",[50,7489,7471],{}," in the ",[50,7492,7493],{},"%LOCALAPPDATA%\\Beam Wallet folder",". Transfer the ",[50,7496,7471],{}," in the same ",[50,7499,2838],{},[15,7501,1021,7502,7506,7507,7509],{},[19,7503,7505],{"href":7504},"beam-wallets\u002Fdesktop-wallet","Desktop Wallet guide"," for ",[50,7508,7471],{}," file location for macOS and Linux operating systems.",[2280,7511,7512,7515],{},[2283,7513],{"src":7514,"alt":135},".gitbook\u002Fassets\u002Fimage (11).png",[2287,7516],{},[25,7518,7520],{"id":7519},"configure-cli-wallet-settings","Configure CLI wallet settings",[15,7522,7523],{},"One more crucial step before running Shader contracts involves configuring the CLI wallet settings to simplify and shorten commands.",[15,7525,7526,7527,7529,7530,7535],{},"To connect CLI wallet's to the built-in node, first edit the ",[50,7528,7464],{}," file using text editor (such as ",[19,7531,7534],{"href":7532,"rel":7533},"https:\u002F\u002Fcode.visualstudio.com\u002F",[112],"Visual Studio Code",") and enter the following:",[127,7537,7540],{"className":7538,"code":7539,"language":132},[130],"log_level=debug\npass=\u003Cyour wallet password>\nnode_addr=127.0.0.1:10005\nwallet_path=wallet.db\n",[50,7541,7539],{"__ignoreMap":135},[15,7543,4251,7544,7546],{},[50,7545,7464],{}," file should resemble the following:",[127,7548,7549],{},[50,7550,7551,7554],{},[45,7552,7553],{},"################################################################################\n","# General options:\n################################################################################\n\n# log level [info|debug|verbose]\nlog_level=debug\n\n# file log level [info|debug|verbose]\n# file_log_level=debug\n\n# old logs cleanup period (days)\n# log_cleanup_days=5\n\n################################################################################\n# Wallet options:\n################################################################################\n\n# password for the wallet\npass=123\n\n# phrase to generate secret key according to BIP-39.\n# seed_phrase=\n\n# address of node\nnode_addr=127.0.0.1:10005\n\n# path to wallet file\nwallet_path=wallet.db\n\n# command to execute [new_addr|send|receive|listen|init|info|export_miner_key|export_owner_key|generate_phrase]\n# command=listen\n\n\n",[15,7556,7557],{},"The testing environment is ready to deploy Shaders, all that remains is selecting the Shader contract.",[25,7559,7561],{"id":7560},"choosing-a-shader-application","Choosing a  Shader application",[15,7563,4251,7564,7569,7570,7573],{},[19,7565,7568],{"href":7566,"rel":7567},"https:\u002F\u002Fdappnet.explorer.beam.mw\u002F",[112],"Dappnet Blockchain Explorer"," (see ",[45,7571,7572],{},"Contracts"," tab) contains a list of Shader contract applications ready for testing.",[2280,7575,7576,7579],{},[2283,7577],{"src":7578,"alt":135},".gitbook\u002Fassets\u002Fimage (6).png",[2287,7580],{},[15,7582,7583,7584,7586],{},"For the purposes of this tutorial, we will select the ",[45,7585,115],{}," Shader application (copy the Vault Contract ID -- we will use this later).",[15,7588,7589],{},"At thid time, the list of available contracts is DAppnet. The majority of deployed contracts don't contain a contract description. These features will be adjusted with future iterations of DAppnet.",[15,7591,7592,107,7595,7601],{},[45,7593,7594],{},"Please download the Vault application Shader from our",[19,7596,7598,107],{"href":110,"rel":7597},[112],[45,7599,7600],{},"Beam repository.","The Shader contract will not respond to CLI commands without the precompiled source code.",[15,7603,7604,7605,7611,7612,7614,7615,7618,7619,7465],{},"Download ",[19,7606,7609],{"href":7607,"rel":7608},"https:\u002F\u002Fgithub.com\u002FBeamMW\u002Fbeam\u002Fblob\u002Fmaster\u002Fbvm\u002FShaders\u002Fvault\u002Fapp.wasm",[112],[50,7610,2799],{}," and copy it to your ",[50,7613,2838],{}," folder. ",[45,7616,7617],{},"Note",": if you are testing several applications, create a folder for each Shader application so each application contains a separate ",[50,7620,2799],{},[25,7622,7624],{"id":7623},"running-shader-commands","Running Shader commands",[15,7626,7627],{},"Open as command line interface and change directory to the location of the CLI wallet executable.",[15,7629,7630],{},"First, print the contract API with the following command:",[127,7632,7635],{"className":7633,"code":7634,"language":132},[130],"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm\n",[50,7636,7634],{"__ignoreMap":135},[15,7638,7639,7640,7643,7644,7646,7647,7649],{},"Note, we have provided only a single parameter (",[50,7641,7642],{},"--shader_app_file",") since it's assume all other parameters are set in the ",[50,7645,7464],{}," file and a separate path to the application Shader is found in the ",[50,7648,2838],{},"  folder (with the Vault contract).",[15,7651,7652],{},"The output should resemble the following (debug logs are found in this example):",[2280,7654,7655,7658],{},[2283,7656],{"src":7657,"alt":135},".gitbook\u002Fassets\u002Fimage (21).png",[2287,7659,7660],{},[15,7661,7662],{},[50,7663,7664],{},"--shader_app_file method",[15,7666,7667],{},"Copy the Shader output (see below) into your text editor, (following JSON format).",[127,7669,7671],{"className":154,"code":7670,"language":156,"meta":135,"style":135}," {\n     \"roles\":\n     {\n         \"manager\":\n         {\n             \"create\":\n             {},\n             \"destroy\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view\":\n             {},\n             \"view_logs\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view_accounts\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"view_account\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pubKey\": \"PubKey\"\n             }\n         },\n         \"my_account\":\n         {\n             \"view\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"get_key\":\n             {\n                 \"cid\": \"ContractID\"\n             },\n             \"get_proof\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"aid\": \"AssetID\"\n             },\n             \"deposit\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pkForeign\": \"PubKey\",\n                 \"bCoSigner\": \"uint32_t\",\n                 \"amount\": \"Amount\",\n                 \"aid\": \"AssetID\"\n             },\n             \"withdraw\":\n             {\n                 \"cid\": \"ContractID\",\n                 \"pkForeign\": \"PubKey\",\n                 \"bCoSigner\": \"uint32_t\",\n                 \"amount\": \"Amount\",\n                 \"aid\": \"AssetID\",\n                 \"amountCoSigner\": \"Amount\"\n             }\n         }\n     }\n }\n",[50,7672,7673,7678,7685,7690,7697,7702,7709,7714,7721,7726,7735,7740,7747,7751,7758,7762,7770,7774,7781,7785,7793,7797,7804,7808,7818,7828,7833,7838,7845,7849,7855,7859,7867,7871,7878,7882,7890,7894,7901,7905,7915,7924,7928,7935,7939,7949,7960,7971,7982,7990,7994,8001,8005,8015,8025,8035,8045,8055,8065,8069,8074,8079],{"__ignoreMap":135},[160,7674,7675],{"class":162,"line":163},[160,7676,7677],{"class":166}," {\n",[160,7679,7680,7683],{"class":162,"line":170},[160,7681,7682],{"class":173},"     \"roles\"",[160,7684,1129],{"class":166},[160,7686,7687],{"class":162,"line":180},[160,7688,7689],{"class":166},"     {\n",[160,7691,7692,7695],{"class":162,"line":188},[160,7693,7694],{"class":173},"         \"manager\"",[160,7696,1129],{"class":166},[160,7698,7699],{"class":162,"line":197},[160,7700,7701],{"class":166},"         {\n",[160,7703,7704,7707],{"class":162,"line":219},[160,7705,7706],{"class":173},"             \"create\"",[160,7708,1129],{"class":166},[160,7710,7711],{"class":162,"line":227},[160,7712,7713],{"class":166},"             {},\n",[160,7715,7716,7719],{"class":162,"line":243},[160,7717,7718],{"class":173},"             \"destroy\"",[160,7720,1129],{"class":166},[160,7722,7723],{"class":162,"line":259},[160,7724,7725],{"class":166},"             {\n",[160,7727,7728,7731,7733],{"class":162,"line":286},[160,7729,7730],{"class":173},"                 \"cid\"",[160,7732,209],{"class":166},[160,7734,1180],{"class":212},[160,7736,7737],{"class":162,"line":292},[160,7738,7739],{"class":166},"             },\n",[160,7741,7742,7745],{"class":162,"line":300},[160,7743,7744],{"class":173},"             \"view\"",[160,7746,1129],{"class":166},[160,7748,7749],{"class":162,"line":315},[160,7750,7713],{"class":166},[160,7752,7753,7756],{"class":162,"line":331},[160,7754,7755],{"class":173},"             \"view_logs\"",[160,7757,1129],{"class":166},[160,7759,7760],{"class":162,"line":357},[160,7761,7725],{"class":166},[160,7763,7764,7766,7768],{"class":162,"line":365},[160,7765,7730],{"class":173},[160,7767,209],{"class":166},[160,7769,1180],{"class":212},[160,7771,7772],{"class":162,"line":378},[160,7773,7739],{"class":166},[160,7775,7776,7779],{"class":162,"line":390},[160,7777,7778],{"class":173},"             \"view_accounts\"",[160,7780,1129],{"class":166},[160,7782,7783],{"class":162,"line":403},[160,7784,7725],{"class":166},[160,7786,7787,7789,7791],{"class":162,"line":416},[160,7788,7730],{"class":173},[160,7790,209],{"class":166},[160,7792,1180],{"class":212},[160,7794,7795],{"class":162,"line":427},[160,7796,7739],{"class":166},[160,7798,7799,7802],{"class":162,"line":433},[160,7800,7801],{"class":173},"             \"view_account\"",[160,7803,1129],{"class":166},[160,7805,7806],{"class":162,"line":441},[160,7807,7725],{"class":166},[160,7809,7810,7812,7814,7816],{"class":162,"line":452},[160,7811,7730],{"class":173},[160,7813,209],{"class":166},[160,7815,213],{"class":212},[160,7817,375],{"class":166},[160,7819,7820,7823,7825],{"class":162,"line":463},[160,7821,7822],{"class":173},"                 \"pubKey\"",[160,7824,209],{"class":166},[160,7826,7827],{"class":212},"\"PubKey\"\n",[160,7829,7830],{"class":162,"line":474},[160,7831,7832],{"class":166},"             }\n",[160,7834,7835],{"class":162,"line":485},[160,7836,7837],{"class":166},"         },\n",[160,7839,7840,7843],{"class":162,"line":494},[160,7841,7842],{"class":173},"         \"my_account\"",[160,7844,1129],{"class":166},[160,7846,7847],{"class":162,"line":500},[160,7848,7701],{"class":166},[160,7850,7851,7853],{"class":162,"line":506},[160,7852,7744],{"class":173},[160,7854,1129],{"class":166},[160,7856,7857],{"class":162,"line":512},[160,7858,7725],{"class":166},[160,7860,7861,7863,7865],{"class":162,"line":1356},[160,7862,7730],{"class":173},[160,7864,209],{"class":166},[160,7866,1180],{"class":212},[160,7868,7869],{"class":162,"line":1367},[160,7870,7739],{"class":166},[160,7872,7873,7876],{"class":162,"line":1376},[160,7874,7875],{"class":173},"             \"get_key\"",[160,7877,1129],{"class":166},[160,7879,7880],{"class":162,"line":1381},[160,7881,7725],{"class":166},[160,7883,7884,7886,7888],{"class":162,"line":1389},[160,7885,7730],{"class":173},[160,7887,209],{"class":166},[160,7889,1180],{"class":212},[160,7891,7892],{"class":162,"line":1394},[160,7893,7739],{"class":166},[160,7895,7896,7899],{"class":162,"line":1405},[160,7897,7898],{"class":173},"             \"get_proof\"",[160,7900,1129],{"class":166},[160,7902,7903],{"class":162,"line":1417},[160,7904,7725],{"class":166},[160,7906,7907,7909,7911,7913],{"class":162,"line":1428},[160,7908,7730],{"class":173},[160,7910,209],{"class":166},[160,7912,213],{"class":212},[160,7914,375],{"class":166},[160,7916,7917,7920,7922],{"class":162,"line":1437},[160,7918,7919],{"class":173},"                 \"aid\"",[160,7921,209],{"class":166},[160,7923,424],{"class":212},[160,7925,7926],{"class":162,"line":1442},[160,7927,7739],{"class":166},[160,7929,7930,7933],{"class":162,"line":1450},[160,7931,7932],{"class":173},"             \"deposit\"",[160,7934,1129],{"class":166},[160,7936,7937],{"class":162,"line":1455},[160,7938,7725],{"class":166},[160,7940,7941,7943,7945,7947],{"class":162,"line":1464},[160,7942,7730],{"class":173},[160,7944,209],{"class":166},[160,7946,213],{"class":212},[160,7948,375],{"class":166},[160,7950,7951,7954,7956,7958],{"class":162,"line":1469},[160,7952,7953],{"class":173},"                 \"pkForeign\"",[160,7955,209],{"class":166},[160,7957,280],{"class":212},[160,7959,375],{"class":166},[160,7961,7962,7965,7967,7969],{"class":162,"line":1477},[160,7963,7964],{"class":173},"                 \"bCoSigner\"",[160,7966,209],{"class":166},[160,7968,398],{"class":212},[160,7970,375],{"class":166},[160,7972,7973,7976,7978,7980],{"class":162,"line":1482},[160,7974,7975],{"class":173},"                 \"amount\"",[160,7977,209],{"class":166},[160,7979,411],{"class":212},[160,7981,375],{"class":166},[160,7983,7984,7986,7988],{"class":162,"line":1493},[160,7985,7919],{"class":173},[160,7987,209],{"class":166},[160,7989,424],{"class":212},[160,7991,7992],{"class":162,"line":1505},[160,7993,7739],{"class":166},[160,7995,7996,7999],{"class":162,"line":1517},[160,7997,7998],{"class":173},"             \"withdraw\"",[160,8000,1129],{"class":166},[160,8002,8003],{"class":162,"line":1527},[160,8004,7725],{"class":166},[160,8006,8007,8009,8011,8013],{"class":162,"line":1532},[160,8008,7730],{"class":173},[160,8010,209],{"class":166},[160,8012,213],{"class":212},[160,8014,375],{"class":166},[160,8016,8017,8019,8021,8023],{"class":162,"line":1540},[160,8018,7953],{"class":173},[160,8020,209],{"class":166},[160,8022,280],{"class":212},[160,8024,375],{"class":166},[160,8026,8027,8029,8031,8033],{"class":162,"line":1545},[160,8028,7964],{"class":173},[160,8030,209],{"class":166},[160,8032,398],{"class":212},[160,8034,375],{"class":166},[160,8036,8037,8039,8041,8043],{"class":162,"line":1554},[160,8038,7975],{"class":173},[160,8040,209],{"class":166},[160,8042,411],{"class":212},[160,8044,375],{"class":166},[160,8046,8047,8049,8051,8053],{"class":162,"line":1560},[160,8048,7919],{"class":173},[160,8050,209],{"class":166},[160,8052,352],{"class":212},[160,8054,375],{"class":166},[160,8056,8057,8060,8062],{"class":162,"line":1566},[160,8058,8059],{"class":173},"                 \"amountCoSigner\"",[160,8061,209],{"class":166},[160,8063,8064],{"class":212},"\"Amount\"\n",[160,8066,8067],{"class":162,"line":1574},[160,8068,7832],{"class":166},[160,8070,8071],{"class":162,"line":1579},[160,8072,8073],{"class":166},"         }\n",[160,8075,8076],{"class":162,"line":1587},[160,8077,8078],{"class":166},"     }\n",[160,8080,8081],{"class":162,"line":1592},[160,8082,283],{"class":166},[15,8084,8085,8086,8088,8089,8091],{},"The Vault contract API (as retrieved from the Vault Shader contract) separates the API actions into roles, (",[50,8087,521],{}," , ",[50,8090,525],{},") following semantic structure.",[15,8093,4251,8094,8096,8097,8101,8102,8104],{},[50,8095,563],{}," method will list all Vault accounts present and were we can can plug the Valut Shader (found in the ",[19,8098,8100],{"href":7566,"rel":8099},[112],"DAppnet explorer",") contract ID into the ",[50,8103,563],{}," parameter.",[127,8106,8109],{"className":8107,"code":8108,"language":132},[130],"d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14\n",[50,8110,8108],{"__ignoreMap":135},[15,8112,8113],{},"Enter the following command:",[127,8115,8118],{"className":8116,"code":8117,"language":132},[130],"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm --shader_args=cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14,role=manager,action=view_accounts\n",[50,8119,8117],{"__ignoreMap":135},[15,8121,8122],{},"The output should resemble the following:",[2280,8124,8125,8128],{},[2283,8126],{"src":8127,"alt":135},".gitbook\u002Fassets\u002Fimage (17).png",[2287,8129,8130],{},[15,8131,8132],{},"View_accounts method",[15,8134,8135,8136,8139],{},"In the above example, there are currently no accounts within the contract. To create an account, utilize ",[50,8137,8138],{},"deposit"," method and deposit one Beam coin with the following command:",[127,8141,8144],{"className":8142,"code":8143,"language":132},[130],"beam-wallet-dappnet.exe shader --shader_app_file vault\\app.wasm --shader_args=\"cid=d9c5d1782b2d2b6f733486be480bb0d8bcf34d5fdc63bbac996ed76af541cc14,role=my_account,action=deposit,amount=100000000\"\n",[50,8145,8143],{"__ignoreMap":135},[15,8147,8148,107,8151,8154],{},[45,8149,8150],{},"Note:",[50,8152,8153],{},"amount"," is set in Groth, which is $$1^10-8$$  of Beam.",[15,8156,8157],{},"The above action creates and sends the transaction to the network (so it will take a moment). When completed, the output should resemble the following:",[2280,8159,8160,8163],{},[2283,8161],{"src":8162,"alt":135},".gitbook\u002Fassets\u002Fimage (5).png",[2287,8164,8165],{},[15,8166,8167,8170],{},[50,8168,8169],{},"Deposit"," Method",[15,8172,8173],{},"The response generated (see below) clarfies the API response:",[2280,8175,8176,8179],{},[2283,8177],{"src":8178,"alt":135},".gitbook\u002Fassets\u002Fimage (18).png",[2287,8180,8181],{},[15,8182,8183],{},"Deposit successful",[15,8185,8186,8187,2897],{},"To confirm the transaction was successful, re-enter the ",[50,8188,8189],{},"accounts",[2280,8191,8192,8195],{},[2283,8193],{"src":8194,"alt":135},".gitbook\u002Fassets\u002Fimage (7).png",[2287,8196,8197],{},[15,8198,8199],{},"New account creation",[15,8201,8202,8203,2804],{},"The response generated confirms a new account is identified by your wallet public key and has a balance of one Beams. To get aquainted with the API function, try depositing and withdrawing Beam's into your account. Users can also attempt to retrieve Beam's from a seperate account (",[45,8204,8205],{},"spoiler: it won't work",[15,8207,8208,8209,599],{},"To learn how to code your own Shader application contract and deploy it chain, please refer to our ",[19,8210,8211],{"href":7060},"Shader SDK tutorial",[729,8213,731],{},{"title":135,"searchDepth":170,"depth":170,"links":8215},[8216,8217,8218,8219,8221,8222,8223],{"id":7369,"depth":180,"text":7370},{"id":7392,"depth":180,"text":7393},{"id":7437,"depth":180,"text":7438},{"id":7475,"depth":180,"text":8220},"Copy wallet.db from DAppnet Wallet",{"id":7519,"depth":180,"text":7520},{"id":7560,"depth":180,"text":7561},{"id":7623,"depth":180,"text":7624},{},{"title":22,"description":752},"FmFYkMvLYiPOFVfIam4WmMZpm9RHWuygxNjFsIMj1Ws",{"id":5,"title":6,"body":8228,"description":740,"extension":741,"image":742,"meta":8759,"navTitle":742,"navigation":744,"path":3,"seo":8760,"stem":746,"__hash__":747},{"type":8,"value":8229,"toc":8751},[8230,8232,8236,8238,8264,8266,8268,8278,8289,8291,8293,8298,8302,8307,8311,8595,8603,8639,8647,8649,8655,8673,8679,8684,8688,8693,8695,8703,8708,8710,8715,8717,8749],[11,8231,6],{"id":13},[15,8233,17,8234,23],{},[19,8235,22],{"href":21},[25,8237,28],{"id":27},[30,8239,8240,8254,8258,8262],{},[33,8241,35,8242,40,8244,8246,48,8248,53,8250,53,8252,60],{},[19,8243,39],{"href":38},[42,8245],{},[45,8247,47],{},[50,8249,52],{},[50,8251,56],{},[50,8253,59],{},[33,8255,63,8256,67],{},[50,8257,66],{},[33,8259,70,8260,75],{},[19,8261,74],{"href":73},[33,8263,78],{},[25,8265,82],{"id":81},[15,8267,85],{},[87,8269,8270,8274],{},[33,8271,8272,94],{},[45,8273,93],{},[33,8275,8276,100],{},[45,8277,99],{},[15,8279,8280,107,8282,107,8287],{},[104,8281,106],{},[19,8283,8285],{"href":110,"rel":8284},[112],[104,8286,115],{},[104,8288,118],{},[25,8290,122],{"id":121},[15,8292,125],{},[127,8294,8296],{"className":8295,"code":131,"language":132},[130],[50,8297,131],{"__ignoreMap":135},[15,8299,8300,140],{},[42,8301],{},[127,8303,8305],{"className":8304,"code":144,"language":132},[130],[50,8306,144],{"__ignoreMap":135},[15,8308,8309,151],{},[42,8310],{},[127,8312,8313],{"className":154,"code":155,"language":156,"meta":135,"style":135},[50,8314,8315,8319,8325,8331,8337,8351,8357,8371,8385,8407,8411,8417,8431,8445,8467,8473,8483,8493,8503,8513,8521,8525,8531,8541,8551,8561,8571,8579,8583,8587,8591],{"__ignoreMap":135},[160,8316,8317],{"class":162,"line":163},[160,8318,167],{"class":166},[160,8320,8321,8323],{"class":162,"line":170},[160,8322,174],{"class":173},[160,8324,177],{"class":166},[160,8326,8327,8329],{"class":162,"line":180},[160,8328,183],{"class":173},[160,8330,177],{"class":166},[160,8332,8333,8335],{"class":162,"line":188},[160,8334,191],{"class":173},[160,8336,194],{"class":166},[160,8338,8339,8341,8343,8345,8347,8349],{"class":162,"line":197},[160,8340,200],{"class":173},[160,8342,203],{"class":166},[160,8344,206],{"class":173},[160,8346,209],{"class":166},[160,8348,213],{"class":212},[160,8350,216],{"class":166},[160,8352,8353,8355],{"class":162,"line":219},[160,8354,222],{"class":173},[160,8356,194],{"class":166},[160,8358,8359,8361,8363,8365,8367,8369],{"class":162,"line":227},[160,8360,230],{"class":173},[160,8362,203],{"class":166},[160,8364,206],{"class":173},[160,8366,209],{"class":166},[160,8368,213],{"class":212},[160,8370,216],{"class":166},[160,8372,8373,8375,8377,8379,8381,8383],{"class":162,"line":243},[160,8374,246],{"class":173},[160,8376,203],{"class":166},[160,8378,206],{"class":173},[160,8380,209],{"class":166},[160,8382,213],{"class":212},[160,8384,216],{"class":166},[160,8386,8387,8389,8391,8393,8395,8397,8399,8401,8403,8405],{"class":162,"line":259},[160,8388,262],{"class":173},[160,8390,203],{"class":166},[160,8392,206],{"class":173},[160,8394,209],{"class":166},[160,8396,213],{"class":212},[160,8398,53],{"class":166},[160,8400,275],{"class":173},[160,8402,209],{"class":166},[160,8404,280],{"class":212},[160,8406,283],{"class":166},[160,8408,8409],{"class":162,"line":286},[160,8410,289],{"class":166},[160,8412,8413,8415],{"class":162,"line":292},[160,8414,295],{"class":173},[160,8416,177],{"class":166},[160,8418,8419,8421,8423,8425,8427,8429],{"class":162,"line":300},[160,8420,222],{"class":173},[160,8422,203],{"class":166},[160,8424,206],{"class":173},[160,8426,209],{"class":166},[160,8428,213],{"class":212},[160,8430,216],{"class":166},[160,8432,8433,8435,8437,8439,8441,8443],{"class":162,"line":315},[160,8434,318],{"class":173},[160,8436,203],{"class":166},[160,8438,206],{"class":173},[160,8440,209],{"class":166},[160,8442,213],{"class":212},[160,8444,216],{"class":166},[160,8446,8447,8449,8451,8453,8455,8457,8459,8461,8463,8465],{"class":162,"line":331},[160,8448,334],{"class":173},[160,8450,203],{"class":166},[160,8452,206],{"class":173},[160,8454,209],{"class":166},[160,8456,213],{"class":212},[160,8458,53],{"class":166},[160,8460,347],{"class":173},[160,8462,209],{"class":166},[160,8464,352],{"class":212},[160,8466,216],{"class":166},[160,8468,8469,8471],{"class":162,"line":357},[160,8470,360],{"class":173},[160,8472,177],{"class":166},[160,8474,8475,8477,8479,8481],{"class":162,"line":365},[160,8476,368],{"class":173},[160,8478,209],{"class":166},[160,8480,213],{"class":212},[160,8482,375],{"class":166},[160,8484,8485,8487,8489,8491],{"class":162,"line":378},[160,8486,381],{"class":173},[160,8488,209],{"class":166},[160,8490,280],{"class":212},[160,8492,375],{"class":166},[160,8494,8495,8497,8499,8501],{"class":162,"line":390},[160,8496,393],{"class":173},[160,8498,209],{"class":166},[160,8500,398],{"class":212},[160,8502,375],{"class":166},[160,8504,8505,8507,8509,8511],{"class":162,"line":403},[160,8506,406],{"class":173},[160,8508,209],{"class":166},[160,8510,411],{"class":212},[160,8512,375],{"class":166},[160,8514,8515,8517,8519],{"class":162,"line":416},[160,8516,419],{"class":173},[160,8518,209],{"class":166},[160,8520,424],{"class":212},[160,8522,8523],{"class":162,"line":427},[160,8524,430],{"class":166},[160,8526,8527,8529],{"class":162,"line":433},[160,8528,436],{"class":173},[160,8530,177],{"class":166},[160,8532,8533,8535,8537,8539],{"class":162,"line":441},[160,8534,368],{"class":173},[160,8536,209],{"class":166},[160,8538,213],{"class":212},[160,8540,375],{"class":166},[160,8542,8543,8545,8547,8549],{"class":162,"line":452},[160,8544,381],{"class":173},[160,8546,209],{"class":166},[160,8548,280],{"class":212},[160,8550,375],{"class":166},[160,8552,8553,8555,8557,8559],{"class":162,"line":463},[160,8554,393],{"class":173},[160,8556,209],{"class":166},[160,8558,398],{"class":212},[160,8560,375],{"class":166},[160,8562,8563,8565,8567,8569],{"class":162,"line":474},[160,8564,406],{"class":173},[160,8566,209],{"class":166},[160,8568,411],{"class":212},[160,8570,375],{"class":166},[160,8572,8573,8575,8577],{"class":162,"line":485},[160,8574,419],{"class":173},[160,8576,209],{"class":166},[160,8578,424],{"class":212},[160,8580,8581],{"class":162,"line":494},[160,8582,497],{"class":166},[160,8584,8585],{"class":162,"line":500},[160,8586,503],{"class":166},[160,8588,8589],{"class":162,"line":506},[160,8590,509],{"class":166},[160,8592,8593],{"class":162,"line":512},[160,8594,515],{"class":166},[15,8596,518,8597,522,8599,526,8601,529],{},[50,8598,521],{},[50,8600,525],{},[50,8602,521],{},[87,8604,8605,8609,8615,8619,8625,8631],{},[33,8606,8607],{},[50,8608,536],{},[33,8610,8611,542,8613,546],{},[50,8612,541],{},[50,8614,545],{},[33,8616,8617],{},[50,8618,551],{},[33,8620,8621,542,8623,546],{},[50,8622,556],{},[50,8624,545],{},[33,8626,8627,542,8629,546],{},[50,8628,563],{},[50,8630,545],{},[33,8632,8633,571,8635,522,8637,577],{},[50,8634,570],{},[50,8636,545],{},[50,8638,576],{},[15,8640,8641],{},[104,8642,8643,584,8645,588],{},[45,8644,545],{},[45,8646,587],{},[25,8648,592],{"id":591},[15,8650,595,8651,599,8653,602],{},[50,8652,598],{},[42,8654],{},[87,8656,8657,8661,8665,8669],{},[33,8658,8659,610],{},[50,8660,609],{},[33,8662,8663,616],{},[50,8664,615],{},[33,8666,8667,622],{},[50,8668,621],{},[33,8670,8671],{},[50,8672,627],{},[15,8674,8675,107,8677],{},[45,8676,47],{},[104,8678,634],{},[127,8680,8682],{"className":8681,"code":638,"language":132},[130],[50,8683,638],{"__ignoreMap":135},[15,8685,8686],{},[104,8687,645],{},[127,8689,8691],{"className":8690,"code":649,"language":132},[130],[50,8692,649],{"__ignoreMap":135},[25,8694,655],{"id":654},[15,8696,658,8697,661,8699,664,8701,668],{},[50,8698,521],{},[50,8700,536],{},[45,8702,667],{},[127,8704,8706],{"className":8705,"code":672,"language":132},[130],[50,8707,672],{"__ignoreMap":135},[15,8709,677],{},[127,8711,8713],{"className":8712,"code":681,"language":132},[130],[50,8714,681],{"__ignoreMap":135},[25,8716,687],{"id":686},[87,8718,8719,8733],{},[33,8720,692,8721,8726,701,8728],{},[127,8722,8724],{"className":8723,"code":696,"language":132},[130],[50,8725,696],{"__ignoreMap":135},[42,8727],{},[127,8729,8731],{"className":8730,"code":705,"language":132},[130],[50,8732,705],{"__ignoreMap":135},[33,8734,710,8735,713,8737,8742,677,8744],{},[50,8736,545],{},[127,8738,8740],{"className":8739,"code":717,"language":132},[130],[50,8741,717],{"__ignoreMap":135},[42,8743],{},[127,8745,8747],{"className":8746,"code":725,"language":132},[130],[50,8748,725],{"__ignoreMap":135},[729,8750,731],{},{"title":135,"searchDepth":170,"depth":170,"links":8752},[8753,8754,8755,8756,8757,8758],{"id":27,"depth":180,"text":28},{"id":81,"depth":180,"text":82},{"id":121,"depth":180,"text":122},{"id":591,"depth":180,"text":592},{"id":654,"depth":180,"text":655},{"id":686,"depth":180,"text":687},{},{"title":6,"description":740},{"id":759,"title":760,"body":8762,"description":135,"extension":741,"image":742,"meta":8947,"navTitle":742,"navigation":744,"path":1055,"seo":8948,"stem":1057,"__hash__":1058},{"type":8,"value":8763,"toc":8936},[8764,8766,8768,8774,8776,8778,8782,8798,8802,8832,8834,8846,8854,8858,8873,8875,8877,8881,8885,8887,8889,8893,8895,8897,8902,8904,8909,8911,8916,8918,8922,8927,8929,8931],[11,8765,760],{"id":765},[767,8767,770],{"id":769},[15,8769,8770],{},[774,8771,8772],{"style":776},[45,8773,779],{},[15,8775,782],{},[15,8777,785],{},[15,8779,8780],{},[45,8781,790],{},[87,8783,8784,8789,8794],{},[33,8785,8786],{},[19,8787,799],{"href":797,"rel":8788},[112],[33,8790,8791,807],{},[19,8792,806],{"href":804,"rel":8793},[112],[33,8795,8796,814],{},[19,8797,813],{"href":812},[15,8799,8800],{},[45,8801,819],{},[87,8803,8804,8808,8812,8816,8820,8824,8828],{},[33,8805,8806],{},[19,8807,827],{"href":826},[33,8809,8810],{},[19,8811,833],{"href":832},[33,8813,8814],{},[19,8815,839],{"href":838},[33,8817,8818],{},[19,8819,845],{"href":844},[33,8821,8822],{},[19,8823,851],{"href":850},[33,8825,8826],{},[19,8827,857],{"href":856},[33,8829,8830],{},[19,8831,863],{"href":862},[25,8833,827],{"id":866},[15,8835,869,8836,874,8838,880,8841,886,8844,891],{},[19,8837,873],{"href":872},[19,8839,879],{"href":877,"rel":8840},[112],[19,8842,885],{"href":883,"rel":8843},[112],[19,8845,890],{"href":889},[15,8847,894,8848,900,8851,599],{},[19,8849,899],{"href":897,"rel":8850},[112],[19,8852,905],{"href":903,"rel":8853},[112],[15,8855,8856],{},[45,8857,910],{},[87,8859,8860,8864,8869],{},[33,8861,8862,919],{},[19,8863,918],{"href":917},[33,8865,922,8866,599],{},[19,8867,927],{"href":925,"rel":8868},[112],[33,8870,930,8871,935],{},[19,8872,934],{"href":933},[25,8874,833],{"id":938},[15,8876,941],{},[15,8878,8879,947],{},[45,8880,946],{},[15,8882,950,8883,954],{},[19,8884,833],{"href":953},[25,8886,958],{"id":957},[15,8888,961],{},[15,8890,964,8891,599],{},[19,8892,967],{"href":21},[25,8894,971],{"id":970},[15,8896,974],{},[15,8898,977,8899,599],{},[19,8900,982],{"href":980,"rel":8901},[112],[25,8903,986],{"id":985},[15,8905,989,8906,995],{},[19,8907,994],{"href":992,"rel":8908},[112],[15,8910,998],{},[15,8912,1001,8913,1007],{},[19,8914,1006],{"href":1004,"rel":8915},[112],[25,8917,857],{"id":1010},[15,8919,1013,8920,1018],{},[19,8921,1017],{"href":1016},[15,8923,1021,8924,1027],{},[19,8925,1026],{"href":1024,"rel":8926},[112],[25,8928,863],{"id":1030},[15,8930,1033],{},[15,8932,1036,8933,1042],{},[19,8934,1041],{"href":1039,"rel":8935},[112],{"title":135,"searchDepth":170,"depth":170,"links":8937},[8938],{"id":769,"depth":170,"text":770,"children":8939},[8940,8941,8942,8943,8944,8945,8946],{"id":866,"depth":180,"text":827},{"id":938,"depth":180,"text":833},{"id":957,"depth":180,"text":958},{"id":970,"depth":180,"text":971},{"id":985,"depth":180,"text":986},{"id":1010,"depth":180,"text":857},{"id":1030,"depth":180,"text":863},{},{"title":760,"description":135},1783090714128]