# Hyperfy Discord - 2025-01-04

## Overall Discussion Highlights

### Technical Issues & Solutions
- **Math.random() Security Issue**: A user deployed code containing `Math.random()` to their Hyperfy world, which broke access due to security restrictions. Ashxn fixed this by removing the problematic app, highlighting that `Math.random()` is not allowed in Hyperfy's secure environment.
- **Avatar Assignment for Non-Connected Users**: Significant discussion around implementing random avatar assignment for users without connected wallets. Instead of custom solutions, Ashxn recommended using the existing "Avatars" app that automatically assigns one of three VRMs randomly.
- **World Embedding**: A user inquired about embedding Hyperfy worlds directly into their app domain rather than using hyperfy.io. This is possible with v1 but not officially supported, with upcoming announcements potentially addressing this need.

### Platform Migration & Future Plans
- **Solana Migration**: Hyperfy is transitioning to Solana, with users advised to hold off on building new wallet integration code on v1.
- **V2 Development**: Maximus mentioned that v2 will build upon v1's strengths, suggesting users can still mock up worlds while waiting for the migration.
- **Airdrop**: Confirmation that a snapshot for an airdrop has already been taken, with a registration deadline of the 7th.

### Announcements
- Ash shared an exciting update via a Twitter/X post from the Hyperfy account.

## Key Questions & Answers

**Q: Can I bring my Hyperfy world (NFT) into my app so it loads at my domain instead of hyperfy.io?**  
A: There are ways to do this with v1 but not officially. We have an upcoming announcement that might help with this. (Ashxn)

**Q: How do I troubleshoot being unable to access my world after uploading code with Math.random in it?**  
A: I can remove that app for you. The Math.random function throws an error in secure mode. (Ashxn)

**Q: What's the best practice for random avatar assignment for non-connected users?**  
A: We have an existing "Avatars" app that assigns one of three VRMs randomly to users without connected wallets. (Ashxn)  
A: Loading the person in a room/hallway with the avatars options posed together and usually an avatar bot that can explain what the world is about. (Maximus)

**Q: If I was going to create a new world with wallet integration actions should I wait until the move to Solana is complete?**  
A: Yes I would hold off on building net new code on v1. (Maximus)

**Q: You've already taken a snapshot for the airdrop, right?**  
A: Yes. (felixdigit://)

**Q: Is Shaw connected with this project?**  
A: Not really. Ash and Saori are the primary folks for Hyperfy. (Maximus)

## Community Help & Collaboration

1. **World Access Restoration**
   - Helper: Ashxn
   - Helpee: yung_algorithm
   - Context: World access broken due to Math.random() in uploaded code
   - Resolution: Ashxn removed the problematic app, restoring access to the world

2. **Avatar Assignment Implementation**
   - Helper: Ashxn
   - Helpee: yung_algorithm
   - Context: Needed solution for random avatar assignment for non-connected users
   - Resolution: Ashxn added a pre-built "Avatars" app to yung_algorithm's world that handles this functionality automatically

3. **Solana Migration Guidance**
   - Helper: Maximus
   - Helpee: SomeOtherGuy
   - Context: Whether to wait for Solana migration before creating new worlds with wallet integration
   - Resolution: Advised holding off on new code for v1 but suggested mocking up worlds since v2 will build on v1's strengths

## Action Items

### Technical
- Be cautious with `Math.random()` as it's not allowed in Hyperfy's secure environment (Mentioned by yung_algorithm)
- When using the Avatars app, avoid adding multiple instances as it's not tested for that scenario (Mentioned by Ashxn)
- Test code locally before deploying to production to avoid breaking world access (Mentioned by Ashxn)
- Reset world state after crashing code in index.js (Mentioned by yung_algorithm)
- Implement random avatar assignment while accounting for users with their own avatars (Mentioned by yung_algorithm)

### Documentation
- Register old worlds to tie to SOL address for the Solana migration (Mentioned by Maximus)

### Feature
- Official support for embedding Hyperfy worlds in custom domains (Mentioned by saltï)
- Wait for v2 before implementing wallet integration (Mentioned by Maximus)