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

Attestations V2 #23

Open
wants to merge 138 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
cd9ea98
Enable Attestations
monkins1010 Apr 6, 2023
4d36210
Correct init of Attestations
monkins1010 Apr 6, 2023
1af9783
Typo
monkins1010 Apr 6, 2023
154341c
add more constructors
monkins1010 Apr 6, 2023
4f556a0
add decision
monkins1010 Apr 6, 2023
348be7a
Add attesation reply
monkins1010 Apr 6, 2023
818d978
updates for data
monkins1010 Apr 12, 2023
1c99825
Updates for types of premissions
monkins1010 Apr 14, 2023
5130a1f
Refactor Permission Class
monkins1010 Apr 17, 2023
19d25e1
Challenge updated
monkins1010 Apr 17, 2023
9f5627e
Fix for blank array
monkins1010 Apr 18, 2023
eef8770
Allow empty permission()
monkins1010 Apr 18, 2023
1fd85f0
Refactor RequestedPermission
monkins1010 Apr 18, 2023
ec0ea10
vdxfkey update
monkins1010 Apr 18, 2023
0fb819a
Merge remote-tracking branch 'upstream/master'
monkins1010 Apr 21, 2023
c8039df
Merge remote-tracking branch 'verus/master'
monkins1010 May 7, 2023
4fc7b95
Merge remote-tracking branch 'verus/master'
monkins1010 Jun 16, 2023
4f22a13
update
monkins1010 Jun 16, 2023
4b4c6af
Add Principals and TxDestination
monkins1010 Jun 16, 2023
09ecb41
Start adding in the Identity Serializer
monkins1010 Jun 16, 2023
917c6d0
Remove dupliacate and add to index
monkins1010 Jun 16, 2023
c7e00c7
Autosave 1:44 21/06/2023
monkins1010 Jun 21, 2023
3b8bb5c
Push to principal addresses array
monkins1010 Jun 21, 2023
5274539
Adding contentmultimap processing
monkins1010 Jun 21, 2023
14f0505
Updates to contentmultimap
monkins1010 Jun 21, 2023
5fc9631
update addresses
monkins1010 Jun 21, 2023
1aa4cad
Updates to Identity SErializer
monkins1010 Jun 22, 2023
e447c41
From object to buffer test pass
monkins1010 Jun 23, 2023
9994c93
Identity Serializer passing
monkins1010 Jun 23, 2023
bc8cf4a
Merge remote-tracking branch 'verus/master'
monkins1010 Jun 23, 2023
7d2581b
Build and add attestation tests
monkins1010 Jun 23, 2023
cd4c236
Partial build of attestation class for review
monkins1010 Jun 28, 2023
f8e7ef4
Add Attestation functions
monkins1010 Jul 7, 2023
8a75bbc
Fix Attestation Serialization
monkins1010 Jul 10, 2023
91ed3f7
Read byteLength Attestations
monkins1010 Jul 10, 2023
5c82882
Start Adding MMR Functions to Attestations
monkins1010 Jul 10, 2023
c6a617d
Add MMR
monkins1010 Jul 12, 2023
f968257
Builds updated
monkins1010 Jul 14, 2023
6a9914f
Merge remote-tracking branch 'upstream/master'
monkins1010 Jul 18, 2023
504f224
Merge remote-tracking branch 'verus/master'
monkins1010 Aug 1, 2023
0765c6c
Merge branch 'master' of https://github.com/monkins1010/verus-typescr…
monkins1010 Aug 1, 2023
7f7cf75
Merge remote-tracking branch 'verus/master'
monkins1010 Oct 18, 2023
22a40be
Merge branch 'master' of https://github.com/monkins1010/verus-typescr…
monkins1010 Oct 18, 2023
4db33b4
Update Attestation Keys
monkins1010 Oct 20, 2023
c2042b5
Merge branch 'master' of https://github.com/monkins1010/verus-typescr…
monkins1010 Oct 20, 2023
ad63592
Updates to Compactsize
monkins1010 Oct 20, 2023
50264f0
Updates from merge
monkins1010 Nov 6, 2023
b80fd97
Merge branch 'master' of https://github.com/monkins1010/verus-typescr…
monkins1010 Nov 6, 2023
b790b50
Update Blake2b library
monkins1010 Nov 7, 2023
2750520
Add create hash back in
monkins1010 Nov 7, 2023
473b5d0
Use BN instead of BigInt
monkins1010 Nov 7, 2023
c304748
Merge branch 'master' of https://github.com/monkins1010/verus-typescr…
monkins1010 Nov 7, 2023
0fcb2ec
Change BN > to gt
monkins1010 Nov 7, 2023
c6ccf32
Return to @noble hashes
monkins1010 Nov 7, 2023
4a6ee16
add big integer
monkins1010 Nov 7, 2023
23df01d
Swap Requested access constructor arguments to be consistent
monkins1010 Nov 8, 2023
55d1813
Merge remote-tracking branch 'upstream/master'
monkins1010 Nov 9, 2023
992b95b
Fix conflicts
monkins1010 Nov 9, 2023
04654dd
update yarn lock
monkins1010 Nov 9, 2023
b55bddc
update blake2b
monkins1010 Nov 10, 2023
6938dc6
Merge remote-tracking branch 'upstream/master'
monkins1010 Dec 4, 2023
10723f7
Add AttestationProof type with per leaf proof
monkins1010 Dec 14, 2023
f360fc2
Add AttestationData
monkins1010 Jan 2, 2024
5b0f879
Consolotate Attestation Class to be a full document, or a pruned ZK M…
monkins1010 Jan 3, 2024
bf0dc03
Add Attestation VDXFID webhook
monkins1010 Jan 5, 2024
1743fb8
Remove get and BN, Add Attestation Receiver
monkins1010 Jan 10, 2024
34e0d22
Add sytemID to signatures
monkins1010 Jan 11, 2024
789884e
wIP1
monkins1010 Jan 17, 2024
6eacc67
updates to mmr class
Jan 17, 2024
ffea9ce
WIP2
Jan 19, 2024
0d3e3fd
Updates to use Verus MMR type classes
monkins1010 Jan 29, 2024
f0ebfd5
Fix Component hash
monkins1010 Jan 29, 2024
444440a
Add CPartialAttestationProof
monkins1010 Jan 30, 2024
aec4960
Serialization fixes
monkins1010 Jan 30, 2024
b360a33
Refactor VDXF Keys, Friendly Names and Functions
monkins1010 Jan 31, 2024
5c35c33
Refactor vdxfid types functions
monkins1010 Jan 31, 2024
657e9aa
Create classes for Attestation data types
monkins1010 Feb 1, 2024
4cbbb93
Add in Attestation Keys
monkins1010 Feb 2, 2024
59eca7b
Key names updates
monkins1010 Feb 13, 2024
1578afb
Attestation Keys update
monkins1010 Feb 16, 2024
fe71ac8
Dependencies updates
monkins1010 Feb 16, 2024
e1d8d19
Merge remote-tracking branch 'upstream/master' into attest
monkins1010 Feb 16, 2024
66a1ca0
Added Personal Info
monkins1010 Feb 19, 2024
d889495
Update bech32 version and filenames
monkins1010 Feb 20, 2024
5a4e3d3
Updates to Personal Data and Attestations
monkins1010 Feb 23, 2024
2256443
camalcase fix
monkins1010 Feb 27, 2024
0b24869
Remove unused imports
monkins1010 Feb 27, 2024
4f05c8f
Add view keys
monkins1010 Feb 29, 2024
f51d0f9
Update Catagories
monkins1010 Mar 8, 2024
306ea8d
export profile types
monkins1010 Mar 8, 2024
0687804
Updates to add more categories
monkins1010 Mar 12, 2024
9453bf9
Key Updates
monkins1010 Mar 14, 2024
f7e2614
Add Category Keynames
monkins1010 Mar 21, 2024
7e7fbdf
Add attestation receive request
monkins1010 Mar 22, 2024
e216bb3
Added extra requested access item
monkins1010 Mar 25, 2024
17c4f8c
Rebuild error fix
monkins1010 Mar 26, 2024
9e486e0
Spelling Fixes
monkins1010 Mar 27, 2024
89915a6
Merge remote-tracking branch 'upstream/master' into attest
monkins1010 Mar 27, 2024
07e5840
sync keys
monkins1010 Mar 27, 2024
5d669d8
Add DataDescriptor, MMRDescriptor
monkins1010 Apr 15, 2024
c67d764
Updates to Classes for Datadescriptor WIP2
monkins1010 Apr 18, 2024
bbf57aa
Updates to CVDXF_Data
monkins1010 Apr 23, 2024
f85d66e
Add toJson Functions for Datadescriptor
monkins1010 Apr 24, 2024
e7ca299
Add signaturedata fromJson function
monkins1010 Apr 24, 2024
84ab394
Update Attestation to use VDXFData and Datadescriptors
monkins1010 Apr 26, 2024
a567298
Add classes to exports
monkins1010 Apr 26, 2024
4f00f0f
Add Attestation keys for Name and Type
monkins1010 Apr 29, 2024
079132b
Updates for debug
monkins1010 Apr 29, 2024
97b0b34
Remove circular dependancy
monkins1010 Apr 29, 2024
4c1de51
Updates for offsets
monkins1010 Apr 30, 2024
65ada69
Fix deserialization of MMRDescriptor
monkins1010 Apr 30, 2024
d8f323d
Add Attestation object key
monkins1010 May 2, 2024
19352f6
Add VDXFDataToUniValue
monkins1010 May 3, 2024
2e43bbf
Fix signature serializing
monkins1010 May 3, 2024
f34f2c7
Add helper function, and fix toJson for datadescriptors
monkins1010 May 10, 2024
bf7cd12
change Request to just data type
monkins1010 May 17, 2024
236b468
Extra keys to catagorize attestations viewed
monkins1010 May 20, 2024
2018f3d
update
monkins1010 May 20, 2024
194f1be
update test
monkins1010 May 20, 2024
dff3b51
Merge remote-tracking branch 'upstream/master' into attest
monkins1010 May 21, 2024
a2432b3
Add SignData
monkins1010 Aug 20, 2024
35ceb68
update dist
monkins1010 Sep 27, 2024
d71f45b
Updates to code base from code reveiew comments.
monkins1010 Oct 1, 2024
b6b37bb
Updates to comments for review
monkins1010 Oct 2, 2024
6731259
Merge remote-tracking branch 'upstream/master' into attest
monkins1010 Oct 2, 2024
d6dc753
Build dist Update
monkins1010 Oct 2, 2024
32464f4
update json key names and make consistent json functions
monkins1010 Oct 2, 2024
4491a5a
Updates to VdxfUniValue
monkins1010 Oct 8, 2024
9818850
More updates to VdxfUniValue
monkins1010 Oct 8, 2024
da760f4
Update identity tests with new contentmap style
monkins1010 Oct 8, 2024
c1c3856
Updates for tests #1
monkins1010 Oct 9, 2024
b6c596d
Tests updates
monkins1010 Oct 10, 2024
6e13097
Remove Helper function and combine into fromBuffer
monkins1010 Oct 15, 2024
cfceb6c
Fix capitals commit 1
monkins1010 Nov 11, 2024
ec2919f
Fix Capitals complete.
monkins1010 Nov 11, 2024
032524e
Fix serializers and add tests
monkins1010 Nov 20, 2024
f2f1fbb
update test
monkins1010 Nov 20, 2024
979735d
Update dist
monkins1010 Nov 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update blake2b
  • Loading branch information
monkins1010 committed Nov 10, 2023
commit b55bddccfc88b1bca19570609f23e399764e9449
2 changes: 1 addition & 1 deletion dist/vdxf/classes/Attestation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export declare class Attestation extends VDXFObject {
toDataBuffer(): Buffer;
fromDataBuffer(buffer: Buffer, offset?: number): number;
getMMR(): Promise<MMR>;
routeHash(): Promise<void>;
routeHash(): Promise<any>;
getHash(n: AttestationData): Buffer;
sortHashes(): Array<Buffer>;
}
4 changes: 2 additions & 2 deletions dist/vdxf/classes/MMR.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ export declare class MMR {
_leafLength: number;
db: any;
constructor(db?: MemoryBasedDb);
digest(input: any): void;
digest(input: any): any;
get(leafIndex: any): Promise<any>;
_get(nodePosition: any): Promise<any>;
append(value: any, leafIndex: any): Promise<void>;
appendMany(values: any, startLeafIndex: any): Promise<void>;
getRoot(leafIndex?: number): Promise<void>;
getRoot(leafIndex?: number): Promise<any>;
getNodeLength(): Promise<any>;
getLeafLength(): Promise<number>;
delete(leafIndex: any): Promise<void>;
Expand Down
5 changes: 3 additions & 2 deletions dist/vdxf/classes/MMR.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MMR = void 0;
//import { blake2b } from '@noble/hashes/blake2b'
var blake2b = require('blake2b');
const { Lock } = require('semaphore-async-await');
class Position {
constructor(index, height, rightness) {
Expand All @@ -33,7 +33,8 @@ class MMR {
this.lock = new Lock(1);
}
digest(input) {
return; //blake2b(Buffer.concat([...input]), {dkLen: 32, personalization: "VerusDefaultHash"})
var out = Buffer.allocUnsafe(32);
return blake2b(out.length, null, null, Buffer.from("VerusDefaultHash")).update(Buffer.concat([...input])).digest(out);
}
get(leafIndex) {
return __awaiter(this, void 0, void 0, function* () {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
"dependencies": {
"base64url": "3.0.1",
"bech32": "^1.1.3",
"blake2b": "https://github.com/VerusCoin/blake2b",
"bn.js": "5.2.1",
"bs58check": "https://github.com/bitcoinjs/bs58check",
"create-hash": "1.2.0",
"semaphore-async-await": "^1.5.1"
},
"devDependencies": {
"@types/blake2b": "^2.1.3",
"@types/bn.js": "5.1.1",
"@types/bs58check": "2.1.0",
"@types/create-hash": "1.2.2",
Expand Down
5 changes: 3 additions & 2 deletions src/vdxf/classes/MMR.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Classes should not have the "C" prefix when taken out of C
  2. The vdxf/ directory was created for vdxf objects or vdxf-related objects, whereas MMRs are a more general construct. I recommend creating a new directory called MMR within classes and moving mmr-related classes there
  3. Spacing
  4. Please make properties snakecase and methods camelCase to match the rest of the lib
  5. Please separate out the classes into different files in the MMR folder

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//to permit persons to whom the Software is furnished to do so, subject to the following conditions:


//import { blake2b } from '@noble/hashes/blake2b'
var blake2b = require('blake2b')
const { Lock } = require('semaphore-async-await')

class Position{
Expand All @@ -34,7 +34,8 @@ export class MMR{
}

digest(input){
return //blake2b(Buffer.concat([...input]), {dkLen: 32, personalization: "VerusDefaultHash"})
var out = Buffer.allocUnsafe(32);
return blake2b(out.length, null, null, Buffer.from("VerusDefaultHash")).update(Buffer.concat([...input])).digest(out);
}

async get(leafIndex){
Expand Down
30 changes: 30 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@
dependencies:
"@babel/types" "^7.3.0"

"@types/blake2b@^2.1.3":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@types/blake2b/-/blake2b-2.1.3.tgz#bd6bf2fbabd888b5580d7e932de5960d087db094"
integrity sha512-MFCdX0MNxFBP/xEILO5Td0kv6nI7+Q2iRWZbTL/yzH2/eDVZS5Wd1LHdsmXClvsCyzqaZfHFzZaN6BUeUCfSDA==

"@types/bn.js@5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.1.tgz#b51e1b55920a4ca26e9285ff79936bbdec910682"
Expand Down Expand Up @@ -935,6 +940,11 @@ array-union@^2.1.0:
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==

b4a@^1.0.1:
version "1.6.4"
resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.4.tgz#ef1c1422cae5ce6535ec191baeed7567443f36c9"
integrity sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==

babel-jest@^28.1.3:
version "28.1.3"
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.3.tgz#c1187258197c099072156a0a121c11ee1e3917d5"
Expand Down Expand Up @@ -1017,6 +1027,21 @@ bech32@^1.1.3:
resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9"
integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==

blake2b-wasm@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/blake2b-wasm/-/blake2b-wasm-2.4.0.tgz#9115649111edbbd87eb24ce7c04b427e4e2be5be"
integrity sha512-S1kwmW2ZhZFFFOghcx73+ZajEfKBqhP82JMssxtLVMxlaPea1p9uoLiUZ5WYyHn0KddwbLc+0vh4wR0KBNoT5w==
dependencies:
b4a "^1.0.1"
nanoassert "^2.0.0"

"blake2b@https://github.com/VerusCoin/blake2b":
version "2.1.4"
resolved "https://github.com/VerusCoin/blake2b#578dc12b7b68a3ce76d1e1add1402b28a5890a6b"
dependencies:
blake2b-wasm "^2.4.0"
nanoassert "^2.0.0"

bn.js@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70"
Expand Down Expand Up @@ -2308,6 +2333,11 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

nanoassert@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09"
integrity sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down