aboutsummaryrefslogtreecommitdiffstats
path: root/src/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'src/schemas')
-rw-r--r--src/schemas/ec_signature_schema.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/schemas/ec_signature_schema.ts b/src/schemas/ec_signature_schema.ts
new file mode 100644
index 000000000..94e58e53c
--- /dev/null
+++ b/src/schemas/ec_signature_schema.ts
@@ -0,0 +1,20 @@
+export const ECSignatureParameter = {
+ id: '/ECSignatureParameter',
+ type: 'string',
+ pattern: '^0[xX][0-9A-Fa-f]{64}$',
+};
+
+export const ECSignatureSchema = {
+ id: '/ECSignature',
+ properties: {
+ v: {
+ type: 'number',
+ minimum: 27,
+ maximum: 28,
+ },
+ r: {$ref: '/ECSignatureParameter'},
+ s: {$ref: '/ECSignatureParameter'},
+ },
+ required: ['v', 'r', 's'],
+ type: 'object',
+};