Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: P-584 added bitcoin holding amount VC #2689

Merged
merged 3 commits into from
May 2, 2024

Conversation

higherordertech
Copy link
Contributor

Context

Added new data provider for BTC from https://blockchain.info, as this data is not available from existing dp.

Labels

Please apply following PR-related labels when appropriate:

  • C0-breaking: if your change could break the existing client, e.g. API change, critical logic change
  • C1-noteworthy: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvement

How (Optional)

Testing Evidences

Please attach any relevant evidences if applicable

Generated VC example:

{
   "@context":[
      "https://www.w3.org/2018/credentials/v1",
      "https://w3id.org/security/suites/ed25519-2020/v1"
   ],
   "id":"0xe4e178c6f634ca9f9c69d7c57340df5b45d5f12dada372fe8b89a58939e1f6f8",
   "type":[
      "VerifiableCredential"
   ],
   "credentialSubject":{
      "id":"did:litentry:substrate:0xd4e35b16ec6b417386b948e7eaf5cc642a243096cecf366e6313689b90969f42",
      "description":"The amount of a particular token you are holding",
      "type":"Token Holding Amount",
      "assertionText":"TokenHoldingAmount(Btc)",
      "assertions":[
         {
            "and":[
               {
                  "src":"$token",
                  "op":"==",
                  "dst":"BTC"
               },
               {
                  "or":[
                     {
                        "and":[
                           {
                              "src":"$network",
                              "op":"==",
                              "dst":"bitcoin_p2tr"
                           }
                        ]
                     },
                     {
                        "and":[
                           {
                              "src":"$network",
                              "op":"==",
                              "dst":"bitcoin_p2pkh"
                           }
                        ]
                     },
                     {
                        "and":[
                           {
                              "src":"$network",
                              "op":"==",
                              "dst":"bitcoin_p2sh"
                           }
                        ]
                     },
                     {
                        "and":[
                           {
                              "src":"$network",
                              "op":"==",
                              "dst":"bitcoin_p2wpkh"
                           }
                        ]
                     },
                     {
                        "and":[
                           {
                              "src":"$network",
                              "op":"==",
                              "dst":"bitcoin_p2wsh"
                           }
                        ]
                     }
                  ]
               },
               {
                  "src":"$holding_amount",
                  "op":">=",
                  "dst":"0"
               },
               {
                  "src":"$holding_amount",
                  "op":"<",
                  "dst":"1"
               }
            ]
         }
      ],
      "values":[
         false
      ],
      "endpoint":"http://localhost:9933"
   },
   "issuer":{
      "id":"did:litentry:substrate:0xbcbc6dc9fc214b1d9bca7fa35b86a009c9ffb8c1520c479750884a72a7d71e96",
      "name":"Litentry TEE Worker",
      "mrenclave":"EPvr7uMAhMjqwAzJwZ345qat7Re4EEm4hGgGymfgS9je"
   },
   "issuanceDate":"2024-04-24T14:08:29.478214121+00:00",
   "parachainBlockNumber":73,
   "sidechainBlockNumber":132,
   "proof":{
      "created":"2024-04-24T14:08:29.478919104+00:00",
      "type":"Ed25519Signature2020",
      "proofPurpose":"assertionMethod",
      "proofValue":"42b46330e594bbeac8bd1e1393ab9528aba69a08559401807384676715933752b6f0794034f50d71866d82a0f3f20d4afe1690df0dddc2b39d1ce34abb266102",
      "verificationMethod":"0xbcbc6dc9fc214b1d9bca7fa35b86a009c9ffb8c1520c479750884a72a7d71e96"
   },
   "credentialSchema":{
      "id":"https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/21-evm-holding-amount/1-0-0.json",
      "type":"JsonSchemaValidator2018"
   }
}

Copy link

linear bot commented Apr 25, 2024

@higherordertech higherordertech added the C1-noteworthy Non-breaking change but is worth noticing for client label Apr 25, 2024
@higherordertech higherordertech requested a review from a team April 25, 2024 07:51
@higherordertech higherordertech force-pushed the P-584-bitcoin-holding-amount branch 3 times, most recently from d96cdf1 to e414b45 Compare April 26, 2024 04:58
Copy link
Member

@kziemianek kziemianek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible and worthy to have ts test for this ?

@kziemianek kziemianek requested a review from a team April 26, 2024 08:35
@kziemianek kziemianek added the C0-breaking Breaking change that will cause existing client to break label Apr 26, 2024
@kziemianek
Copy link
Member

Not sure if C0-breaking label correct one for this case as it only relates to 'clients' but I think we definetly want to express that environmental adjustments must be done.

@kziemianek kziemianek removed the C0-breaking Breaking change that will cause existing client to break label Apr 30, 2024
Copy link
Contributor

@silva-fj silva-fj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@higherordertech higherordertech merged commit 7208568 into dev May 2, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-noteworthy Non-breaking change but is worth noticing for client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants