{"id":20163216,"url":"https://github.com/blockdaemon/workshop-buildervault-xdc","last_synced_at":"2025-07-09T09:34:51.815Z","repository":{"id":230978910,"uuid":"780636576","full_name":"Blockdaemon/workshop-buildervault-xdc","owner":"Blockdaemon","description":"Builder Vault XDC workshop code snippets","archived":false,"fork":false,"pushed_at":"2024-05-06T14:28:08.000Z","size":30,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-14T00:32:47.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Blockdaemon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-01T21:59:42.000Z","updated_at":"2024-07-23T19:16:01.000Z","dependencies_parsed_at":"2024-04-01T23:24:19.163Z","dependency_job_id":"67e59792-6f14-4a63-b36e-58daaaa0affc","html_url":"https://github.com/Blockdaemon/workshop-buildervault-xdc","commit_stats":null,"previous_names":["blockdaemon/builder-vault-xdc-workshop","blockdaemon/workshop-buildervault-xdc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Blockdaemon/workshop-buildervault-xdc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blockdaemon%2Fworkshop-buildervault-xdc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blockdaemon%2Fworkshop-buildervault-xdc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blockdaemon%2Fworkshop-buildervault-xdc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blockdaemon%2Fworkshop-buildervault-xdc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Blockdaemon","download_url":"https://codeload.github.com/Blockdaemon/workshop-buildervault-xdc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Blockdaemon%2Fworkshop-buildervault-xdc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264431578,"owners_count":23607270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T00:28:38.925Z","updated_at":"2025-07-09T09:34:51.780Z","avatar_url":"https://github.com/Blockdaemon.png","language":"Go","readme":"\n# XDC transaction signing with Builder Vault\n\n```mermaid\nsequenceDiagram\n    autonumber\n    actor client1 as XDC client\n    participant Blockchain as XDC Blockchain\u003cbr\u003e RPC API\n    actor client2 as BuilderVault client\n    box Builder Vault\n      participant TSM1 as MPC Wallet \u003cbr\u003e(private key share 1)\n      participant TSM2 as MPC Wallet \u003cbr\u003e(private key share 2)\n      participant TSM3 as MPC Wallet \u003cbr\u003e(private key share 3)\n    end\n    #note over client,TSM2: Create wallet\n    opt\n      client2 -\u003e\u003e TSM1: create master key\n      client2 -\u003e\u003e TSM1: create XDC wallet \n    end\n\n    #note over client,TSM2: Create transations\n    client1 -\u003e\u003e Blockchain: get blockchain inputs (gas, nonce, balance) for new tx\u003cbr\u003e(sender wallet)\n    client1 -\u003e\u003e client1: construct unsigned tx\n    client1 -\u003e\u003e client2: request signature (unsigned tx hash)\n\n    client2 -\u003e\u003e TSM1: request share1 signature (unsigned tx hash)\n    TSM1 --\u003e\u003e client2: return partial signature\n    client2 -\u003e\u003e TSM2: request share2 signature (unsigned tx hash)\n    TSM2 --\u003e\u003e client2: return partial signature\n    client2 -\u003e\u003e TSM3: request share3 signature (unsigned tx hash)\n    TSM3 --\u003e\u003e client2: return partial signature\n    client2 -\u003e\u003e client2: combine partial signatures\n    client2 --\u003e\u003e client1: return signature\n    client1 -\u003e\u003e Blockchain: broadcast signed tx\u003cbr\u003e(signed tx)\n```\n\n### Prerequisites\n  - Go https://go.dev/doc/install\n  - Register a demo Builder Vault tenant: https://www.blockdaemon.com/wallet/builder-vault\n  - Download SDK bundle provided in registration email (extract auth certificates)\n  - Place Builder Vault `client.crt` \u0026 `client.key` in working directory\n\n### Step 1. Create Wallet with Builder Vault and XDC chain path\n```shell\ngo run 1-create-xdc-wallet/main.go\n```\n  - note the new XDC Wallet address and fund it through https://faucet.blocksscan.io\n  - note the Builder Vault Master Key ID (to be used for future signing)\n\n\n### Step 2. Craft an unsigned transaction with go-ethereum\n  - set the wallet address created in step 1\n  - set the destination address to send funds to\n```shell\ngo run 2-craft-transaction/main.go\n```\n  - check the wallet balance is not 0\n  - note the raw unsigned transaction (to be broadcast once signed)\n  - note the unsigned transaction hash (to be signed by Builder Vault)\n\n\n### Step 3. Sign transaction with MPC wallet library\n  - set the Builder Vault Master Key ID to be used for signing (created in step 1)\n  - set the unsigned transaction hash to be signed by Builder Vault (created in step 2)\n```shell\ngo run 3-sign-transaction/main.go\n```\n  - note the transaction signature\n\n\n### Step 4. Broadcast signed raw transaction with XDC client library\n  - set the transaction signature hash (created in step 3)\n  - set the raw unsigned transaction (created in step 2)\n```shell\ngo run 4-broadcast-signed-transaction/main.go\n```\n  - check the transaction hash on a block explorer\n\n\n## XDC Testnet Network details:\n  - RPC endpoint: https://erpc.apothem.network\n  - Block explorers: https://explorer.apothem.network https://apothem.blocksscan.io\n  - Faucets: https://faucet.apothem.network https://faucet.blocksscan.io\n  - ChainId: 51\n  - Web wallet: https://wallet.apothem.network https://mnrpc.xinfin.network\n  - TX decoder: https://rawtxdecode.in/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockdaemon%2Fworkshop-buildervault-xdc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblockdaemon%2Fworkshop-buildervault-xdc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblockdaemon%2Fworkshop-buildervault-xdc/lists"}