2025-11-04 10:38:31 +07:00
|
|
|
// nockchain/common/v2/blockchain.proto
|
2025-10-06 13:38:53 +07:00
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
2025-11-04 10:38:31 +07:00
|
|
|
package nockchain.public.v2;
|
2025-10-06 13:38:53 +07:00
|
|
|
|
|
|
|
|
import "primitives.proto";
|
|
|
|
|
import "pagination.proto";
|
|
|
|
|
option go_package = "./;nockchain";
|
2025-11-04 10:38:31 +07:00
|
|
|
|
|
|
|
|
message Balance {
|
|
|
|
|
repeated BalanceEntry notes = 1;
|
|
|
|
|
BlockHeight height = 2;
|
|
|
|
|
optional Hash block_id = 3;
|
2025-10-06 13:38:53 +07:00
|
|
|
PageResponse page = 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message BalanceEntry {
|
|
|
|
|
Name name = 1;
|
|
|
|
|
Note note = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message RawTransaction {
|
2025-11-04 10:38:31 +07:00
|
|
|
NoteVersion version = 1;
|
|
|
|
|
Hash id = 2;
|
|
|
|
|
repeated SpendEntry spends = 3;
|
2025-10-06 13:38:53 +07:00
|
|
|
}
|
2025-11-04 10:38:31 +07:00
|
|
|
message SpendEntry {
|
2025-10-06 13:38:53 +07:00
|
|
|
Name name = 1;
|
|
|
|
|
Spend spend = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Spend {
|
2025-11-04 10:38:31 +07:00
|
|
|
oneof spend_kind {
|
|
|
|
|
LegacySpend legacy = 1;
|
|
|
|
|
WitnessSpend witness = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LegacySpend {
|
2025-10-06 13:38:53 +07:00
|
|
|
Signature signature = 1;
|
|
|
|
|
repeated Seed seeds = 2;
|
|
|
|
|
Nicks miner_fee_nicks = 3;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 10:38:31 +07:00
|
|
|
message WitnessSpend {
|
|
|
|
|
Witness witness = 1;
|
|
|
|
|
repeated Seed seeds = 2;
|
|
|
|
|
Nicks fee = 3;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-06 13:38:53 +07:00
|
|
|
message Seed {
|
2025-11-04 10:38:31 +07:00
|
|
|
// Absent when the seed originates from a coinbase output.
|
|
|
|
|
Source output_source = 1;
|
|
|
|
|
Hash lock_root = 2;
|
|
|
|
|
NoteData note_data = 3;
|
2025-10-06 13:38:53 +07:00
|
|
|
Nicks gift = 4;
|
|
|
|
|
Hash parent_hash = 5;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 10:38:31 +07:00
|
|
|
message Witness {
|
|
|
|
|
LockMerkleProof lock_merkle_proof = 1;
|
|
|
|
|
PkhSignature pkh_signature = 2;
|
|
|
|
|
repeated HaxPreimage hax = 3;
|
|
|
|
|
//uint64 tim = 4; // reserved field, currently 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
message HaxPreimage {
|
|
|
|
|
Hash hash = 1;
|
|
|
|
|
bytes value = 2; // jammed noun bytes
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PkhSignature {
|
|
|
|
|
repeated PkhSignatureEntry entries = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PkhSignatureEntry {
|
|
|
|
|
Hash hash = 1;
|
|
|
|
|
SchnorrPubkey pubkey = 2;
|
|
|
|
|
SchnorrSignature signature = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LockMerkleProof {
|
|
|
|
|
SpendCondition spend_condition = 1;
|
|
|
|
|
uint64 axis = 2;
|
|
|
|
|
MerkleProof proof = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message SpendCondition {
|
|
|
|
|
repeated LockPrimitive primitives = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LockPrimitive {
|
|
|
|
|
oneof primitive {
|
|
|
|
|
PkhLock pkh = 1;
|
|
|
|
|
LockTim tim = 2;
|
|
|
|
|
HaxLock hax = 3;
|
|
|
|
|
BurnLock burn = 4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PkhLock {
|
|
|
|
|
uint64 m = 1;
|
|
|
|
|
repeated Hash hashes = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LockTim {
|
|
|
|
|
TimeLockRangeRelative rel = 1;
|
|
|
|
|
TimeLockRangeAbsolute abs = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message HaxLock {
|
|
|
|
|
repeated Hash hashes = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message BurnLock {}
|
|
|
|
|
|
|
|
|
|
message MerkleProof {
|
|
|
|
|
Hash root = 1;
|
|
|
|
|
repeated Hash path = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-06 13:38:53 +07:00
|
|
|
message OutputSource { optional Source source = 1; }
|
|
|
|
|
|
|
|
|
|
message Source {
|
|
|
|
|
Hash hash = 1;
|
|
|
|
|
bool coinbase = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message TimeLockIntent {
|
|
|
|
|
oneof value {
|
|
|
|
|
TimeLockRangeAbsolute absolute = 1;
|
|
|
|
|
TimeLockRangeRelative relative = 2;
|
|
|
|
|
TimeLockRangeAbsoluteAndRelative absolute_and_relative = 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message TimeLockRangeAbsoluteAndRelative {
|
|
|
|
|
optional TimeLockRangeAbsolute absolute = 1;
|
|
|
|
|
optional TimeLockRangeRelative relative = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// min and max are absolute origin page numbers
|
|
|
|
|
message TimeLockRangeAbsolute {
|
|
|
|
|
optional BlockHeight min = 1;
|
|
|
|
|
optional BlockHeight max = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// min and max are relative to the note's creation page
|
|
|
|
|
message TimeLockRangeRelative {
|
|
|
|
|
optional BlockHeightDelta min = 1;
|
|
|
|
|
optional BlockHeightDelta max = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ===================================================================
|
|
|
|
|
// Wallet Domain Types: UTXO (nnote), Lock, and Signature (multisig)
|
|
|
|
|
// ===================================================================
|
|
|
|
|
|
|
|
|
|
message Lock {
|
|
|
|
|
uint32 keys_required = 1; // threshold of keys required to spend the note
|
|
|
|
|
// DEPRECATED: repeated string schnorr_pubkeys_b58 = 2;
|
|
|
|
|
repeated SchnorrPubkey schnorr_pubkeys =
|
|
|
|
|
2; // schnorr pubkeys (curve: cheetah)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Name {
|
|
|
|
|
// First is the hash of whether the note has a timelock and the lock
|
|
|
|
|
Hash first = 1;
|
|
|
|
|
// Last is the hash of the actual timelock and the source
|
|
|
|
|
Hash last = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 10:38:31 +07:00
|
|
|
|
2025-10-06 13:38:53 +07:00
|
|
|
message Note {
|
2025-11-04 10:38:31 +07:00
|
|
|
oneof note_version {
|
|
|
|
|
NoteV0 legacy = 1;
|
|
|
|
|
NoteV1 v1 = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
message NoteV0 {
|
2025-10-06 13:38:53 +07:00
|
|
|
BlockHeight origin_page = 1; // page-number when added to balance
|
|
|
|
|
optional TimeLockIntent timelock = 2; // enforced timelock
|
|
|
|
|
Name name = 3; // nname (human/name label)
|
|
|
|
|
Lock lock = 4; // spending condition
|
|
|
|
|
Source source = 5; // provenance commitment
|
|
|
|
|
Nicks assets = 6; // coin amount (nicks)
|
|
|
|
|
NoteVersion version = 7; // note version (currently 0)
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 10:38:31 +07:00
|
|
|
message NoteV1 {
|
|
|
|
|
NoteVersion version = 1;
|
|
|
|
|
BlockHeight origin_page = 2;
|
|
|
|
|
Name name = 3;
|
|
|
|
|
NoteData note_data = 4;
|
|
|
|
|
Nicks assets = 5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message NoteData {
|
|
|
|
|
repeated NoteDataEntry entries = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message NoteDataEntry {
|
|
|
|
|
string key = 1;
|
|
|
|
|
bytes blob = 2; // jammed noun bytes
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-06 13:38:53 +07:00
|
|
|
message Signature { repeated SignatureEntry entries = 1; }
|
|
|
|
|
|
|
|
|
|
message SignatureEntry {
|
2025-11-04 10:38:31 +07:00
|
|
|
SchnorrPubkey schnorr_pubkey = 1; // serialized pubkey corresponding to the signer
|
2025-10-06 13:38:53 +07:00
|
|
|
SchnorrSignature signature = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message SchnorrSignature {
|
|
|
|
|
EightBelt chal = 1;
|
|
|
|
|
EightBelt sig = 2;
|
|
|
|
|
}
|