Link

Copper Unlimited Server

Part Sign Transaction

  1. Start Copper Unlimited server

    docker run --rm -ti \
      -v ${PWD}/key-backups/:/app/keys/ \
      -p 3010:3010 \
      copperexchange/copper-unlimited:latest
    

    ${PWD}/key-backups/ should contain MPC wallets backup from Copper Unlimited.

    To enable SSL/TLS add Volume with your key and certificate as follows:

       docker run --rm -ti \
         -v ${PWD}/key-backups/:/app/keys/ \
         -v ${PWD}/ssl/certificate.cert:/app/ssl/certificate.cert \
         -v ${PWD}/ssl/privatekey.key:/app/ssl/privatekey.key \
         -p 3010:3010 \
         copperexchange/copper-unlimited:latest
    
  2. Create withdraw order (example: move funds from Vault to some WG exchange)

     + POST https://api.copper.co/platform/orders
        
     + Request
       {
         "externalOrderId": "ckdr8xy1l00303g5neu5iunh4",
         "orderType": "withdraw",
         "baseCurrency": "ETH",
         "mainCurrency": "ETH",
         "amount": "0.01",
         "portfolioId": "edd7e0ea-9d00-4538-b187-c14813d7b0ba",  // from account
         "toPortfolioId": "28a26c72-4d72-4f97-9b36-6811ab708216", // to account
         "includeFeeInWithdraw": true,
         "feeLevel": "low"
       } 
          
     + Response 201
       {
         "orderId": "5824946",
         "orderType": "withdraw",
         "amount": "0.01",
         "baseCurrency": "ETH",
         "mainCurrency": "ETH",
         "externalOrderId": "ckdr8xy1l00303g5neu5iunh4",
         "extra": {
           "feeLevel": "low",
           "includeFeeInWithdraw": true,
           "toAddress": "0xf71b4a401734a3f1fe9794003a4956ada7753175",
           "toPortfolioId": "28a26c72-4d72-4f97-9b36-6811ab708216"
         },
         "portfolioId": "edd7e0ea-9d00-4538-b187-c14813d7b0ba",
         "portfolioType": "custody",
         "status": "awaiting-settlement"
       }
    
  3. Start transaction settlement flow

     + PATCH https://api.copper.co/platform/orders/{orderId}
       
     + Headers
       Content-Type: application/vnd.start-custody-settlement+json
        
     + Response 200
       {
         "amount": "0.01",
         "baseCurrency": "ETH",
         "externalOrderId": "ckdr8xy1l00303g5neu5iunh4",
         "extra": {
           "toPortfolioId": "ck8plg2if000f3j5qnnbw13op",
           "transactionRequest": {
             "publicKeyHash": "765188378c75dd61140d765242a0a3d09cd15680a862769e4000f75204fa86de",
             "currency": "ETH",
             "mainCurrency": "ETH",
             "amount": "10000000000000000",
             "toAddress": "0xf71b4a401734a3f1fe9794003a4956ada7753175",
             "includeFee": true,
             "transactionRequest": {
               "fee": "231000000000000",
               "outputs": [
                 {
                   "value": "10000000000000000",
                   "address": "0xf71b4a401734a3f1fe9794003a4956ada7753175"
                 }
               ],
               "gasLimit": "21000",
               "gasPrice": "11000000000",
               "sequence": "4",
               "includeFee": true,
               "nonceNumber": "15"
             }
           },
           "toAddress": "0xf71b4a401734a3f1fe9794003a4956ada7753175",
           "reportingCurrencyRate": "338.15",
           "feesPercent": "0",
           "feeLevel": "low",
           "includeFeeInWithdraw": true,
           "withdrawFee": "0.000231000000000000"
         },
         "mainCurrency": "ETH",
         "orderId": "5824946",
         "orderType": "withdraw",
         "portfolioId": "edd7e0ea-9d00-4538-b187-c14813d7b0ba",
         "portfolioType": "custody",
         "status": "working"
       }
    
  4. Sign transaction in offline copper-unlimited-server

    + POST http://127.0.0.1:3010/signatures
       
    + Headers
      Content-Type: application/json
    
    + Request
      {
        "type": "request",
        "keyPassword": "myTestPaswordFromKeyBackup.1234#",
        "keyFilename": "BTC_My Default Vault_wallet.copper",
          
         // get all this fields from order.extra.transactionRequest, described above
        "signRequest": {
          "publicKeyHash": "765188378c75dd61140d765242a0a3d09cd15680a862769e4000f75204fa86de",
          "currency": "ETH",
          "mainCurrency": "ETH",
          "amount": "10000000000000000",
          "toAddress": "0xf71b4a401734a3f1fe9794003a4956ada7753175",
          "includeFee": true,
          "transactionRequest": {
            "fee": "231000000000000",
            "outputs": [
              {
                "value": "10000000000000000",
                "address": "0xf71b4a401734a3f1fe9794003a4956ada7753175"
              }
            ],
            "gasLimit": "21000",
            "gasPrice": "11000000000",
            "sequence": "4",
            "includeFee": true,
            "nonceNumber": "15"
          }
        }
      }
       
    + Response 200 OK
      {
        "type": "part-signed-tx",
        "value": "AQRwL5FqGrbLaPO4w+NoEq9oZ...R5I/wjEQND/4YmIn+rbN9uh5U/0=",
      }
    
  5. Upload part-signed transaction to Copper

    “masterPassword” required only for Warm Vault tx signing.

     + PATCH https://api.copper.co/platform/orders/{orderId}
        
     + Headers
       Content-Type: application/vnd.upload-part-signed-tx+json
       
     + Request
       {
         "masterPassword": "97dee97560699a639f3cf55c464855eefe97ae97493b242fe01ecdbab39ea463",  // optional, sha256 hash from Master Password (hex string), required for Warm Vault
       } 
          
     + Request
       {
         "transaction": {
           "type": "part-signed-tx",
           "value": "AQRwL5FqGrbLaPO4w+NoEq9oZ...R5I/wjEQND/4YmIn+rbN9uh5U/0="
         }
       }
       
     + Response 200
       {
         "amount": "0.01",
         "baseCurrency": "ETH",
         "externalOrderId": "ckdr8xy1l00303g5neu5iunh4",
         "extra": {
           "transactionId": "0xc5344c295cffc4db0dfe869bd395ced34e0877b0f139b8939cf2c357ea1599e4",
           ...
         },
         "mainCurrency": "ETH",
         "orderId": "5824946",
         "orderType": "withdraw",
         "portfolioId": "edd7e0ea-9d00-4538-b187-c14813d7b0ba",
         "portfolioType": "custody",
         "status": "processing"
       }
    

Part Sign Message

  1. Start Copper Unlimited server

    docker run --rm -ti \
      -v ${PWD}/key-backups/:/app/keys/ \
      -p 3010:3010 \
      copperexchange/copper-unlimited:latest
    

    ${PWD}/key-backups/ should contain MPC wallets backup from Copper Unlimited.

  2. Create wallet message

     + POST https://api.copper.co/platform/wallet-messages
        
     + Request
       {
         "externalMessageId": "ckdr8xy1l00303g5neu5iunh4",
         "mainCurrency": "XZC",
         "message": "test",
         "portfolioId": "edd7e0ea-9d00-4538-b187-c14813d7b0ba",  // from account
       } 
          
     + Response 201
     {
       "externalMessageId": "ckfgpkesr000d3j5twa61gzl1",
       "messageId": "24",
       "status": "working",
       "portfolioId": "ck8owwcvj000f3j5wrjoyip4d",
       "mainCurrency": "XZC",
       "extra": {
         "messageRequest": {
           "publicKeyHash": "d9f3c6b1066c188aa039e0f4a67dd8b10caf3de3e9c7862a8d0fb17320d57b14",
           "currency": "XZC",
           "mainCurrency": "XZC",
           "message": "test",
           "nonceNumber": "16"
         }
       },
       "createdBy": "191b5342-2157-4ede-9458-eb673f324468",
       "organizationId": "PSHENKIN",
       "accountId": "67126cc0-357d-4642-9596-ac0c0bdf4006",
       "createdAt": "1600945419113"
     }
    
  3. Sign message in offline copper-unlimited-server

    + POST http://127.0.0.1:3010/signatures
       
    + Headers
      Content-Type: application/json
    
    + Request
      {
        "type": "message-request",
        "keyPassword": "myTestPaswordFromKeyBackup.1234#",
        "keyFilename": "XZC_My Default Vault_wallet.copper",
       
       
         // get all this fields from message.extra.messageRequest, described above
        "signRequest": {
         "publicKeyHash": "d9f3c6b1066c188aa039e0f4a67dd8b10caf3de3e9c7862a8d0fb17320d57b14",
         "currency": "XZC",
         "mainCurrency": "XZC",
         "message": "test",
         "nonceNumber": "16"
       }
      }
       
    + Response 200 OK
      {
        "type": "part-signed-message",
        "value": "AQRwL5FqGrbLaPO4w+NoEq9oZ...R5I/wjEQND/4YmIn+rbN9uh5U/0=",
      }
    
  4. Upload part-signed message to Copper

     + PATCH https://api.copper.co/platform/wallet-messages/{walletMessageId}
        
     + Headers
       Content-Type: application/vnd.upload-part-signed-wallet-message+json
          
     + Request
       {
         "partSignedMessage": {
           "type": "part-signed-tx",
           "value": "AQRwL5FqGrbLaPO4w+NoEq9oZ...R5I/wjEQND/4YmIn+rbN9uh5U/0="
         }
       }