coral-xyz / xnft-wishlist Goto Github PK
View Code? Open in Web Editor NEWπ Wishlist of ideas for xNFTs
π Wishlist of ideas for xNFTs
An escrow program under the hood, but the idea is when you send tokens, you send it via an XNFT app that essentially puts it in escrow -- and the person you send it to has to "claim" it. Any time before its claimed you can claw it back... the thought being that if you send it to the "wrong" address it won't be lost.
Every time i send money to an address on-chain i get super nervous that I've copied the wrong address or that something is wrong, and my 6 figure USDC will be forever lost
This would protect against that by allowing me to refund it back to my account, until the time that the person I sent it to "claims" it.
Started stubbing out some functions, but never got very far with it -- would love to work with someone to get this going!
use anchor_lang::prelude::*;
use anchor_spl::token::{Mint, Token, TokenAccount};
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(
init,
seeds=[owner.key().as_ref()],
bump,
payer=owner,
space = 8 + std::mem::size_of::<Outbox>(),
)]
pub outbox: AccountLoader<'info, Outbox>,
#[account(
init_if_needed,
seeds=[owner.key().as_ref()],
bump,
payer=owner,
space = 8 + std::mem::size_of::<Inbox>(),
)]
pub inbox: AccountLoader<'info, Inbox>,
#[account(mut)]
pub owner: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[derive(Accounts)]
pub struct Send<'info> {
#[account(mut)]
pub owner: Signer<'info>,
pub token_mint: Box<Account<'info, Mint>>,
pub receiver: AccountInfo<'info>,
#[account(
init_if_needed,
seeds=[receiver.key().as_ref()],
bump,
payer=owner,
space = 8 + std::mem::size_of::<Inbox>(),
)]
pub receiver_inbox: AccountLoader<'info, Inbox>,
pub receiver_collateral_account: Box<Account<'info, TokenAccount>>,
#[account(mut)]
pub escrow_pda: Box<Account<'info, TokenAccount>>,
#[account(mut)]
pub sender_collateral_account: Box<Account<'info, TokenAccount>>,
pub token_program: Program<'info, Token>,
#[account(mut)]
pub sender_outbox: AccountLoader<'info, Outbox>,
pub system_program: Program<'info, System>,
}
#[derive(Accounts)]
pub struct Claim<'info> {
pub owner: Signer<'info>,
pub receiver: AccountInfo<'info>,
#[account(mut)]
pub receiver_inbox: AccountLoader<'info, Inbox>,
pub receiver_collateral_account: Box<Account<'info, TokenAccount>>,
#[account(mut)]
pub escrow_pda: Box<Account<'info, TokenAccount>>,
pub token_program: Program<'info, Token>,
#[account(mut)]
pub sender_outbox: AccountLoader<'info, Outbox>,
pub system_program: Program<'info, System>,
}
#[account(zero_copy)]
pub struct Outbox {
pub owner: Pubkey,
pub pending_transactions: [PendingTransaction; 16],
pub tx_count: u64,
}
impl Default for Outbox {
fn default() -> Self {
Outbox {
owner: Pubkey::default(),
pending_transactions: [PendingTransaction::default(); 16],
tx_count: 0,
}
}
}
impl Outbox {
pub fn is_full(&self) -> bool {
!self
.pending_transactions
.iter()
.any(|&pending_transaction| !pending_transaction.is_pending)
}
pub fn next_available_transaction(&mut self) -> &mut PendingTransaction {
self.pending_transactions
.iter_mut()
.find(|transaction| !transaction.is_pending)
.unwrap()
}
}
#[zero_copy]
#[derive(Default)]
pub struct PendingTransaction {
pub owner: Pubkey,
pub is_pending: bool,
pub passcode_hash: Pubkey,
pub escrow_pda: Pubkey,
pub sender_token_account: Pubkey,
pub receiver_token_account: Pubkey,
pub claim_attempts: u8,
pub tx_id: u64,
}
#[zero_copy]
#[derive(Default)]
pub struct IncomingTransaction {
pub sender: Pubkey,
pub is_pending: bool,
pub tx_id: u64,
}
#[account(zero_copy)]
pub struct Inbox {
pub owner: Pubkey,
pub incoming_transactions: [IncomingTransaction; 16],
}
impl Default for Inbox {
fn default() -> Self {
Inbox {
owner: Pubkey::default(),
incoming_transactions: [IncomingTransaction::default(); 16],
}
}
}
impl Inbox {
pub fn is_full(&self) -> bool {
!self
.incoming_transactions
.iter()
.any(|&incoming_transaction| !incoming_transaction.is_pending)
}
pub fn next_available_transaction(&mut self) -> &mut IncomingTransaction {
self.incoming_transactions
.iter_mut()
.find(|incoming_transaction| !incoming_transaction.is_pending)
.unwrap()
}
}
The idea is to make new standard of PFP or NFT game character.
xNFT container that contains other NFT.
xNFT Character can contain different traits such as body, head, hands, foots etc. etc. as immutable NFT.
This way pfp or nft character can be customisable and immutable in the same time.
P.S.: the WAO backpack collection could be great example for others
There can be a communication app like discord which let's the users communicate, create groups and hangout without leaving the Backpack. Or we can add some sort of group chats to the existing BackPack app.
Sometimes there is high activity on an address, especially when a whale is moving funds around/there is a hack.
Idea: Inject a Join call
button that connects you to everyone currently looking at this address.
Not sure how useful it'll be on a day to day basis, but may be useful during crisis times.
Can include a chat as well
Something similar to google sheet,
but only mobile UI/UX (or xNFT wallet layout) so let's say max 4-5 columns
Doesn't have to have big range of functionality as google sheet or excel - basic formulas, data validations
Should be able to read data within backpack wallet content
It's interesting as it's gives simple way for users to build custom tables of data such as portfolio, investment plan, list to do etc.
similar to create-anchor-app & create-react-app
I am interested in making an app that can verify the public key of the current wallet to an external party. It functions by displaying a signed message via a QR code.
Unfortunately the UX I have envisioned would be drastically reduced by needing to manually sign the messages via the popup which displays in the standard message-signing process. I understand that enabling auto-signing for arbitrary messages would be dangerous, but I'm wondering if we could enable auto-signing for specific messages which are safe.
In my case I'd want to be able to access:
There might be other types of auto-signed messages which would be helpful for other use-cases too, so might be worth brainstorming other safe things that could come in handy
What if we could change the theme of the app (not just between Light and Dark mode)?
I know that this isn't a "Game Changer", and I like the original theme, but would be interesting IMO π
Would really like to be able to add a wallet using a private key
Would be cool to be able to listen to podcasts from backpack
Should show all the upcoming mints on solana and/ or ethereum
something like sonar.watch
Idea: let users scroll within some 2D (or 3D?) view to see their art collection. Here is an example of this being done in 2D in a Figma file everyone's digital art was placed in frames in a gallery view with red carpet you could "walk" along, but you could also pan around the file to see what other people had done.
This is not unlike the AC experience of going to the museum to see everything you've caught and collected on display in a beautiful immersive environment πΌπ πΆπ»ββοΈ
Create an xnft in which users can subscribe to activity on certain famous addresses and get notified via push notifications anytime there's an activity in them.
Helius seems like an easy way to implement this.
I think there should be a way to verify that the code inside an xNFT matches a particular "release" on an open source project on github .. otherwise it might be hard for non-technical people to be sure that they're using an xNFT generated by someone reliable
Make xNFT to add NFTs and other tokens in there.
Use case - I add 50$ and couple NFT to xNFT send it to someone as gift. Someone can unwrap the bag and get the gifts. Or alternatively can't be unpacked before the time.
Another use case is loot boxes right on blockchain
(maybe just an IronForge xNFT)
This is inspired by Bastion wallet which enables any realms DAO to function as a normal wallet on any dApp
would be great to have an option to enable guardians on an account for recover.
https://vitalik.ca/general/2021/01/11/recovery.html gives good context
example: https://dexlab.space
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.