You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clarify and Implement Stamp Ownership vs Issuer Address Distinction
Overview
Currently, our codebase doesn't properly distinguish between different types of stamp-related addresses:
Issuer Address (1A)
The mint/stamp service address that technically issues/mints the stamp
Currently stored in creator field in our database
Example: "1GPfBjHemZayEHkPFuMTQsPUPDSdv86oHf"
Ownership Address (1B)
The artist/creator address that owns the stamp (copyright holder)
Currently not properly tracked in our system
Example: "183kq...1CCBV"
Can transfer ownership to another address (ownership transfer)
Edition Owners
Addresses that own editions/copies of the stamp
Currently tracked via transfers/balances
Can transfer editions to other addresses
Can create dispensers to sell editions
Current Issues
Code Locations Using Incorrect Address Types
islands/stamp/details/StampInfo.tsx:
const creatorDisplay = stamp.creator_name
? stamp.creator_name
: abbreviateAddress(stamp.creator, 8);
// Using issuer address (1A) instead of ownership address (1B)
islands/Wallet/details/WalletDispenserDetails.tsx (plus another two similar wallet details files in the works):
function StampStats({
dispensers,
walletData,
}) {
// ... creator display using issuer address instead of ownership address
const creatorDisplay = (
<span>
<span className="hidden mobileMd:block mobileLg:hidden desktop:block">
{stampData.creator_name || stampData.creator} // Using issuer address (1A)
</span>
</span>
);
}
server/db/tables/stamp.ts:
// Current schema missing ownership tracking
Proposed Solution
1. New Types
interface StampOwnership {
stampId: string;
issuerAddress: string; // 1A - Mint service address
ownerAddress: string; // 1B - Current copyright owner
ownershipTransferHistory: {
fromAddress: string;
toAddress: string;
timestamp: Date;
txHash: string;
}[];
}
interface OwnershipTransfer {
stampId: string;
currentOwnerAddress: string; // Current copyright holder
newOwnerAddress: string; // New copyright holder
txHash: string;
}
// Update existing StampRow interface
interface StampRow {
// ... existing fields ...
issuerAddress: string; // 1A - Mint service address (rename from creator)
ownerAddress: string; // 1B - Current copyright owner (new field)
}
2. Database Changes
sql
-- Rename creator column to issuer_address for clarity
ALTER TABLE stamps RENAME COLUMN creator TO issuer_address;
-- Add owner_address column
ALTER TABLE stamps ADD COLUMN owner_address TEXT NOT NULL;
-- Create ownership transfer history table
CREATE TABLE stamp_ownership_transfers (
id SERIAL PRIMARY KEY,
stamp_id TEXT NOT NULL,
from_address TEXT NOT NULL,
to_address TEXT NOT NULL,
tx_hash TEXT NOT NULL,
timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (stamp_id) REFERENCES stamps(stamp_id)
);
-- Add indexes
CREATE INDEX idx_stamps_owner_address ON stamps(owner_address);
CREATE INDEX idx_ownership_transfers_stamp_id ON stamp_ownership_transfers(stamp_id);
Clarify and Implement Stamp Ownership vs Issuer Address Distinction
Overview
Currently, our codebase doesn't properly distinguish between different types of stamp-related addresses:
Issuer Address (1A)
creator
field in our databaseOwnership Address (1B)
Edition Owners
Current Issues
Code Locations Using Incorrect Address Types
islands/stamp/details/StampInfo.tsx
:islands/Wallet/details/WalletDispenserDetails.tsx
(plus another two similar wallet details files in the works):server/db/tables/stamp.ts
:Proposed Solution
1. New Types
2. Database Changes
3. New API Endpoints
Implementation Tasks
Database:
API Layer:
UI Updates:
Documentation:
Migration Plan
Database updates:
API updates:
UI updates:
Questions
Related Issues
/label enhancement
/label breaking-change
/priority high
The text was updated successfully, but these errors were encountered: