QED is the world's first zk-Native blockchain protocol, built to scale trustless computation and privacy for the next generation of the internet.
QED solves the fundamental scalability problem of blockchains by using zk-PARTH, a novel state model which enables massively parallel transaction proving and block generation. This allows QED to scale to millions of transactions per second, while guaranteeing security via Proof of Math.
import { ISignature, guint, hash } from '@dapen/stdlib';
import { ISmartContract, ESignUpdateXPIntent } from './dynamic-nft.abigen';
class DynamicNFTSmartContract extends ISmartContract {
...
updateXP(nftId: guint, amount: guint, signature: ISignature) {
const nft = this.state.nfts[nftId];
this.require(nft.owner == this.userId, 'You do not own this NFT');
// Construct the Signature Payload
const payload = hash([
ESignUpdateXPIntent,
this.userId,
nftId,
nft.updateCounter++,
amount
]);
// Verify the Signature from the NFT Issuer
this.verifySignature(payload, signature, this.state.issuerPublicKey);
// Update the NFT's On-Chain Metadata
nft.xp += amount;
}
}
import { ISignature, guint, hash } from '@dapen/stdlib';
import { ISmartContract, ESignUpdateXPIntent } from './dynamic-nft.abigen';
class DynamicNFTSmartContract extends ISmartContract {
...
updateXP(nftId: guint, amount: guint, signature: ISignature) {
const nft = this.state.nfts[nftId];
this.require(nft.owner == this.userId, 'You do not own this NFT');
// Construct the Signature Payload
const payload = hash([
ESignUpdateXPIntent,
this.userId,
nftId,
nft.updateCounter++,
amount
]);
// Verify the Signature from the NFT Issuer
this.verifySignature(payload, signature, this.state.issuerPublicKey);
// Update the NFT's On-Chain Metadata
nft.xp += amount;
}
}
import { ISignature, guint, hash } from '@dapen/stdlib';
import { ISmartContract, ESignUpdateXPIntent } from './dynamic-nft.abigen';
class DynamicNFTSmartContract extends ISmartContract {
...
updateXP(nftId: guint, amount: guint, signature: ISignature) {
const nft = this.state.nfts[nftId];
this.require(nft.owner == this.userId, 'You do not own this NFT');
// Construct the Signature Payload
const payload = hash([
ESignUpdateXPIntent,
this.userId,
nftId,
nft.updateCounter++,
amount
]);
// Verify the Signature from the NFT Issuer
this.verifySignature(payload, signature, this.state.issuerPublicKey);
// Update the NFT's On-Chain Metadata
nft.xp += amount;
}
}
import { ISignature, guint, hash } from '@dapen/stdlib';
import { ISmartContract, ESignUpdateXPIntent } from './dynamic-nft.abigen';
class DynamicNFTSmartContract extends ISmartContract {
...
updateXP(nftId: guint, amount: guint, signature: ISignature) {
const nft = this.state.nfts[nftId];
this.require(nft.owner == this.userId, 'You do not own this NFT');
// Construct the Signature Payload
const payload = hash([
ESignUpdateXPIntent,
this.userId,
nftId,
nft.updateCounter++,
amount
]);
// Verify the Signature from the NFT Issuer
this.verifySignature(payload, signature, this.state.issuerPublicKey);
// Update the NFT's On-Chain Metadata
nft.xp += amount;
}
}